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

Can't start new app due to watch error #2549

Closed
aurimus opened this issue Jun 16, 2017 · 14 comments
Closed

Can't start new app due to watch error #2549

aurimus opened this issue Jun 16, 2017 · 14 comments

Comments

@aurimus
Copy link

aurimus commented Jun 16, 2017

When I run npm start or yarn start on newly created app I get following error:

    Starting the development server...

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

    Error: watch /home/aurimas/Apps/projects/iwillbe.pro/front/public ENOSPC
        at exports._errnoException (util.js:1022:11)
        at FSWatcher.start (fs.js:1306:19)
        at Object.fs.watch (fs.js:1331:11)
        at createFsWatchInstance (/home/aurimas/Apps/projects/iwillbe.pro/front/node_modules/chokidar/lib/nodefs-handler.js:37:15)
        at setFsWatchListener (/home/aurimas/Apps/projects/iwillbe.pro/front/node_modules/chokidar/lib/nodefs-handler.js:80:15)
        at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/aurimas/Apps/projects/iwillbe.pro/front/node_modules/chokidar/lib/nodefs-handler.js:228:14)
        at FSWatcher.NodeFsHandler._handleDir (/home/aurimas/Apps/projects/iwillbe.pro/front/node_modules/chokidar/lib/nodefs-handler.js:407:19)
        at FSWatcher.<anonymous> (/home/aurimas/Apps/projects/iwillbe.pro/front/node_modules/chokidar/lib/nodefs-handler.js:455:19)
        at FSWatcher.<anonymous> (/home/aurimas/Apps/projects/iwillbe.pro/front/node_modules/chokidar/lib/nodefs-handler.js:460:16)
        at FSReqWrap.oncomplete (fs.js:112:15)

    npm ERR! Linux 4.10.0-22-generic
    npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
    npm ERR! node v7.4.0
    npm ERR! npm  v4.0.5
    npm ERR! code ELIFECYCLE
    npm ERR! front@0.1.0 start: `react-scripts start`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the front@0.1.0 start script 'react-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 front package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR!     react-scripts start
    npm ERR! You can get information on how to open an issue for this project with:
    npm ERR!     npm bugs front
    npm ERR! Or if that isn't available, you can get their info via:
    npm ERR!     npm owner ls front
    npm ERR! There is likely additional logging output above.

    npm ERR! Please include the following file with any support request:
    npm ERR!     /home/aurimas/Apps/projects/iwillbe.pro/front/npm-debug.log

Npm debug reads:

	0 info it worked if it ends with ok
	1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
	2 info using npm@4.0.5
	3 info using node@v7.4.0
	4 verbose run-script [ 'prestart', 'start', 'poststart' ]
	5 info lifecycle front@0.1.0~prestart: front@0.1.0
	6 silly lifecycle front@0.1.0~prestart: no script for prestart, continuing
	7 info lifecycle front@0.1.0~start: front@0.1.0
	8 verbose lifecycle front@0.1.0~start: unsafe-perm in lifecycle true
	9 verbose lifecycle front@0.1.0~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/aurimas/Apps/projects/iwillbe.pro/front/node_modules/.bin:/usr/local/heroku/bin:/home/aurimas/.rbenv/plugins/ruby-build/bin:/home/aurimas/.rbenv/shims:/home/aurimas/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/aurimas/Android/Sdk/tools:/home/aurimas/Android/Sdk/platform-tools
	10 verbose lifecycle front@0.1.0~start: CWD: /home/aurimas/Apps/projects/iwillbe.pro/front
	11 silly lifecycle front@0.1.0~start: Args: [ '-c', 'react-scripts start' ]
	12 silly lifecycle front@0.1.0~start: Returned: code: 1  signal: null
	13 info lifecycle front@0.1.0~start: Failed to exec start script
	14 verbose stack Error: front@0.1.0 start: `react-scripts start`
	14 verbose stack Exit status 1
	14 verbose stack     at EventEmitter.<anonymous> (/usr/local/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:191:7)
	14 verbose stack     at ChildProcess.<anonymous> (/usr/local/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:191:7)
	14 verbose stack     at maybeClose (internal/child_process.js:885:16)
	14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
	15 verbose pkgid front@0.1.0
	16 verbose cwd /home/aurimas/Apps/projects/iwillbe.pro/front
	17 error Linux 4.10.0-22-generic
	18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
	19 error node v7.4.0
	20 error npm  v4.0.5
	21 error code ELIFECYCLE
	22 error front@0.1.0 start: `react-scripts start`
	22 error Exit status 1
	23 error Failed at the front@0.1.0 start script 'react-scripts start'.
	23 error Make sure you have the latest version of node.js and npm installed.
	23 error If you do, this is most likely a problem with the front package,
	23 error not with npm itself.
	23 error Tell the author that this fails on your system:
	23 error     react-scripts start
	23 error You can get information on how to open an issue for this project with:
	23 error     npm bugs front
	23 error Or if that isn't available, you can get their info via:
	23 error     npm owner ls front
	23 error There is likely additional logging output above.
	24 verbose exit [ 1, true ]

Environment

Ubuntu 17.04
react-scripts@1.0.7
node v7.4.0
npm 4.0.5

@heyimalex
Copy link
Contributor

Try the solution in this stackoverflow answer? More explanation here.

@Timer
Copy link
Contributor

Timer commented Jun 16, 2017

You might have better luck installing watchman, brew install watchman.

@aurimus
Copy link
Author

aurimus commented Jun 16, 2017

@Timer tried installing watchman with npm, didn't help (my os is Ubuntu, not MacOS)

@heyimalex it worked! thanks .. the second link was enough. The issue probably should stand, but I will close it as it is resolved for me personally..

@aurimus aurimus closed this as completed Jun 16, 2017
@gor181
Copy link

gor181 commented Jul 17, 2017

Yah had the same problem here on Ubuntu 16.04.
Increasing the limit of inotify watchers solved it for me too.

Thanks @heyimalex.

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

@imranariffin
Copy link

The solution by @heyimalex worked for me.

react-scripts 1.0.10
node 6.11.0
npm 4.6.1
ubuntu 16.04

@dennisja
Copy link

dennisja commented Jan 8, 2018

@heyimalex thanks the solution has worked for me too
react-scripts 1.0.17
node v8.2.0
npm 5.3.0
ubuntu 16.10

@mritzco
Copy link

mritzco commented Jan 11, 2018

Solution works, thanks.

Yet, as the actual project files are but a few why would the system need to increase the number of watches.
Is it possible to check what files are being watched to verify that node_modules, git files or other non project specific files are not watched?

@gaearon
Copy link
Contributor

gaearon commented Jan 11, 2018

I think node_modules are intentionally watched because otherwise installing dependencies wouldn't trigger a rebuild.

@ThisIsMissEm
Copy link

@gaearon I just encountered this error on a project, and I'm thinking it'd be great if CRA caught the ENOSPC error and linked to the "how to fix this" instructions, because just the stack trace is a bit poor on DX — I would do a patch, but I don't have familiarity with the CRA codebase

@theSekyi
Copy link

This worked for me on linux.
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

@GrayedFox
Copy link

I second @mritzco -- we should ideally be able to blacklist certain directories from being watched. I would much rather just stop watching and rebuild after updating/changing dependencies than needlessly watch every single thing in my node_modules folder since I so rarely change dependencies while developing unless I'm on a specific "update dependencies" branch 😕

@jnanendraveer
Copy link

Thank you- @heyimalex worked for me.
Ubuntu 17.04
react-scripts@1.0.7
node v7.4.0
npm 4.0.5

@HuuDuc
Copy link

HuuDuc commented Aug 30, 2018

Work for me as well, OS Ubuntu

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

@ghost
Copy link

ghost commented Nov 20, 2018

Thanks alot. It worked for me also

@lock lock bot locked and limited conversation to collaborators Jan 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests