`

react-native-error

阅读更多
1.

error: bundling failed: Error: Unable to resolve module `@babel/runtime/helpers/interopRequireDefault` from `/Users/chrisedgington/Development/ReactNative/SixNationsPredictor/index.js`: Module `@babel/runtime/helpers/interopRequireDefault` does not exist in the Haste module map

This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
  1. Clear watchman watches: `watchman watch-del-all`.
  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.
  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.
    at ModuleResolver.resolveDependency (/Users/chrisedgington/Development/ReactNative/MyApp/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:209:1301)
    at ResolutionRequest.resolveDependency (/Users/chrisedgington/Development/ReactNative/MyApp/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:83:16)
    at DependencyGraph.resolveDependency (/Users/chrisedgington/Development/ReactNative/MyApp/node_modules/metro/src/node-haste/DependencyGraph.js:238:485)
    at Object.resolve (/Users/chrisedgington/Development/ReactNative/MyApp/node_modules/metro/src/lib/transformHelpers.js:180:25)
    at dependencies.map.result (/Users/chrisedgington/Development/ReactNative/MyApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:311:29)
    at Array.map (<anonymous>)
    at resolveDependencies (/Users/chrisedgington/Development/ReactNative/MyApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:307:16)
    at /Users/chrisedgington/Development/ReactNative/MyApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:164:33
    at Generator.next (<anonymous>)
    at step (/Users/chrisedgington/Development/ReactNative/MyApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:266:307)


===================》》》》
Have a go and try:

npm add @babel/runtime

Or upgrade babel runtime:

"@babel/runtime": "7.0.0-beta.55"


2.react native中的CameraRoll使用时,TypeError: Cannot read property 'getPhotos' of undefined错误

==================>>>>>>>>>

在xcode中手动导入RCTCameraRoll.xcodeproj

右键“Library”,选择“Add ....”   RCTCameraRoll.xcodeproj的路径为

"/Users/xxxx/demo/node_modules/react-native/Libraries/CameraRoll"

然后,选中项目,不是选中当前库,在Link Binary With Libraries 菜单中加入libRCTVideo.a到工程中,直接拖过去。

继续运行就可以了


3. react-native-fs出现bugCannot read property 'RNFSFileTypeRegular' of undefined

这个有可能是代码没有同步造成的,具体原因不详,但是解决方案已经找到。关掉APP,重新运行一下就OK了。

4.No bundle URL present. Make sure you’re running a packager server or have included a .jsbundle file in your application bundle.

==================>
删除ios/build路径,然后重新react-native run-ios

没有用,接着第二种办法:

删除node_modules,然后重新react-native run-ios
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics