Node.js 为什么“grunt watch”会因“grunt watch”而失败;eNONT,无此类文件或目录“;尽管文件存在

Node.js 为什么“grunt watch”会因“grunt watch”而失败;eNONT,无此类文件或目录“;尽管文件存在,node.js,build,gruntjs,Node.js,Build,Gruntjs,当我运行grunt-watch时,watch只工作一次:在编辑并保存Javascript文件后,grunt编译/缩小所有文件。但当我再次编辑并保存同一个文件时,Grunt说,enoint,没有这样的文件或目录“client/debiki/debiki action edit.js” (提到的文件是我刚刚修改过的文件。)但是该文件确实存在: $ ll client/debiki/debiki-action-edit.js -rw-rw-r-- 1 kajmagnus kajmagnus 22497

当我运行
grunt-watch
时,
watch
只工作一次:在编辑并保存Javascript文件后,grunt编译/缩小所有文件。但当我再次编辑并保存同一个文件时,Grunt说,
enoint,没有这样的文件或目录“client/debiki/debiki action edit.js”

(提到的文件是我刚刚修改过的文件。)但是该文件确实存在:

$ ll client/debiki/debiki-action-edit.js
-rw-rw-r-- 1 kajmagnus kajmagnus 22497 Jan 21 23:47 client/debiki/debiki-action-edit.js

如果我直接从命令行运行
grunt
(没有
watch
),grunt总是能够编译所有内容而不会出现任何错误

发生了什么事?如何使
grunt watch
工作

详细信息:

Ubuntu Linux,Grunt v0.3.17,Node.js v0.8.4。我使用内置的
watch
任务,而不是
grunt contrib watch

完整的Grunt错误消息

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)
运行“监视”任务
等待。。。
/usr/local/lib/node_modules/grunt/lib/grunt/file.js:75
抛出grunt.task.taskError(e.message,e);
^
TaskError:enoint,没有这样的文件或目录“client/debiki/debiki action edit.js”
在Task.taskError(/usr/local/lib/node_modules/grunt/lib/util/Task.js:59:17)
在/usr/local/lib/node_modules/grunt/lib/grunt/file.js:75:24
at Array.filter(本机)
在Object.expandByType(/usr/local/lib/node_modules/grunt/lib/grunt/file.js:69:40)
准时。(/usr/local/lib/node_modules/grunt/tasks/watch.js:158:44)
at Timer.exports.setInterval.Timer.ontimeout(timers.js:234:14)

安装最新的0.4.0候选版本并使用grunt contrib watch(以及任何其他更新的任务)可能是值得的。许多修复程序和功能已添加到0.4.0兼容的任务中,内部0.3.x任务已全部移出,并作为grunt contrib的一部分受到支持-*


为了获得批准和结束此问题,将评论转换为答案

可能值得安装最新的0.4.0候选版本并使用grunt contrib watch(以及任何其他更新的任务)。许多修复和功能已添加到0.4.0兼容的任务中,内部0.3.x任务已全部移出,并作为grunt contrib-*的一部分得到支持。@jsoverson升级到grunt 0.4.x似乎解决了这个问题-现在
grunt watch
不会消亡。@jsoverson如果您想将您的评论转换为答案,我接受它,结束这个问题。(否则,我会在一周后自己添加一个答案,然后接受并关闭)