Chris J. Lee

Dallas Drupal Developer

You are here

Grunt Error in Ubuntu: Running "watch" task Waiting...Warning: watch ENOSPC

Got this error after running grunt. The error would just go on and on and then it would eventually stop and would stop the process.

The Symptom

Running "watch" task
Waiting...Warning: watch ENOSPC

Running "watch" task
Waiting...Warning: watch ENOSPC

Running "watch" task
Waiting...Warning: watch ENOSPC

Running "watch" task
Waiting...Warning: watch ENOSPC

Running "watch" task
Waiting...Warning: watch ENOSPC

Running "watch" task
Waiting...Warning: watch ENOSPC

Running "watch" task
Waiting...Warning: watch ENOSPC

Running "watch" task
Waiting...Warning: watch ENOSPC

I found others were having this issue as well.


Solution

You can just run this command to increase the limit and it'll solve this particular solution:

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

If you are running dropbox it would also cause the file watch limit to increase dramatically. Closing dropbox would then solve this error as well.

Cause

There's a hard limit on how many files one can watch that is set by the kernal. The command changes the file number limit. It adds this to the sysctl.conf file as a parameter.

Sources

© 2017 Chris J. Lee