3

iOS emulator error

I started getting this error when running an existing project withreact-native run-ios. To try to see if there was something wrong with my project I ran react-native init EmptyProject to create a blank project that should work perfectly. I still get this error even with that.

I've looked at this question on stack overflow and ran ./node_modules/react-native/packager/packager.sh start --resetCache on both my existing project and the empty project to no avail. Any clues as to what might be going on?

6
  • what version of react-native cli are you using? Try upgrading rn client n node, initialize a new prjct n see if it works Commented Mar 29, 2017 at 17:06
  • For react-native-cli I'm using version 4.1.2. I've tried upgrading and react native, but it hasn't had any effect. It breaks even with brand new projects. Commented Mar 29, 2017 at 17:19
  • you mean your node version is 4.1.2 Commented Mar 29, 2017 at 17:21
  • Oh wait. npm is version 4.1.2. react-native-cli is version 2.0.1. Commented Mar 29, 2017 at 17:25
  • latest stable version of node is 6.10.1 and rn client is 2.0.1 upgrade n see if it works Commented Mar 29, 2017 at 17:25

1 Answer 1

2

After several hours of trial and error I managed to fix the problem. At this point, I don't know which specific thing fixed it, but here's all the main things I did.

  • Updated node to the latest version
  • brew update && brew upgrade
  • brew install watchman
  • Fixed all issues that came up with brew doctor
  • rm -rf ./node_modules ios android
  • yarn
  • react-native upgrade
  • Added babel-preset-react-native-stage-0 as a dev dependency in my package.json
  • Added "react-native-stage-0" as a preset to my babel.rc
  • ./node_modules/react-native/packager/packager.sh start --resetCache

After all of that my projects have been running smoothly again without any problems.

Sign up to request clarification or add additional context in comments.

3 Comments

./node_modules/react-native/packager/packager.sh start --resetCache is what worked for me :)
Also good to note that after you reset your cache you will need to perform a restart on the simulator to rebuild index.ios.js
I didn't find packager folder inside react-native folder , how can I get that, any solution ?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.