create-react-native-app: stuck on "Starting packager..."

Description

When I start a new project and run yarn run ios it opens the simulator. But as soon as the second or third time I try to use yarn run ios again while working on the app it hangs on Starting packager... for over 5 minutes.

Expected Behavior

Run the ios simulator (again)

Observed Behavior

I’ve started over 4 times now and it always has a problem at a different, seemingly random stage in me building the app when I try to use yarn run ios. It works and works and works and then eventually it stops working and I have to start over again. IT doesn’t seem to be a consistant point in which things stop working. I was using npm to install and run processes but now I’m using yarn. Both have the same issue. I’m following instructions in this guide by the way, both as-is and with yarn instead of npm. Even when I revert to my git history when it was working, and rm -rf node_modules && yarn install / npm install the problem persists

If there’s an error message, please paste the full terminal output and error message in this code block:

Error text goes here!

Environment

Please run these commands in the project folder and fill in their results:

  • npm ls react-native-scripts: react-native-scripts@1.14.0
  • npm ls react-native: react-native@0.55.4
  • npm ls expo: expo@27.1.0
  • node -v: v10.4.1
  • npm -v: 6.1.0
  • yarn --version: 1.7.0
  • watchman version: “version”: “4.9.0”

Also specify:

  1. Operating system: macOS High Sierra 10.13.5
  2. Phone/emulator/simulator & version: Version 10.0 (SimulatorApp-851.2 CoreSimulator-518.22)

Reproducible Demo

This is reproducable by following the steps in the guide linked above.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 4
  • Comments: 16

Most upvoted comments

I managed to find the solution.

There could be multiple reasons for the issue. For the most recent version of react-native (Aug 2018), what you might need to do is just press ‘q’, it will displays the QR code.

After that, you use the expo app scan the QR code, it should start to bundle the scripts and load it to your phone.

If not, you have might another issue which is caused by the incompatibility among React-Native, React and Expo. If you are using Expo 27, you should use reactive-native 0.55.

There is a complete matrix here, https://github.com/react-community/create-react-native-app/blob/master/VERSIONS.md

Anyone who face problem after running npm audit fix, that is because it will try to install react-native 0.56 which doesn’t work with Expo 27 well.

I solve by changing the react-native-scripts from 1.14.1 to 1.14.0 and react-native from 0.56 to 0.55.4. Then rm -rf node_modules and npm install. This installation will displays vulnerabilities warning, and npm recommend to npm audit. Just leave it and npm start.

I created a fresh project with crna and noticed there were security vulnerabilities from the npm audit so I ran npm audit fix. When I try and run the app I get stuck on starting packager.

If I do not run the npm audit fix command it works fine.

I have the same issue and I literally have tried all above + all other topics. is there a log on this thing ?

I did:

- react-native-scripts from 1.14.1 to 1.14.0
- react-native from 0.56 to 0.55.4
- rm -rf node_modules
- npm install
- npm run ios (or another key, what do you have for entrypoint) p.s. needs waiting for first start ~1 minutes

And everything works fine. I hope that helps others 👍

@trentbrooks I ended up giving up and using Expo’s XDE And didn’t have any problems.

And this is why its failing:

image

The newest version wasn’t looking for the Metro Bundler. You can go into the file, which the pull request mentions and write the fix yourself if you want.

react-native-scripts/src/util/packager.js

https://github.com/react-community/create-react-native-app/pull/674/commits/684a6414b35b29310c9eda6d72a75b5211759fe8

Same issue on mac. This ‘starting packager…’ problem spans many issues on github - i’ve tried every fix listed, but still not working.

I’ve tried each of the following: rm -rf node_modules && npm install,

echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_watches && echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_queued_events && echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_instances && echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p,

watchman watch-del-all && watchman shutdown-server,

sudo chmod -R 777 ~/.expo/

yarn ejectyarn ios

@cngodles , hm… I think you read my answer too fast. I was saying running npm audit fix will cause a problem, and the reason was incompatibility, and the link I put there shows the matrix about what version works with what.