react-native: [0.45.0] Project roots are incorrect if packager starts when invoking `react-native run-ios`
Steps for reproduction
First make sure you have no react-native packager instance running
react-native init Bananas
cd Bananas
react-native run-ios
Effect
I get the error
Cannot find entry file index.ios.js in any of the roots: ["/Users/dshe/code/Bananas/node_modules/react-native/packager"]

Workaround
Start the packager from yarn start
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 10
- Comments: 26 (2 by maintainers)
In my case:
Open terminal Tab 01: react-native start Open terminal Tab 02: react-native run-ios
Should work :-p
+1
@kostap13 Hmm. Here is what I did to resolve the error:
lsof -n -i4TCP:8081kill -9 (process id returned above)npm startI used this solution and succeed twice (one for upgrading from 0.44 to 0.45, one for downgrading from 0.46 to 0.45)
@MSchmidt @ds300 Like I said
Let me rephrase the solution again:
watchman watch-del-allrm -rf node_modules && npm installnpm start -- --reset-cachereact-native run-iosMaybe this commit broke build https://github.com/facebook/react-native/commit/236e9e4d01f60225855477b710fd4b5e1b8817fb
I got this when doing
react-native run-androidas well (this is with a brand new project created withreact-native init TestProject3), so I don’t think the problem is limited to ios.