![](/img/trans.png)
[英]gulp-usemin TypeError: Path must be a string. Received undefined
[英]Grunt “watch” Warning: Path must be a string. Received undefined
Grunt“Watch”不想繼續。
問題:運行“監視”任務等待...警告:路徑必須是字符串。 收到undefined
這是Gruntfile.js中的grunt手表:
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
}
},
我發現了這個問題。 您需要升級grunt-contrib-jshint。
我有版本“grunt-contrib-jshint”:“~0.9”
改為“grunt-contrib-jshint”:“^ 1.0.0”
錯誤現在消失了!
我在寫這個問題時想通了 。
當我為這個問題添加標簽時,我看到了標簽grunt-contrib-watch並得到: https : //github.com/gruntjs/grunt-contrib-watch 。
並做到了這一點:
$ npm install grunt-contrib-watch --save-dev
......現在它有效。 無論如何我發布了它,因為當我用谷歌搜索時我找不到這個。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.