javascript - Grunt "watch"警告 : Path must be a string. 收到未定义

标签 javascript gruntjs grunt-contrib-watch

Grunt“Watch”不想继续。

问题: 运行“监视”任务 等待... 警告:路径必须是字符串。收到未定义

这是 Gruntfile.js 中的 grunt watch:

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”

错误现在消失了!

关于javascript - Grunt "watch"警告 : Path must be a string. 收到未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33940278/

相关文章:

javascript - 调用 Backbone.Model.Save 将 child-Backbone.Model 转换为对象?

gruntjs - 如何从发布版本中删除 livereload 脚本?

node.js - Windows 8 上的咕噜声 : 'grunt' is not recognized

javascript - 如何有条件地编译(使用 Grunt)仅使用模板包含更改的 Jade 文件

javascript - Vue slot-scope 在孙子元素内不起作用

javascript - 完成 Google 表单后,如何在 Google 电子表格中现有工作表的末尾创建新行?

javascript - 拆分和添加数组

javascript - 如何缩小所有js文件?

coffeescript - 如何仅在需要时使用grunt-contrib-watch和grunt-contrib-coffee编译CoffeeScript?

gruntjs - 如何同时运行两个 grunt watch 任务