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

於是問題解決,可以正常運行!

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM