React Native:Cannot find entry file index.ios.js in any of the roots

初次使用react-native 依照官网

终端输入:react-native init Myapp

cd Myapp

react-native run-ios

默认打开模拟器一片红屏报错如下:

Cannot find entry file index.ios.js in any of the roots

解决方案

删除 node_modules:rm -rf node_modules && npm install

再react-native init Myapp重启还是报错如下:

解决方案

1、删除ios/build路径

2、开两个终端 cd Myapp 

一个输入  npm start 

一个启动项目 react-native run-ios

于是问题解决,可以正常运行!

 

posted @ 2018-08-28 10:55  龙骑士baby  阅读(1042)  评论(0编辑  收藏  举报