react-native 爬坑

 

最近学习react native时出现一些问题为方便自己,同时造福后来者,特此记录

运行react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/asset
s/index.android.bundle --assets-dest android/app/src/main/res

时出现以下问题

Unable to resolve module `AccessibilityInfo` from `D:\react-native\Newbie\node_modules\react-native\Libraries\react-native\react-native-im
plementation.js`: Module `AccessibilityInfo` 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-*`.

 

找了半天解决办法

1:进入cmd

2:运行以下命令

npm uninstall -g react-native-cli

3:安装

npm install react-native@0.55.4

4:安装

npm install -g react-native-cli@1.2.0

5:初始化工程

react-native init --version="0.55.4" +'工程名'
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值