无论我尝试运行什么任务,都会发生这种情况。
当使用 --verbose
运行时我得到的标志:
Initializing Command-line options: --verbose
Reading "Gruntfile.js" Gruntfile...OK
Registering Gruntfile tasks. Loading "Gruntfile.js" tasks...OK
block 引用> block 引用>No tasks were registered or unregistered.
这是 Gruntfile:
module.export = function (grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), karma_coveralls: { options: { coverage_dir: 'coverage' } }, jshint: { files: ['app/js/**/*.js', 'Gruntfile.js'], options: grunt.file.readJSON('.jshintrc') }, concat: { options: { seperator: ';' }, dist: { src: ['app/js/**/*.js'], dest: 'dist/app/js/<%pkg.name%>.js' } }, exec: { instrument: { cmd: function () { return 'istanbul instrument app/js -o app/instrumentjs'; } } } }); grunt.loadNpmTasks('grunt-karma-coveralls'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.registerTask('coverage', ['coveralls']); grunt.registerTask('default', ['jshint']); grunt.registerTask('instrument', ['exec: instrument']); grunt.registerTask('concat', ['concat']); };
知道我做错了什么吗?
咕噜版本:
grunt-cli v0.1.9 咕噜 v0.4.1
最佳答案
在您的 Gruntfile 中,module.export
应该是 module.exports
。
关于gruntjs - Gruntfile 失败并出现警告 : Task "taskname" not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19630822/