When I run grunt jshint
in cmd, show me below error:
Loading "jshint.js" tasks...ERROR
Error: Cannot find module 'hooker
Warning: Task "jshint:myFiles" not found. Use --force to continue.
Aborted due to warnings.`
this is my code:
module.exports = function (grunt) {
grunt.initConfig({
// define source files and their destinations
uglify: {
min: {
files: grunt.file.expandMapping(['vendors/**/**/*.js','!vendors/**/**/*.min.js'], '', {
rename: function(destBase, destPath) {
return destBase+destPath.replace('.js', '.min.js');
}
})
}
},
watch: {
files:['vendors/**/**/*.min.js'],
tasks: ['default']
},
clean: ["vendors"],
bower: {
install: {
//just run 'grunt bower:install' and you'll see files from your Bower packages in lib directory
}
},
jshint: {
// You get to make the name
// The paths tell JSHint which files to validate
myFiles: ['gruntfile.js']
},
cssmin:{
target: {
files: grunt.file.expandMapping(['vendors/**/**/*.css','!vendors/**/**/*.min.css'], '', {
rename: function(destBase, destPath) {
return destBase+destPath.replace('.css', '.min.css','');
}
})
}
},
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-bower-installer');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-watch-github');
// register at least this one task
grunt.registerTask('default', [ 'jshint','uglify','cssmin' ]);
};
I Installed these plugins:
{ "name": "my-project-name", "version": "1.0.0", "devDependencies": { "grunt": "~0.4.2", "grunt-bower-installer": "^0.3.6", "grunt-contrib-clean": "^0.6.0", "grunt-contrib-compass": "^1.0.3", "grunt-contrib-cssmin": "^0.14.0", "grunt-contrib-imagemin": "^0.9.4", "grunt-contrib-jshint": "^0.11.3", "grunt-contrib-uglify": "~0.2.4", "grunt-contrib-watch": "~0.5.3", "grunt-watch-github": "^0.1.1", "jshint-stylish": "^2.0.1" } }