【发布时间】:2015-12-08 23:34:59
【问题描述】:
我有以下 gruntfile
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
htmlhint: {
build: {
options: {
'tag-pair': true,
'tagname-lowercase': true,
'attr-lowercase': true,
'attr-value-double-quotes': true,
'doctype-first': true,
'spec-char-escape': true,
'id-unique': true,
'head-script-disabled': true,
'style-disabled': true
},
src: ['index.html']
}
},
watch: {
html: {
files: ['index.html'],
tasks: ['htmlhint']
}
}
});
require("matchdep").filterDev("grunt-").forEach(grunt.loadNpmTasks);
grunt.registerTask('default', ['watch']);
};
当我尝试在 cmd 中运行 grunt 时,它给了我这个错误
警告:未找到“默认”任务。使用 --force 继续。
由于警告而中止。
我该如何解决这个问题
【问题讨论】:
标签: node.js gruntjs npm workflow