2

当我运行时grunt watchwatch工作一次:在我编辑并保存了一个 Javascript 文件之后,Grunt 编译/缩小所有文件。但是当我再次编辑并保存同一个文件,Grunt 说ENOENT, no such file or directory '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)
4

1 回答 1

1

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

为了获得批准并关闭此问题,将评论转换为答案

于 2013-05-31T06:34:17.517 回答