easy-livereload
easy-livereload copied to clipboard
EMFILE error when using fs.watch on many items
I am using your module and i am getting error because i have too many files to watch.
app.use(require('easy-livereload')({ watchDirs: [ path.join(__dirname, 'public') ], checkFunc: function(file) { return /.(css|js|jade)$/.test(file); }, port: process.env.LIVERELOAD_PORT || 35729 }));
Please try increasing the file descriptor limit.
What is the result of the following?
ulimit -n
4864
Do you have more files than that number?
How about try something like this?
ulimit -n 65536
I does not have so many file and i am still get this error
throw errnoException(err, 'watch');
^
Error: watch ENFILE at exports._errnoException (util.js:732:11) at FSWatcher.start (fs.js:1155:11) at Object.fs.watch (fs.js:1181:11) at watch (/Users/netanelbasal/www/node/node_modules/easy-livereload/node_modules/node-watch/lib/watch.js:221:8) at /Users/netanelbasal/www/node/node_modules/easy-livereload/node_modules/node-watch/lib/watch.js:230:9 at /Users/netanelbasal/www/node/node_modules/easy-livereload/node_modules/node-watch/lib/watch.js:41:14 at Array.forEach (native) at /Users/netanelbasal/www/node/node_modules/easy-livereload/node_modules/node-watch/lib/watch.js:38:18 at FSReqWrap.oncomplete (fs.js:76:15) 24 Feb 11:15:04 - [nodemon] app crashed - waiting for file changes before starting...
Hmm, it sounds tough.
Is this related? https://github.com/joyent/node/issues/2479
Thats wired, my ulimit is 65536, i dont think this is related to this. I am sure more users will be come to this problem so if i find solution i will write this here.
https://stackoverflow.com/a/32600959/353166 worked for me