Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start script hangs without error when there are no available inotify watches #234

Closed
trygveaa opened this issue Jun 2, 2017 · 59 comments
Closed
Assignees
Labels

Comments

@trygveaa
Copy link

trygveaa commented Jun 2, 2017

Description

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.30
  • npm ls react-native: react-native@0.44.2
  • npm ls expo: expo@17.0.0
  • node -v: v7.10.0
  • npm -v: 4.6.1
  • yarn --version: 0.24.6
  • watchman version: Not installed

Also specify:

  1. Operating system: Arch Linux
  2. Phone/emulator/simulator & version: Not relevant

Reproducible Demo

Ran npm start in a clean project just created, so nothing to provide here.

@brentvatne

This comment has been minimized.

@brentvatne brentvatne added the bug label Jun 2, 2017
@nimir

This comment has been minimized.

@thinq4yourself

This comment has been minimized.

@k3a

This comment has been minimized.

@s417-lama

This comment has been minimized.

@igor-levkov

This comment has been minimized.

@k3a
Copy link

k3a commented Jul 8, 2017

@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.

@igor-levkov

This comment has been minimized.

@luffs
Copy link

luffs commented Jul 10, 2017

Spent hours googling, reinstalling, upgrading, downgrading, switching to yarn until I found this issue. Thank you!

+1 to have an error message...

Used this guide to increase the inotify watchers max amount:
https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers

@penniath

This comment has been minimized.

@akshaynaik404

This comment has been minimized.

@ashishrvtech

This comment has been minimized.

@darkguy2008

This comment has been minimized.

@vs1682

This comment has been minimized.

@kevz93

This comment has been minimized.

@k3a

This comment has been minimized.

@darkguy2008

This comment has been minimized.

@vs1682

This comment has been minimized.

@trygveaa

This comment has been minimized.

@vs1682

This comment has been minimized.

@nickjuntilla

This comment has been minimized.

@nickjuntilla

This comment has been minimized.

@k3a

This comment has been minimized.

@vs1682

This comment has been minimized.

@darkguy2008

This comment has been minimized.

@vs1682

This comment has been minimized.

@sathiz

This comment has been minimized.

@tiongooi

This comment has been minimized.

@Meekohi

This comment has been minimized.

@anp

This comment has been minimized.

@Meekohi

This comment has been minimized.

@lrvlr

This comment has been minimized.

@brentvatne

This comment has been minimized.

@cyan33
Copy link

cyan33 commented Nov 26, 2017

FYI, I ran into the same issue again, but fixed with running

sudo sysctl -w kern.maxfiles=5242880
sudo sysctl -w kern.maxfilesperproc=524288

I think it would be weird and confusing to come across this error at very beginning. And it would not hurt to mention this in an obvious position of the document, rather than in this issue.

ADMIN EDIT: these commands work for Mac only.

@ghost

This comment has been minimized.

@ghost

This comment has been minimized.

@Meekohi

This comment has been minimized.

@alper

This comment has been minimized.

@Meekohi

This comment has been minimized.

@jsstrn
Copy link

jsstrn commented Jan 30, 2018

To solve this issue, just install Watchman via Homebrew (for macOS) with:

$ brew update
$ brew install watchman

Source: Watchman docs. For other operating systems, refer to their docs.

@sendsent

This comment has been minimized.

@Kristories

This comment has been minimized.

@vinniejames

This comment has been minimized.

@ide

This comment has been minimized.

@vinniejames

This comment has been minimized.

@ide

This comment has been minimized.

@cwervo
Copy link

cwervo commented Mar 14, 2018

Just ran into this issue. Agreed with the above commenters that something like:

On MacOS run:

    $ brew install watchman

should be added to the error message. Of course adding other relevant information for other OS's as well. Pretty bad developer experience to have to come to this GH issue & skim to find out what I needed to do just to run the example setup.

@geoffreywiseman
Copy link

geoffreywiseman commented Mar 19, 2018

Maybe just include a URL to watchman -- no sense providing install instructions as they vary by platform and could be subject to change, no sense coupling CRNA to the installation instructions for watchman IMO.

e.g.

6:55:12 p.m.: Unable to start server
For more information:  https://git.io/v5vcn
To resolve, either install watchman:  https://git.io/vxGX7
Or run the following snippet:
  sudo sysctl -w kern.maxfiles=5242880
  sudo sysctl -w kern.maxfilesperproc=524288

@noodlebreak

This comment has been minimized.

@DStt

This comment has been minimized.

@willxy
Copy link

willxy commented Jun 10, 2018

OSX; ran into same thing, had to read the entire thread to find out what "install watchman" means and that it doesn't mean npm, agree with comments that it should at least point to the watchman website, although having it suggest "brew install watchman" would be by far the most helpful.

@anp
Copy link
Contributor

anp commented Jun 13, 2018

@willxy you're right! Since this issue is apparently showing up in search results for lots of people, I decided to lock this and to hide all comments that don't contain important information for fixing the issue. Hopefully it should be much easier to read the history now. If after installing watchman (NOT using the watchman npm package) and raising inotify/fsevents limits you're still having issues, please open a new issue! Thanks.

@expo expo locked as resolved and limited conversation to collaborators Jun 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests