Gruntjs Grunt注册任务不起作用
我只使用jshint,并且像在官方文档中一样配置它。它可能也不缺少逗号。代码如下:Gruntjs Grunt注册任务不起作用,gruntjs,Gruntjs,我只使用jshint,并且像在官方文档中一样配置它。它可能也不缺少逗号。代码如下: module.export = function(grunt){ grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jshint: { files: { src: ['Gruntfile.js', 'app.js'] }, options: {
module.export = function(grunt){
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
files: {
src: ['Gruntfile.js', 'app.js']
},
options: {
reporter: require('jshint-stylish'),
globals: {
console: true,
module: true,
},
},
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint'],
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.registerTask('default', ["jshint"]);
};
module.export=函数(grunt){
grunt.initConfig({
pkg:grunt.file.readJSON('package.json'),
jshint:{
档案:{
src:['grunfile.js','app.js']
},
选项:{
记者:require('jshint-style'),
全球:{
安慰:是的,
模块:正确,
},
},
观察:{
文件:[''],
任务:['jshint'],
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
registerTask('default',[“jshint”]);
};
…您的第一行有一个输入错误
将第一行更改为:
module.exports = function(grunt){
注意
导出
上的“s”出现了什么错误?警告:找不到任务“jshint”。使用--force继续。由于警告而中止。和咕噜声警告:未找到任务“默认值”。使用--force继续。由于警告而中止。