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

EMFILE error when using fs.watch on many items #1

Open
NetanelBasal opened this issue Feb 24, 2015 · 8 comments
Open

EMFILE error when using fs.watch on many items #1

NetanelBasal opened this issue Feb 24, 2015 · 8 comments

Comments

@NetanelBasal
Copy link

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
}));

@dai-shi
Copy link
Owner

dai-shi commented Feb 24, 2015

Please try increasing the file descriptor limit.

What is the result of the following?

ulimit -n

@NetanelBasal
Copy link
Author

4864

@dai-shi
Copy link
Owner

dai-shi commented Feb 24, 2015

Do you have more files than that number?

How about try something like this?

ulimit -n 65536

@NetanelBasal
Copy link
Author

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...

@dai-shi
Copy link
Owner

dai-shi commented Feb 24, 2015

Hmm, it sounds tough.

@dai-shi
Copy link
Owner

dai-shi commented Feb 24, 2015

Is this related?
nodejs/node-v0.x-archive#2479

@NetanelBasal
Copy link
Author

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.

@jonmann20
Copy link

https://stackoverflow.com/a/32600959/353166 worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants