Loading "gruntfile.js" tasks...ERROR
>> ReferenceError: grunt is not defined
Warning: Task "default" not found. Use --force to continue.
Aborted due to warnings.
启动时这个错误
Loading "gruntfile.js" tasks...ERROR
>> ReferenceError: grunt is not defined
Warning: Task "default" not found. Use --force to continue.
Aborted due to warnings.
启动时这个错误
2014-09-29
怀疑是你在调用 grunt 的时候, grunt.loadNpmTasks 和 grunt.registerTask 不在 module 的 function 内。
比如:
module.exports = function(grunt) {
grunt.initConfig({
compass: {
dist: {
options: {
config: 'config/config.rb'
}
}
}
})
// 应该这里调用
grunt.loadNpmTasks('grunt-contrib-compass')
grunt.registerTask('default', 'compass')
}举报