gruntjs – Grunt警告:任务“默认”未找到

我正在尝试Grunt,我得到一个警告:当我尝试运行Grunt时,任务“默认”找不到错误.我的Gruntfile.js是

module.exports = function(grunt) {

grunt.initConfig({
concat: {
  js: {
    options: {
      separator: ';'
    },
    src: [
      'library/js/*.js'
    ],
    dest: 'library/js/scripts.min.js'
  },
},

uglify: {
  options: {
    mangle: false
  },
  js: {
    files: {
      'library/js/scripts.min.js': ['library/js/scripts.min.js']
    }
  }
},

less: {
  style: {
    files: {
      "library/css/style.css": "library/less/style.less"
    },
  }
},

watch: {
  js: {
    files: ['library/js/*.js'],
    tasks: ['concat:js', 'uglify:js'],
    options: {
        livereload: 35729
    }
  },
  css: {
    files: ['library/less/*.less'],
    tasks: ['less:style'],
    options {
        livereload: 35729
    }
  },
  php : {
    files : ['**/*.php'],
    options : {
      livereload : 35729
      } 
  }
}
  });



grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.registerTask('default', ['watch']);
};

这是工作,直到我添加了Livereload部分,我认为这可能是一个语法错误.不过这是我第一次使用这个,我根本不知道是什么原因造成的.任何帮助将不胜感激.

你缺少一个用于watch.css.options的冒号.更新到:

css: {
    files: ['library/less/*.less'],
    tasks: ['less:style'],
    options: {
        livereload: 35729
    }
}
翻译自:https://stackoverflow.com/questions/22974122/grunt-warning-task-default-not-found

转载注明原文:gruntjs – Grunt警告:任务“默认”未找到