【原】Cannot find entry file index.ios.js [index.android.js] in any of the roots
2017-08-08 14:39
966 查看
今天在运行新的React Native项目时,出现了错误。
错误信息如图:
![](https://oscdn.geek-share.com/Uploads/Images/Content/202012/14/4db1227ca6edd030d6ac0f03c7b95058)
在stackoverflow上搜索了一下,发现很多人遇到过这个问题。React Native的github上也有相应的Issue#14246。
于是参考大家的方法一一进行尝试,如切换React Native版本,
使用npm start – –reset-cache命令重新启动包管理器等。但都没有奏效。
最后参考hmatijevic@github(在这里再次感谢hmatijevic)的方法解决了问题,原来是安装了watchman导致的。
将watchman卸载掉,问题得到了解决(具体原因,暂时还未深究)。
另外附一下我的机器环境:
错误信息如图:
在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 运行报错:Cannot find entry file index.android.js in any of the roots
- React Native demo运行报错:Cannot find entry file index.android.js in any of the roots
- Android开发 Error:The number of method references in a .dex file cannot exceed 64K.
- Android开发 Error(建议收藏下来以备不时之需):The number of method references in a .dex file cannot exceed 64K.
- Android Error:The number of method references in a .dex file cannot exceed 64K.
- Android开发 Error(建议收藏下来以备不时之需):The number of method references in a .dex file cannot exceed 64K.
- Android开发 Error(建议收藏下来以备不时之需):The number of method references in a .dex file cannot exceed 64K.
- Android “64k”的问题以及解决方案 Error:The number of method references in a .dex file cannot exceed 64K.
- Could not find output/file.out in any of the configured local directories
- Android开发 Error(建议收藏下来以备不时之需):The number of method references in a .dex file cannot exceed 64K.
- msfconsole run error – Could not find rake-10.4.2 in any of the sources
- 异常处理_Cannot find any information on property 'XXX' in a bean of type 'XXX'
- Could not find gem 'sass-rails (~> 5.0) x64-mingw32' in any of the gem sources listed in your Gemfil
- gitlab 安装报错:Could not find modernizr-2.6.2 in any of the sources
- 【Android】-- 处理 android 方法总数超过 65536 . the number of method references in a .dex file exceed 64k的两种办法
- bundle install时候出现"Could not find modernizr-2.6.2 in any of the sources"
- 如何处理 android 方法总数超过 65536 . the number of method references in a .dex file exceed 64k
- Could not load file or assembly 'App_Web_xxxx' or one of its dependencies. The system cannot find the file specified.
- Cannot find any information on property 'S' in a bean of type 'beans.Circle'
- “System.IO.FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 错误