When I run grunt watch, watch works once: Grunt compiles/minifies all files, after I've edited and saved a Javascript file. But when I edit and save that same file again, Grunt says ENOENT, no such file or directory 'client/debiki/debiki-action-edit.js'.
(The file mentioned is the file I just modified.) However the file does exist:
$ ll client/debiki/debiki-action-edit.js
-rw-rw-r-- 1 kajmagnus kajmagnus 22497 Jan 21 23:47 client/debiki/debiki-action-edit.js
And if I run grunt directly from the command line (without watch) Grunt is always able to compile everything without any error.
What's happening? How can I make grunt watch work?
Details:
Ubuntu Linux, Grunt v0.3.17, Node.js v0.8.4. I use the built-in watch task, not grunt-contrib-watch.
The complete Grunt error message
Running "watch" task
Waiting...
/usr/local/lib/node_modules/grunt/lib/grunt/file.js:75
throw grunt.task.taskError(e.message, e);
^
TaskError: ENOENT, no such file or directory 'client/debiki/debiki-action-edit.js'
at Task.taskError (/usr/local/lib/node_modules/grunt/lib/util/task.js:59:17)
at /usr/local/lib/node_modules/grunt/lib/grunt/file.js:75:24
at Array.filter (native)
at Object.expandByType (/usr/local/lib/node_modules/grunt/lib/grunt/file.js:69:40)
at Timer.<anonymous> (/usr/local/lib/node_modules/grunt/tasks/watch.js:158:44)
at Timer.exports.setInterval.timer.ontimeout (timers.js:234:14)
It may be worth installing the latest 0.4.0 release candidate and using grunt-contrib-watch (as well as any other updated tasks). Many fixes and features have been added to 0.4.0-compatible tasks and internal 0.3.x tasks have all been moved out and are supported as part of grunt-contrib-*
Converted comment to an answer for the sake of being approved and closing this question