2013-01-21 49 views
2

當我運行grunt watch時,watch只能工作一次:Grunt在編輯並保存Javascript文件後編譯/縮小所有文件。但是,當我再次編輯並保存相同的文件,咕嚕說:ENOENT, no such file or directory 'client/debiki/debiki-action-edit.js'爲什麼`grunt watch`失敗,出現「ENOENT,沒有這樣的文件或目錄」,儘管文件存在

(中提到的文件是我剛修改過的文件。)但是文件確實存在:

$ 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 watch工作?

詳情:

Ubuntu Linux操作系統,咕嚕v0.3.17,Node.js的v0.8.4。我使用內置的watch任務,而不是grunt-contrib-watch

完整的步兵錯誤消息

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) 
+0

這可能是值得安裝最新的0.4.0發佈候選,並使用咕嚕-的contrib手錶(以及任何其他更新的任務)。許多修補程序和功能已添加到兼容0.4.0的任務中,內部0.3.x任務已全部移出,並作爲grunt-contrib- *的一部分提供支持。 – jsoverson

+0

@jsoverson升級到Grunt 0.4.x似乎解決了這個問題 - 現在'grunt watch'不會死。 – KajMagnus

+1

@jsoverson如果您想將您的評論轉換爲答案,我會接受並關閉此問題。 (否則我會在一週後自己添加一個答案,並接受並關閉) – KajMagnus

回答

1

這可能是值得安裝最新的0.4.0發佈候選,並使用咕嚕-的contrib手錶(以及任何其他更新的任務)。許多修補程序和功能已添加到兼容0.4.0的任務中,並且內部0.3.x任務已全部移出並作爲grunt-contrib的一部分支持*

將註釋轉換爲答案以便被批准,並關閉了這個問題

相關問題