React-native 常见错误解决

1. Requiring unknown module "xxx"

npm start 重启packager
Requiring unknown module

2. 卡在“Building xx Rect | Running 1 of 2 custom shell scripts”

npm run reset 

或者

   watchman watch-del-all
   rm -rf node_modules && npm install
   npm start -- --reset-cache

3. 'CodePush/CodePush.h' file not found

切换分支后总是Build失败,之前是好的,正确的方法是

执行 npm run dev:ios-max 或者 npm run dev:ios, 这才是正确的姿势

4. double-conversion issues

cd node_modules/react-native/scripts && ./ios-install-third-party.sh && cd ../../../
cd node_modules/react-native/third-party/glog-0.3.5/ && ../../scripts/ios-configure-glog.sh && cd ../../../../
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容