1

This is my first attempt at learning react, and it's started terribly. I've gone through the instructions directed here: https://facebook.github.io/react/docs/installation.html on the "Create a New App" tab exactly. Haven't done anything differently.

I'm using node 8.1.3, and npm 5.0.4

(I've also tried downgrading node to 6.11 without success).

I don't get any errors at all during installation.

When I run npm start, I get this super unhelpful error:

Starting the development server...

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

Error: watch /var/phil-machine/Code/react/test1/public ENOSPC
at exports._errnoException (util.js:1022:11)
at FSWatcher.start (fs.js:1384:19)
at Object.fs.watch (fs.js:1410:11)
at createFsWatchInstance (/var/phil-machine/Code/react/test1/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/var/phil-machine/Code/react/test1/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/var/phil-machine/Code/react/test1/node_modules/chokidar/lib/nodefs-handler.js:228:14)
at FSWatcher.NodeFsHandler._handleDir (/var/phil-machine/Code/react/test1/node_modules/chokidar/lib/nodefs-handler.js:407:19)
at FSWatcher.<anonymous> (/var/phil-machine/Code/react/test1/node_modules/chokidar/lib/nodefs-handler.js:455:19)
at FSWatcher.<anonymous> (/var/phil-machine/Code/react/test1/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! test1@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the test1@0.1.0 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/phil/.npm/_logs/2017-07-05T23_52_25_652Z-debug.log

I'm at a loss. I've googled it (as best as I can - I'm not even sure what to google apart from the generic "react start error"), and got this answer https://stackoverflow.com/a/39960890/1569591 but that didn't help either.

When I run npm start it brings up the above error, and opens the bowser with a "Site cant be reached" error.

Can anyone help point me in the direction of how to fix this?

I've also tried changing the start command to use a different port:

PORT=3001 react-scripts start

Didn't work either.

Phil Cross
  • 9,017
  • 12
  • 50
  • 84

3 Answers3

1

Looks like an issue with node, ENOSPC means that there is no space on the drive.

Perhaps /tmp is full? You can configure npm to use a different temp folder by setting npm config set tmp /path/to/some/other/dir, or maybe delete everything out of the /tmp folder.

Source: ENOSPC in npm's repo in github.

  • /tmp is only 2.7MB big :( – Phil Cross Jul 06 '17 at 00:18
  • 1
    I had the same ununderstandable error and this answser put me on track and problem has been solved with 3 command lines: `sudo apt-get autoremove`, `sudo rm -rf /tmp/*` and then `sudo reboot`. Now everything works for me! – mrroboaat Oct 16 '17 at 12:50
0

I'm not entirely sure if this was the issue, but I've got it working.

It turns out another service, Grafana was using localhost port 3000. I removed Grafana and it still failed. After rebooting it appeared to work.

Again, I'm not sure if this will solve it 100% if others have the same problem, but this is what solved it for me.

Phil Cross
  • 9,017
  • 12
  • 50
  • 84
0

I don't know which Operating System you are using but if you are using Fedora or CentOS try disabling selinux. I had similar issue, but after disabling selinux it started working perfectly.

Indrajeet Latthe
  • 374
  • 1
  • 8
  • 22