Create-react-app: Unable to start app with 'npm start'

Created on 28 Feb 2018  ·  4Comments  ·  Source: facebook/create-react-app

Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes

Which terms did you search for in User Guide?

Environment

  1. node -v: v8.9.4
  2. npm -v: 5.6.0
  3. yarn --version (if you use Yarn):
  4. npm ls react-scripts (if you haven’t ejected):

[email protected] /home/pankaja/Documents/Projects/Showcase/my-app
└── [email protected]

Then, specify:

  1. Operating system: Ubuntu 17.10
  2. Browser and version (if relevant):

Steps to Reproduce

(Write your steps here:)

  1. Installed create-react-app globally by npm install -g create-react-app
  2. Created a react-app by running create-react-app my-app
  3. cd my-app
  4. npm start

Tried creating an app with npx too

  1. npx create-react-app my-app
  2. cd my-app
  3. npm start

Expected Behavior

Start the app on http://localhost:3000/

Actual Behavior

Didn't start the app. Got this error on terminal

Starting the development server...

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: watch /home/pankaja/Documents/Projects/Showcase/my-app/public/index.html ENOSPC
    at _errnoException (util.js:1022:11)
    at FSWatcher.start (fs.js:1374:19)
    at Object.fs.watch (fs.js:1400:11)
    at createFsWatchInstance (/home/pankaja/Documents/Projects/Showcase/my-app/node_modules/chokidar/lib/nodefs-handler.js:37:15)
    at setFsWatchListener (/home/pankaja/Documents/Projects/Showcase/my-app/node_modules/chokidar/lib/nodefs-handler.js:80:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/pankaja/Documents/Projects/Showcase/my-app/node_modules/chokidar/lib/nodefs-handler.js:228:14)
    at FSWatcher.NodeFsHandler._handleFile (/home/pankaja/Documents/Projects/Showcase/my-app/node_modules/chokidar/lib/nodefs-handler.js:255:21)
    at FSWatcher.<anonymous> (/home/pankaja/Documents/Projects/Showcase/my-app/node_modules/chokidar/lib/nodefs-handler.js:473:21)
    at FSReqWrap.oncomplete (fs.js:153:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `react-scripts start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pankaja/.npm/_logs/2018-02-28T12_37_50_742Z-debug.log

And this is the log file

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', '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 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/pankaja/Documents/Projects/Showcase/my-app/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle [email protected]~start: CWD: /home/pankaja/Documents/Projects/Showcase/my-app
10 silly lifecycle [email protected]~start: Args: [ '-c', 'react-scripts start' ]
11 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:925:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/pankaja/Documents/Projects/Showcase/my-app
16 verbose Linux 4.13.0-36-generic
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
18 verbose node v8.9.4
19 verbose npm  v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: `react-scripts start`
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Reproducible Demo

  1. npm install create-react-app -g
  2. create-react-app my-app
  3. cd my-app
  4. npm start

Most helpful comment

This was an issue with watchers. Fixed it by following this https://stackoverflow.com/questions/22475849/node-js-error-enospc/32600959#32600959

All 4 comments

This isn't a bug. Another process was running on port 3000.

This wasn't an issue with a process running on the port.
Now I created a new app and started working for sometime and closed that app (killed the process from the terminal too).
Then sometime later I started to created the app by running npm start and got this error.

Starting the development server...

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: watch /home/pankaja/Documents/Projects/React/showcase/weather-app/public ENOSPC
    at _errnoException (util.js:1022:11)
    at FSWatcher.start (fs.js:1374:19)
    at Object.fs.watch (fs.js:1400:11)
    at createFsWatchInstance (/home/pankaja/Documents/Projects/React/showcase/weather-app/node_modules/chokidar/lib/nodefs-handler.js:37:15)
    at setFsWatchListener (/home/pankaja/Documents/Projects/React/showcase/weather-app/node_modules/chokidar/lib/nodefs-handler.js:80:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/pankaja/Documents/Projects/React/showcase/weather-app/node_modules/chokidar/lib/nodefs-handler.js:228:14)
    at FSWatcher.NodeFsHandler._handleDir (/home/pankaja/Documents/Projects/React/showcase/weather-app/node_modules/chokidar/lib/nodefs-handler.js:407:19)
    at FSWatcher.<anonymous> (/home/pankaja/Documents/Projects/React/showcase/weather-app/node_modules/chokidar/lib/nodefs-handler.js:455:19)
    at FSWatcher.<anonymous> (/home/pankaja/Documents/Projects/React/showcase/weather-app/node_modules/chokidar/lib/nodefs-handler.js:460:16)
    at FSReqWrap.oncomplete (fs.js:153:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `react-scripts start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pankaja/.npm/_logs/2018-03-01T10_11_31_527Z-debug.log

Environment is same as mentioned in the issue.
Is this a bug with latest npm or node ?

This was an issue with watchers. Fixed it by following this https://stackoverflow.com/questions/22475849/node-js-error-enospc/32600959#32600959

Thanks @pankaja92 . It works

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fson picture fson  ·  3Comments

fson picture fson  ·  3Comments

oltsa picture oltsa  ·  3Comments

alleroux picture alleroux  ·  3Comments

rdamian3 picture rdamian3  ·  3Comments