I'm using grunt-vows (https://github.com/CMTegner/grunt-vows) in the following gruntfile:

module.exports = function(grunt) {  
  // Project configuration.  
  grunt.loadNpmTasks("grunt-vows");  
  grunt.initConfig({  
    vows: {  
      all: {  
        options: {  
          reporter: "spec",  
          verbose: true,  
          silent: false,  
          colors: true,  
          isolate: false,  
          coverage: "json"  
        },  
        src: ["test/*.js"]  
      }  
    }  
  });  
  // Default task.  
  grunt.registerTask('default', 'vows');  
};  

and getting the following error when I run grunt:
TypeError: Object #<Object> has no method 'options'
at Object.<anonymous> (/home/dan/playlist/node_modules/grunt-vows/tasks/vows.js:32:33)
at Object.<anonymous> (/usr/lib/node_modules/grunt/lib/grunt/task.js:109:15)
at Object.thisTask.fn (/usr/lib/node_modules/grunt/lib/grunt/task.js:58:16)

I'm confident that I've made a simple mistake somewhere, does anything look out of place in the gruntfile?

Thanks in advance,
Dan

有帮助吗?

解决方案

this are some compatibilty issues with your local installed grunt and this module!

if you have grunt 0.3.x installed (what i think is your problem) you could use an older version of this plugin (should be grunt-vows@0.3.1 or older).

probably the best thing you can do is upgrade your local installed grunt to 0.4.0 (see the migration guide here: http://gruntjs.com/upgrading-from-0.3-to-0.4), because you will run into this issue a lot if you want to include new grunt-plugins.

of course this will add some additional work in already existing gruntfiles

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top