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

make watch wierd error #290

Closed
j-mcnally opened this issue Sep 17, 2012 · 4 comments
Closed

make watch wierd error #290

j-mcnally opened this issue Sep 17, 2012 · 4 comments

Comments

@j-mcnally
Copy link
Contributor

running make watch

yields strange error instead of watching

justin-dev:tower justin$ make watch
grunt start --config ./grunt.coffee
Running "coffee:all" (coffee) task

Running "copy:packageJSON" (copy) task
Copied 142 files.

Running "build:client" (build) task

Running "copy:clientForTests" (copy) task
Copied 1 files.

Running "coffee:tests" (coffee) task

Running "watch" task
Waiting...
Error: watch EMFILE
    at errnoException (fs.js:806:11)
    at FSWatcher.start (fs.js:837:11)
    at Object.fs.watch (fs.js:861:11)
    at watchFile (/usr/local/lib/node_modules/grunt/tasks/watch.js:118:37)
    at Array.forEach (native)
    at Object.module.exports (/usr/local/lib/node_modules/grunt/tasks/watch.js:153:16)
    at Object.task.registerTask.thisTask.fn (/usr/local/lib/node_modules/grunt/lib/grunt/task.js:58:16)
    at Task.<anonymous> (/usr/local/lib/node_modules/grunt/lib/util/task.js:341:36)
    at Task.<anonymous> (/usr/local/lib/node_modules/grunt/lib/util/task.js:317:9)
    at Task.<anonymous> (/usr/local/lib/node_modules/grunt/lib/util/task.js:344:11)
make: *** [watch] Error 1
@lancejpollard
Copy link
Member

Ah yeah, this is because there is a default maximum number of files you can watch (or have open?) at once on the mac. We're working on a fix to this in grunt's watch task itself, but for now you can increase the default max like this:

ulimit -n 65536

You have to type that into the current terminal window you're using, I'm not sure how to make this the global default. But that's what I'm using and it works fine.

nodejs/node-v0.x-archive#2479

@lancejpollard
Copy link
Member

[10:57am] justin_: I'm on osx
[10:57am] justin_: ulimit returns unlimited
[10:57am] justin_: justin-dev:tower justin$ ulimit -n 65536
[10:57am] justin_: -bash: ulimit: open files: cannot modify limit: Invalid argument
[10:58am] viatropos: this is osx 10.8?
[10:58am] justin_: yes
[10:58am] justin_: 10.8.1
[10:59am] viatropos: maybe it's different on that? I'm still on 10.6.8 :0
[11:00am] viatropos: not sure, maybe `ulimit -m`? https://discussions.apple.com/thread/4267111?start=0&tstart=0
[11:02am] justin_: u are correct
[11:02am] justin_: ulimit -n is 256
[11:02am] justin_: but how to change it
[11:03am] viatropos: can you just enter it in the terminal window?
[11:03am] viatropos: maybe with sudo?
[11:03am] justin_: o ok
[11:03am] justin_: no its fine
[11:03am] justin_: ur number was too big
[11:03am] viatropos: oh ok
[11:03am] justin_: from what i know of binary
[11:03am] justin_: 65535
[11:03am] justin_: is probably the largest value
[11:03am] viatropos: oh ok
[11:03am] justin_: o maybe not
[11:03am] justin_: still too big
[11:04am] viatropos: what if you did 16384
[11:04am] justin_: 1000 seems to be max
[11:04am] viatropos: hmm
[11:04am] viatropos: maybe it's the new OS treating it differently? I used 65535
[11:06am] justin_: hmm
[11:06am] justin_: ok ill dig around
[11:06am] viatropos: k
[11:06am] justin_: 1000 is plenty so far
[11:07am] justin_: that did fix it
[11:07am] viatropos: k cool

@denisos
Copy link

denisos commented Sep 24, 2012

ulimit -n 1000 worked for me too..thanks!

@sebv
Copy link

sebv commented Nov 2, 2012

To set to 65536 do the following in ML:

sudo sysctl -w kern.maxfiles=65536
sudo ulimit -n 65536

It is reset with each reboot.

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

4 participants