Gruntfile error with warning: Task "taskname" not found

This happens with any task that I am trying to run. When working with the --verbose flag, I get:

Initializing command line options: --verbose

Reading "Gruntfile.js" Gruntfile ... OK

Gruntfile task registration. Loading tasks "Gruntfile.js" ... OK

No tasks have been registered or unregistered.

This is the grunt file:

 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']); }; 

Any idea what I'm doing wrong?

options:

grunt-cli v0.1.9 grunt v0.4.1

+7
gruntjs
source share
2 answers

In your Grunt file module.export should be module.exports .

+18
source share

Check the path to the / node module when calling grunt.loadNpmTasks in Gruntfile.js

0
source share

All Articles