2015-11-26 81 views
3

Grunt「Watch」不想繼續。Grunt「watch」警告:路徑必須是字符串。收到undefined

問題: 運行「監視」任務 正在等待... 警告:路徑必須是字符串。收到未定義

這裏是繁重的手錶Gruntfile.js:

watch: { 
    //Watch files for changes during "grunt serve" 
    main: { 
    options: { 
     livereload: true, 
     livereloadOnError: false, 
     spawn: false 
    }, 
    files: [createFolderGlobs(['*.js', '*.less','*.html','*.json']), '!src/bower_components/**/*.js', '!src/js/**/*.js', '!_SpecRunner.html','!.grunt'], 
    tasks: [] //all the tasks are run dynamically during the watch event handler 

    } 
}, 

回答

3

我想通了,而我寫的這個問題


當我添加標籤爲這個問題,我看到了標籤咕嚕-的contrib手錶並得到了:https://github.com/gruntjs/grunt-contrib-watch

和這樣做:

$ npm install grunt-contrib-watch --save-dev 

...現在它的工作原理。無論如何,我發佈了它,因爲我在Google搜索時無法找到關於此的信息。

+0

對於其他人,這不適合我。 '手錶'一直安裝。它可能很容易是別的東西。 –

7

我發現了這個問題。您需要升級grunt-contrib-jshint。

我不得不版 「咕嚕-的contrib-jshint」: 「〜0.9」

改爲 「咕嚕-的contrib-jshint」: 「^ 1.0.0」

錯誤現在已經沒有了!

+0

這不適合我。 –

+0

修復了我的問題。 – henrebotha

相關問題