ReactNativie错误记录

[新手提问前先来这里看看]React Native的常见问题

npm包管理错误

Unable to resolve module react/lib/ReactUpdates from /Users/user/Downloads/react-native-sudoku-master/node_modules/react-native/Libraries/react-native/react-native.js: Module does not exist in the module map or in these directories:
  /Users/user/Downloads/react-native-sudoku-master/node_modules/react-native/node_modules/react/lib
,  /Users/user/Downloads/react-native-sudoku-master/node_modules/react/lib

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 packager cache: `rm -fr $TMPDIR/react-*` or `npm start -- --reset-cache`.

RCTFatal + 104
-[RCTBatchedBridge stopLoadingWithError:] + 1138
__25-[RCTBatchedBridge start]_block_invoke_2 + 65
_dispatch_call_block_and_release + 12
_dispatch_client_callout + 8
_dispatch_main_queue_callback_4CF + 1054
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
__CFRunLoopRun + 2205
CFRunLoopRunSpecific + 420
GSEventRunModal + 161
UIApplicationMain + 159
main + 111
start + 1

上面这个错误stackoverflow和github的issue都有很多方法,但是找了很久没有能解决我问题的,后来各种删除node_modules然后npm install ,npm update,npm cache clean都不能解决问题
stackoverflow解决方法
后来发现,每次intall完都有一个WARN,提示react没有install

Paste_Image.png

然后又修改了package.json的react版本美号,各种单独install react,再update,后来成功了
好像是因为包依赖的问题,react一直没有下下来,是网络问题?


Paste_Image.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • npm install -g hexo-clisudo npm install -g hexo-clinode -...
    iOS的Developer阅读 14,912评论 2 0
  • 尽管在移动开发中,原生APP的开发成本很高,但现阶段基于原生开发仍然是必须的,因为Web的用户体验仍无法超越Nat...
    奔跑的大橙子阅读 10,735评论 0 11
  • 创建ReactNative工程 最近在学习React-Native开发,是由Facebook出的。把学习经验记录一...
    o_O小薯条阅读 9,194评论 0 0
  • 已然婚后两三年,之前的轰轰烈烈化作昨日黄花,凋敝在时间的荒芜里;过往的恩爱甜蜜在油盐酱醋茶中不见踪影,暗淡了...
    千飞鹿阅读 6,657评论 4 4
  • #寒假支教来了# 这个寒假不急着回家的伙伴们,看过来,我们将组织一次在武汉本地的支教项目,请看下文! 时间:1月1...
    苦笑嫣然阅读 1,599评论 0 0