简体   繁体   English

使用grunt-vows时grunt.js引发错误

[英]grunt.js throws error when using grunt-vows

I'm using grunt-vows ( https://github.com/CMTegner/grunt-vows ) in the following gruntfile: 我在以下gruntfile中使用grunt-vows( https://github.com/CMTegner/grunt-vows ):

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 : 并在运行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? 我确信自己在某个地方犯了一个简单的错误,gruntfile中是否有任何异常?

Thanks in advance, 提前致谢,
Dan

this are some compatibilty issues with your local installed grunt and this module! 这是您本地安装的咕unt声和此模块的一些兼容性问题!

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). 如果您安装了grunt 0.3.x(我认为是您的问题),则可以使用此插件的旧版本(应为grunt-vows@0.3.1或更旧版本)。

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. 可能最好的办法是将本地安装的grunt升级到0.4.0(请参阅此处的迁移指南: http : //gruntjs.com/upgrading-from-0.3-to-0.4 ),因为您会遇到此问题如果您想包括新的grunt插件,那么很多。

of course this will add some additional work in already existing gruntfiles 当然,这将在已经存在的gruntfiles中添加一些其他工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM