Start script hangs without error when there are no available inotify watches
See original GitHub issueDescription
I tried to run npm start
in a new project (i.e. I ran the four commands under “Quick Overview”), and it hanged indefinitely (well, at least for several minutes until I aborted) after the output “Starting packager…”.
Running react-native start
gave the error ERROR watch {path} ENOSPC
, which made me realize that there were no available inotify watches.
After increasing fs.inotify.max_user_watches
, npm start
started and ran normally.
Expected Behavior
npm start
should give a warning or exit with an error saying that there are no available watches, so it can’t start.
Observed Behavior
npm start
hanged with this output, and never continued:
$ npm start
> my-app@0.1.0 start /home/trygve/dev/create-react-native-app/my-app
> react-native-scripts start
13.49.26: Starting packager...
Environment
Please run these commands in the project folder and fill in their results:
npm ls react-native-scripts
: react-native-scripts@0.0.30npm ls react-native
: react-native@0.44.2npm ls expo
: expo@17.0.0node -v
: v7.10.0npm -v
: 4.6.1yarn --version
: 0.24.6watchman version
: Not installed
Also specify:
- Operating system: Arch Linux
- Phone/emulator/simulator & version: Not relevant
Reproducible Demo
Ran npm start
in a clean project just created, so nothing to provide here.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:44
- Comments:59 (11 by maintainers)
Top GitHub Comments
I also have the same issue, using OSX Sierra 10.12.5. sysctl returns
sysctl: unknown oid 'fs.inotify.max_user_watches'
. Any ideas? 😦 I can’t start up any react iOS app, the simulator does, but nothing else happens and it gets stuck in the Packager thing…Nevemind, fixed it with this:
@tetralix On Linux do “sudo sysctl -w fs.inotify.max_user_watches=10000”. This changes kernel sysctl value. This is temporary until reboot. To make it permanent, add fs.inotify.max_user_watches=10000 to a file in /etc/sysctl.d directory or /etc/sysctl.conf depending on distro.