Create-react-native-app: [email protected] start: `react-native-scripts start`- ERR! Exit status 1

Created on 26 Aug 2017  ·  41Comments  ·  Source: expo/create-react-native-app

npm start fails

Go through the few steps at https://facebook.github.io/react-native/docs/getting-started.html

type npm start

And get this:

> [email protected] start /Users/nige/react-native/AwesomeProject
> react-native-scripts start

12:23:22 PM: Unable to start server
See https://git.io/v5vcn for more information, either install watchman or run the following snippet:
  sudo sysctl -w kern.maxfiles=5242880
  sudo sysctl -w kern.maxfilesperproc=524288


npm ERR! Darwin 16.6.0
npm ERR! argv "/Users/nige/.nvm/versions/node/v7.10.1/bin/node" "/Users/nige/.nvm/versions/node/v7.10.1/bin/npm" "start"
npm ERR! node v7.10.1
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `react-native-scripts start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script 'react-native-scripts start'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the AwesomeProject package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     react-native-scripts start
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs AwesomeProject
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls AwesomeProject
npm ERR! There is likely additional logging output above.

Here's the log file:

0 info it worked if it ends with ok
1 verbose cli [ '/Users/nige/.nvm/versions/node/v7.10.1/bin/node',
1 verbose cli   '/Users/nige/.nvm/versions/node/v7.10.1/bin/npm',
1 verbose cli   'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 silly lifecycle [email protected]~prestart: no script for prestart, continuing
7 info lifecycle [email protected]~start: [email protected]
8 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~start: PATH: /Users/nige/.nvm/versions/node/v7.10.1/lib/node_modules/npm/bin/node-gyp-bin:/Users/nige/react-native/AwesomeProject/node_modules/.bin:/Users/nige/.nvm/versions/node/v7.10.1/bin:/Users/nige/bin/Sencha/Cmd/6.1.2.5/..:/Users/nige/bin/Sencha/Cmd/6.1.1.76/..:/Users/nige/bin/Sencha/Cmd/6.0.3.34/..:/Users/nige/bin/Sencha/Cmd/6.0.3.34/..:/Users/nige/bin/Sencha/Cmd/6.0.2.8/..:/Users/nige/bin/Sencha/Cmd/6.0.2.8/..:/Users/nige/bin/Sencha/Cmd/6.0.1.75/..:/Users/nige/bin/Sencha/Cmd/6.0.1.64/..:/Users/nige/bin/Sencha/Cmd:/Users/nige/bin/Sencha/Cmd:/Users/nige/bin/Sencha/Cmd:/Users/nige/bin/Sencha/Cmd:/Users/nige/bin/Sencha/Cmd:/Users/nige/bin/Sencha/Cmd:/Users/nige/bin/Sencha/Cmd:/Users/nige/bin/Sencha/Cmd:/Users/nige/bin/Sencha/Cmd:/Users/nige/bin/Sencha/Cmd/6.0.0.122:/Users/nige/bin/Sencha/Cmd/6.0.0.119:/Users/nige/bin/Sencha/Cmd/6.0.0.117:/Users/nige/bin/Sencha/Cmd/6.0.0.101:/Users/nige/bin/Sencha/Cmd/6.0.0.99:/Users/nige/bin/Sencha/Cmd/6.0.0.81:/Users/nige/bin/Sencha/Cmd/6.0.0.50:/Users/nige/bin/Sencha/Cmd/6.0.0.46:/Users/nige/bin/Sencha/Cmd/6.0.0.45:/Users/nige/bin/Sencha/Cmd/6.0.0.42:/Users/nige/bin/Sencha/Cmd/5.5.0.31:/Users/nige/bin/Sencha/Cmd/5.5.0.16:/Users/nige/bin/Sencha/Cmd/5.1.1.38:/Users/nige/bin/Sencha/Cmd/5.1.0.26:/Users/nige/bin/Sencha/Cmd/5.1.0.25:/Users/nige/bin/Sencha/Cmd/5.1.0.20:/Users/nige/bin/Sencha/Cmd/5.1.0.21:/Users/nige/bin/Sencha/Cmd/5.1.0.13:/Users/nige/bin/Sencha/Cmd/5.1.0.11:/Users/nige/bin/Sencha/Cmd/5.1.0.6:/Users/nige/bin/Sencha/Cmd/5.0.3.324:/Users/nige/bin/Sencha/Cmd/5.0.3.317:/Users/nige/bin/Sencha/Cmd/5.0.1.224:/Users/nige/bin/Sencha/Cmd/5.0.1.219:/Users/nige/bin/Sencha/Cmd/5.0.1.214:/Users/nige/bin/Sencha/Cmd/5.0.1.211:/Users/nige/bin/Sencha/Cmd/6.2.0.46/..:/Users/nige/bin/Sencha/Cmd/6.2.0.36/..:/Users/nige/bin/Sencha/Cmd/6.2.0.22/..:/Users/nige/bin/Sencha/Cmd/6.2.0.14/..:/Users/nige/bin/Sencha/Cmd/6.2.0.4/..:/Users/nige/bin/Sencha/Cmd/6.1.3.16/..:/Users/nige/bin/Sencha/Cmd/6.0.0.122:/Users/nige/bin/Sencha/Cmd/6.0.0.119:/Users/nige/bin/Sencha/Cmd/6.0.0.117:/Users/nige/bin/Sencha/Cmd/6.0.0.101:/Users/nige/bin/Sencha/Cmd/6.0.0.99:/Users/nige/bin/Sencha/Cmd/6.0.0.81:/Users/nige/bin/Sencha/Cmd/6.0.0.50:/Users/nige/bin/Sencha/Cmd/6.0.0.46:/Users/nige/bin/Sencha/Cmd/6.0.0.45:/Users/nige/bin/Sencha/Cmd/6.0.0.42:/Users/nige/bin/Sencha/Cmd/5.5.0.31:/Users/nige/bin/Sencha/Cmd/5.5.0.16:/Users/nige/bin/Sencha/Cmd/5.1.1.38:/Users/nige/bin/Sencha/Cmd/5.1.0.26:/Users/nige/bin/Sencha/Cmd/5.1.0.25:/Users/nige/bin/Sencha/Cmd/5.1.0.20:/Users/nige/bin/Sencha/Cmd/5.1.0.21:/Users/nige/bin/Sencha/Cmd/5.1.0.13:/Users/nige/bin/Sencha/Cmd/5.1.0.11:/Users/nige/bin/Sencha/Cmd/5.1.0.6:/Users/nige/bin/Sencha/Cmd/5.0.3.324:/Users/nige/bin/Sencha/Cmd/5.0.3.317:/Users/nige/bin/Sencha/Cmd/5.0.1.224:/Users/nige/bin/Sencha/Cmd/5.0.1.219:/Users/nige/bin/Sencha/Cmd/5.0.1.214:/Users/nige/bin/Sencha/Cmd/5.0.1.211:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin
10 verbose lifecycle [email protected]~start: CWD: /Users/nige/react-native/AwesomeProject
11 silly lifecycle [email protected]~start: Args: [ '-c', 'react-native-scripts start' ]
12 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
13 info lifecycle [email protected]~start: Failed to exec start script
14 verbose stack Error: [email protected] start: `react-native-scripts start`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/Users/nige/.nvm/versions/node/v7.10.1/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:194:7)
14 verbose stack     at ChildProcess.<anonymous> (/Users/nige/.nvm/versions/node/v7.10.1/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:194:7)
14 verbose stack     at maybeClose (internal/child_process.js:899:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid [email protected]
16 verbose cwd /Users/nige/react-native/AwesomeProject
17 error Darwin 16.6.0
18 error argv "/Users/nige/.nvm/versions/node/v7.10.1/bin/node" "/Users/nige/.nvm/versions/node/v7.10.1/bin/npm" "start"
19 error node v7.10.1
20 error npm  v4.2.0
21 error code ELIFECYCLE
22 error errno 1
23 error [email protected] start: `react-native-scripts start`
23 error Exit status 1
24 error Failed at the [email protected] start script 'react-native-scripts start'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the AwesomeProject package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error     react-native-scripts start
24 error You can get information on how to open an issue for this project with:
24 error     npm bugs AwesomeProject
24 error Or if that isn't available, you can get their info via:
24 error     npm owner ls AwesomeProject
24 error There is likely additional logging output above.
25 verbose exit [ 1, true ]

Most helpful comment

As suggested at the error message, installing watchman solved this error for me (OSX 10.9.5). It seems like that the necessity of watchman should be mentioned in README.

In addition, you may have to touch .watchmanconfig and git init on your project's root to solve the following error:

jest-haste-map: Watchman crawl failed. Retrying once with node crawler.
  Usually this happens when watchman isn't running. Create an empty `.watchmanconfig` file in your project's root folder or initialize a git or hg repository in your project.
  Error: Watchman error: query failed: synchronization failed: No such file or directory. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.html.

All 41 comments

Same error here

I'm getting the same error

As suggested at the error message, installing watchman solved this error for me (OSX 10.9.5). It seems like that the necessity of watchman should be mentioned in README.

In addition, you may have to touch .watchmanconfig and git init on your project's root to solve the following error:

jest-haste-map: Watchman crawl failed. Retrying once with node crawler.
  Usually this happens when watchman isn't running. Create an empty `.watchmanconfig` file in your project's root folder or initialize a git or hg repository in your project.
  Error: Watchman error: query failed: synchronization failed: No such file or directory. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.html.

When I installed it from source, and I execute MacBook-Pro-de-Hector:watchman Hector$ ./autogen.sh this error appears: ./autogen.sh: line 9: aclocal: command not found /br ./autogen.sh: line 10: autoheader: command not found ./autogen.sh: line 11: automake: command not found ./autogen.sh: line 12: autoconf: command not found

Doing the stepts in #229 I got this error:
MacBook-Pro-de-Hector:local Hector$ create-react-native-app FirstProject (node:834) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: EACCES: permission denied, mkdir '/usr/local/FirstProject'

Downgrade the npm version 5 to 4 by command npm install -g [email protected] and it works

Watchman was the solution for me as well.

@ExtAnimal @simplyluke Can we close this issue, if solution is looks relevant to you.

Watchman worked for me

I had the same error. So, the terminal mentions either to install watchman or type in the following code:

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

I tried the code and it worked. Looking at the other replies, I'm guessing watchman also works, but to me typing two lines of code seemed like the easier option.

I applied the same solution as @ashwanth1109 as it's all good now. Cheers

Seems like the watchman resolution has worked for lots of people here.

@ashwanth1109 solution works for me without installing watchman.

downgrading to 4 and adding these two lines worked for me.

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

Thanks @ashwanth1109

Problem fixed by installing watchman:
brew install watchman

sudo sysctl -w kern.maxfiles=5242880
sudo sysctl -w kern.maxfilesperproc=524288
worked for me!

sudo sysctl -w kern.maxfiles=5242880
sudo sysctl -w kern.maxfilesperproc=524288
worked for me!

@megane42 Can you tell me how you installed watchman on OSX 10.9.5? Brew supports only >= Yosemite and I'm unable to build from source because 'fstatat' is not available on OSX.

@hahahatrick My .bash_history says:

git clone https://github.com/facebook/watchman.git
cd watchman/
git checkout v4.7.0
./autogen.sh
./configure
make
sudo make install
watchman --version

but I have already upgraded to OSX 10.12 so I can't confirm...
Hope this helps you.

Just installing watchman worked for me OSX 10.12.6

brew update
brew install watchman

Thanks @megane42

Just installing watchman is work for me to ubuntu 16.04

This worked for me and is faster than installing watchman!

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

$ npm install watchman
npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
[email protected] /Users/name/Developments/LUT/tipcalc
└── [email protected]

Maybe npm wasn't the way to do it and is getting an old version because npm is put of date? I had to downgrade npm to 4.x.x from 5.xx because otherwise else the react-native/ios simulator would not work.

It's like no-one is talking to anyone else and allowing upstream/downstream to make changes before versions are pushed.

See the Watchman installation docs for how to install Watchman, which depends on the OS you are using: https://facebook.github.io/watchman/docs/install.html. For macOS, you can install Homebrew and run brew install watchman. It's also a good idea to increase the inotify limits (also OS-dependent) and the Watchman site has troubleshooting info here: https://facebook.github.io/watchman/docs/troubleshooting.html.

Recommendations:

OS: macOS 10.13.x
Package installer: Yarn https://yarnpkg.com
Watchman: brew install watchman (don't install it from npm)

Running below two commands resolved my issue.

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

worked for me.

The problem is back, but @ashwanth1109 solution works!

I first started with npm but I had 5.6.0 and downgrading did not help. I restarted my installation, the yarn way, and then downloaded watchman: brew install watchman. Worked like a charm! :)

sudo sysctl -w kern.maxfiles=5242880
sudo sysctl -w kern.maxfilesperproc=524288
worked for me!

For me npm start works, but when I try to view the application via android mobile it just shows exp symbol and it is not loading the app. It works with ios simulator.
Also doesn't give any errors too.
Mobile is Redmi 4 Android Version 7.1.2

I had the same error and what I did is "npm install" to install all dependency and it works.

Why are we supposed to change the kernel's max files parameters to fix this? That's not something you change without thinking about it. Does React Native open an absurd number of files or something?

Both the solutions would work as suggested above:
1) Update brew and install watchman
2) Increase the processing kernel files size

Watchman is now deprecated.
https://www.npmjs.com/package/watchman

The solution is to run the two commands:

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

This is relevant. See below at later comments.

I just had to install watchman using brew and it worked for me!

Watchman was the solution for me as well.

Only on OS 10.6 and earlier you should increase the pre-process descriptor limit.
__To do it temporary__ you can just type in your terminal the following:

$ sudo sysctl -w kern.maxfiles=10485760
$ sudo sysctl -w kern.maxfilesperproc=1048576

Otherwise, if you'd like to __keep them always__, modify /etc/sysctl.conf with these new values:

kern.maxfiles=10485760
kern.maxfilesperproc=1048576

Run the following commands, copy from your terminal. It works for me well.

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

How on earth is anyone supposed to figure this out on their own without Google. The error thats related to this is nonsense!

FWIW, In the Ruby community, if a dependency is missing we actually tell you about it instead of letting the thread go splat. Something along the lines of "watchman could not be found. Please run brew install watchman and try again". JavaScript community...you all have so much to learn still.

sudo sysctl -w kern.maxfiles=5242880
sudo sysctl -w kern.maxfilesperproc=524288
worked for me!

This worked for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iRoachie picture iRoachie  ·  5Comments

jckuhl picture jckuhl  ·  4Comments

anp picture anp  ·  3Comments

tonyhb picture tonyhb  ·  5Comments

WeslleyNasRocha picture WeslleyNasRocha  ·  4Comments