当我在终端上运行grunt时,我得到了这个错误消息,有人能告诉我为什么吗?我得到一个错误消息:加载"Gruntfile.js"任务…error
SyntaxError: Unexpected identifier警告:未找到任务"default"。使用——force继续。
module.exports = function(grunt){
require('load-grunt-tasks')(grunt);
var config = grunt.file.readYAML('Gruntconfig.yml');
grunt.initConfig({
sass:{
dist:{
src: config.scssDir+'style.scss',
dest: config.cssDir+'style.css'
}
},
concat:{
dist:{
src: config.jsSrcDir+'*.js',
dest: config.jsConcatDir+'app.js'
}
},
jshint:{
options:{
"eqeqeq": true
}
all:[
'Gruntfile.js',
config.jsSrcDir+"*.js"
]
},
watch:{
sass:{
files: config.scssDir+'**/*.scss',
tasks:['sass']
}
}
});
grunt.registerTask('default',['jshint',
'sass','concat','watch']);};
这意味着它不能编译gruntfile中的json。
你缺少逗号
jshint:{
options:{
"eqeqeq": true
}<--- add comma here
all:[
'Gruntfile.js',
config.jsSrcDir+"*.js"
]
},