Gruntjs 运行grunt时未找到任务

Gruntjs 运行grunt时未找到任务,gruntjs,pug,Gruntjs,Pug,当我使用以下GrunFile运行grunt时,会收到错误警告:找不到任务“jade”。这里到底出了什么问题 module.exports = function(grunt) { grunt.initConfig({ jade: { compile: { options: { client: false, pretty: true },

当我使用以下GrunFile运行grunt时,会收到错误警告:找不到任务“jade”。这里到底出了什么问题

module.exports = function(grunt) {
    grunt.initConfig({

      jade: {
        compile: {
            options: {
                client: false,
                pretty: true
            },
            files: [ {
              cwd: "app/views",
              src: "**/*.jade",
              dest: "build/templates",
              expand: true,
              ext: ".html"
            } ]
        }
    }   
    });

   grunt.registerTask('default','Convert Jade templates into html templates',
                  ['jade','watch']);
  grunt.loadNpmTasks('grunt-contrib-watch');
};

您需要加载grunt jade任务。与您一样,您正在添加grunt contrib手表

grunt.loadNpmTasks('grunt-contrib-jade');
这应该行得通