create-react-native-app: react-native-scripts start stuck at "Starting packager..."

Description

I can’t start any CRNA project because it get stuck at “Starting packager”, i tried many project but the problem still remains. It always get stuck at “Starting packager…”

Expected Behavior

It should start the project and show me the expo QR code

Observed Behavior

Stuck at “Starting packager…”

Note

npm shows me an unmet dependency error with expo and react: npm ERR! peer dep missing: react@>=15.3.1, required by lottie-react-native@1.1.1 npm ERR! peer dep missing: react@>=15.4.0, required by react-native-branch@2.0.0-beta.3

Environment

  • npm ls react-native-scripts: react-native-scripts@1.1.0
  • npm ls react-native: react-native@0.46.4
  • npm ls expo: expo@19.0.1
  • node -v: v7.10.0
  • npm -v: 4.2.0
  • yarn --version: 0.24.5
  1. Operating system: Ubuntu 16.04

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 29
  • Comments: 60 (3 by maintainers)

Most upvoted comments

Try

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

If it’s still stuck, then install watchman from here and do this

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

I’m seeing this problem as well.

Host: Ubuntu 17.04 64-bit Node: 8.4.0 NPM: 4.6.1 create-react-native-app: 1.0.0

Creating the project:

$ create-react-native-app myapp
...
npm WARN react-redux@5.0.6 requires a peer of react@^0.14.0 || ^15.0.0-0 || ^16.0.0-0 but none was installed.
...
npm WARN react-native-gesture-handler@1.0.0-alpha.17 requires a peer of react@>= 16.0.0 but none was installed.
npm WARN react-native-branch@2.0.0-beta.3 requires a peer of react@>=15.4.0 but none was installed.
npm WARN lottie-react-native@1.1.1 requires a peer of react@>=15.3.1 but none was installed.

Attempting to start Expo:

$ npm start

> myapp@0.1.0 start path/to/myapp
> react-native-scripts start

11:59:53: Starting packager...

…and nothing happens after that. No QR code. Nothing.

I tried running:

$ sudo sysctl -w fs.inotify.max_user_instances=1024
fs.inotify.max_user_instances = 1024
$ sudo sysctl -w fs.inotify.max_user_watches=12288
fs.inotify.max_user_watches = 12288

…and installing watchman. Neither made any difference.

When it says “Starting packager…” press the “q” key. To show QR code

When it says “Starting packager…”, press the “q” key.

Fixed by running sudo sysctl -w fs.inotify.max_user_watches=10000

@nathan-osman Have the same problem on a mac sierra

If you did npm audit fix you might have updated your dependencies to latest versions and the problem is that REACT-NATIVE 0.56.* DOESNT WORK WITH EXPO 27. You should use 0.55.* REACT-NATIVE and never run npm audit fix but npm audit to fix manually

This works for me in package.json

"expo": "^27.0.1",
"react": "16.3.1",
"react-native": "~0.55.2",

here is table of compatabilities image

I have 2 machines: Both run Ubuntu 16.04, same nodejs, yarn, create-react-native-app version, but one use SSD and one doesn’t. The one without SSD does not have this problem. The one with SSD needs a very big fs.inotify.max_user_watches (mine was 10000000)

Hopefully this info can be helpful in finding the root cause somehow.

Hi All, on my Ubuntu-System the Packager always stucks and the react-native-app not start fully.

The hint to add the parameters fs.inotify.... to sysctl not worked at all, in no way for me.

I tried other different things under Ubuntu 17.10, but the only thing what worked was the manual compilation and installation from watchman (see https://facebook.github.io/watchman/docs/install.html):

sudo apt-get install -y autoconf automake build-essential python-dev git clone https://github.com/facebook/watchman.git cd watchman git checkout v4.9.0 # the latest stable release ./autogen.sh ./configure make sudo make install

Then use

sudo npm update in the project

and

sudo npm start

This worked for me.

Solved by connecting to a VPN.

Facing issues with the npm star stuck with no error. Started from #234 and learned to increase my inotify watchers but the problem still come from time to time. So as @limichange and @0x5e i concluded it’s a network related issue!

A quick look at the packager scripts no requests appear there! and even with DEBUG=* and --verbose nothing useful is logged! So tried running iftop to monitor requests and i see many of them to aws, cloudfront, …etc which seems to be fired somewhere from the packager dependencies (expo probably). As of other users from China we share the same issue requiring proxy connection for these hosts and being based in Africa, we have a bad connection!

I really loved the convenience this package brings to RN development experience and it would be great to be able to develop offline and only request internet connection if/when user wants to publish to expo or something!

Please let me know if there might be another cause to this and how can i help resolving it?

I added 127.0.2.1 exp.host to /etc/host as a workaround.

Had the same problem just starting with create-react-native-app today on Ubuntu 17.10 and finally got it working on Linux.

First of all:

Environment:
  OS: Linux 4.13
  Node: 8.9.1
  Yarn: 1.3.2
  npm: 5.5.1
  Watchman: 4.9.0
  Xcode: N/A
  Android Studio: Not Found

Packages: (wanted => installed)
  react: 16.0.0-beta.5 => 16.0.0-beta.5
  react-native: ^0.49.5 => 0.49.5

Install watchman as explained here

For a fresh Ubuntu install you’ll need the following dependencies to build Watchman:

$ sudo apt-get install python-dev libssl-dev autoconf automake libtool

Not sure why python-dev and libssl-dev are not mentioned, but you’ll need them to build it.

Follow the instructions for Build from Source.

Next, this:

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

And finally, you can run yarn start and it should work.

thanks a ton, @dhruvdutt

even if you’ve installed watchman with brew, watchman watch-del-all && watchman shutdown-server (it should be supposed to, right?) in the root dir still works and solved the infamous “Starting packager…” freeze issue.

the trick was watchman shutdown-server here. watchman watch-del-all only was never enough in my case.

I don’t know what solved it for me but here are the steps I took:

  1. brew update && brew update watchman
  2. rm -rf node_modules && npm cache clean && npm i
    • I got the same npm warnings about the react version.
  3. npm start

This gave me the QR code!

I ran the sysctl commands on Ubuntu 17.04, but to no avail. What did work however was removing node_modules and then installing all packages with yarn instead of npm through yarn install. I had previously run npm install out of sheer habit.

Hey guys. I faced the same problem and this solved the problem for me. I hope it will solve your problem too.

Ok. It was fixed by runnig sudo sysctl -w fs.inotify.max_user_watches=10000 before “npm start”

I found it in Expo forums.

Reference : https://forums.expo.io/t/packager-not-loading-on-linux/2034

I have the same problems with fresh CRNA project. I am using Ubuntu 16.04.