【原】Cannot find entry file index.ios.js [index.android.js] in any of the roots

今天在运行新的React Native项目时,出现了错误。
错误信息如图:

【原】Cannot find entry file index.ios.js [index.android.js] in any of the roots_第1张图片



在stackoverflow上搜索了一下,发现很多人遇到过这个问题。React Native的github上也有相应的Issue#14246。

于是参考大家的方法一一进行尝试,如切换React Native版本,
使用npm start – –reset-cache命令重新启动包管理器等。但都没有奏效。

最后参考hmatijevic@github(在这里再次感谢hmatijevic)的方法解决了问题,原来是安装了watchman导致的。

将watchman卸载掉,问题得到了解决(具体原因,暂时还未深究)。

打开资源管理器=》结束watchman进程=》卸载watchman,并移除path环境变量中移除watchman的路径。
重新运行react-native run-android/run-ios即可。

另外附一下我的机器环境:

OS: Windows 10
react-native-cli: 2.0.1
react-native: 0.47.1
node: 8.2.1
npm: 5.3.0

你可能感兴趣的:(react-native)