Not sure what's prompted this, since the same operation was working fine a few days ago. I've rebooted to no effect, so presumably it's not ye olde too-many-open-files problem.
$ nodemon --debug --dump server.js
[nodemon] 1.8.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
--------------
node: v0.10.26
nodemon: 1.8.1
command: node /Users/rcoupe/.nvm/v0.10.26/bin/nodemon --debug --dump server.js
cwd: /Users/rcoupe/Code/overlay-management-system
OS: darwin x64
--------------
{ run: false,
system: { cwd: '/Users/rcoupe/Code/overlay-management-system' },
required: false,
dirs: [ '/Users/rcoupe/Code/overlay-management-system' ],
timeout: 1000,
options:
{ dump: true,
ignore:
[ '.git',
'node_modules',
'bower_components',
'.sass-cache',
re: /\.git|node_modules|bower_components|\.sass\-cache/ ],
watch: [ '*.*', re: /.*\..*/ ],
ignoreRoot: [ '.git', 'node_modules', 'bower_components', '.sass-cache' ],
restartable: 'rs',
colours: true,
execMap: { py: 'python', rb: 'ruby' },
stdin: true,
runOnChangeOnly: false,
verbose: false,
stdout: true,
execOptions:
{ script: 'server.js',
exec: 'node',
args: [ '--debug' ],
scriptPosition: 1,
nodeArgs: undefined,
ext: 'js,json',
env: {},
execArgs: [] },
monitor:
[ '*.*',
'!/Users/rcoupe/Code/overlay-management-system/.git/**/*',
'!/Users/rcoupe/Code/overlay-management-system/node_modules/**/*',
'!bower_components',
'!.sass-cache' ] },
load: [Function],
reset: [Function: reset],
lastStarted: 0,
loaded: [],
watchInterval: null,
command:
{ raw: { executable: 'node', args: [ '--debug', 'server.js' ] },
string: 'node --debug server.js' } }
--------------
+1
I had this same problem and I fixed it by updating my version of NPM and Node.
I am having this problem seemingly out of no where..... I restarted my machine but still not working.
**edit upgrading to latest npm resolved my issue
Updating NPM hasn't fixed it for me. Nodemon works fine on other projects ..
$ npm install -g npm
npm http GET https://registry.npmjs.org/npm
npm http 200 https://registry.npmjs.org/npm
npm http GET https://registry.npmjs.org/npm/-/npm-3.5.0.tgz
npm http 200 https://registry.npmjs.org/npm/-/npm-3.5.0.tgz
~/.nvm/v0.10.26/bin/npm -> ~/.nvm/v0.10.26/lib/node_modules/npm/bin/npm-cli.js
[email protected] ~/.nvm/v0.10.26/lib/node_modules/npm
$ nodemon server.js
[nodemon] 1.8.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node server.js`
[nodemon] Internal watch failed: watch EMFILE
$ npm -v
3.5.0
I was having this problem as well. No idea if this will help anyone else or not but I went into my /usr/local/bin directory and removed nodemon with rm -rf. I had tried npm uninstall nodemon but that was returning me a message saying npm WARN uninstall not installed in... which makes me wonder whether the first install went wrong somehow or whether I'd previously installed it incorrectly and there was some kind of conflict?
Long story short, I removed the old nodemon and ran npm install -g nodemon again and that seems to have cleared the whole matter up.
I'm getting a similar issue. Using Node 5.1.0 & NPM 3.3.12.
root@014b87ca92f1:/var/www/html# nodemon app.js
[nodemon] 1.8.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
...
info: Server lifted in `/var/www/html`
info: To see your app, visit http://localhost:1337
info: To shut down Sails, press <CTRL> + C at any time.
debug: --------------------------------------------------------
debug: :: Mon Dec 07 2015 16:54:53 GMT+0000 (UTC)
debug: Environment : development
debug: Port : 1337
debug: --------------------------------------------------------
[nodemon] Internal watch failed: watch /var/www/html/node_modules/sails/node_modules/skipper/node_modules/multiparty/.travis.yml ENOSPC
It's not always the same file. It's a random different file every time but after about 10 seconds I always get the _[nodedemon] Internal watch failed_ message and nodemon crashes?
I'm running this in a Docker container. Node, NPM, Nodemon are all installed globally.
I've tried upgrading NPM to 3.5.1 and that did not fix the issue. Still crashes after ~10 seconds?
Try to use --watch "./directory". For me it worked
My related issue above (re: ENOSPC) was resolved by following this. Something apparently inherent in unix file systems and the number of files allowed to be watched at a time?
I run nodemon through screen and when this happened to me I fixed it by killing the screen session and starting a new one.
just run this to changed max_user_watchs--------->echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
I'm seeing this issue consistently on the new Windows Subsystem for Linux.
This does not appear to be a problem with supervisor, btw.
@djensen47 actually the error (at least for me) on Windows Ubuntu shell is EPERM and not EMFILE which is discussed here.
Did anyone find a fix for the EPERM issue that occurs in the Windows 10 Bash?
@Carpetfizz, I just had the same issue w/ Windows 10 Bash. nodemon 1.10.0, node 6.4.0.
The error happens even if I am just watching one file (ex: nodemon -w app.js)
@Carpetfizz For me it was the current path was not including the script I was running:
$ cd /
$ nodemon /tmp/myproject/bin/myproject.js
FIxed it with a cd to the folder containing the main script
Note: I use Ubuntu.
killall -9 node resolve this problem
Thanks for the replies! I now use macOS, but I'll check out your solutions if I ever have to use W10Bash again.
you can use ps -ef | grep node to find the process id
and then sudo kill -9
This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up.
Thank you for contributing <3
Run this command
echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
i got error
sysctl: illegal option -- p
usage: sysctl [-bdehiNnoqx] name[=value] ...
sysctl [-bdehNnoqx] -a
I solved it on my mac by deleting the node_modules and re-installing nodemon again through it _not use it globally_; worked normally after that.
Even i had the same error:
[nodemon] Internal watch failed: EMFILE: too many open files, watch
I fixed it by just uninstalling and reinstalling nodemon:
npm uninstall -g nodemon;
npm install -g nodemon
Hope this works for you guys as well 馃憤
You can try --ignore node_modules
Most helpful comment
Try to use --watch "./directory". For me it worked