2013-03-25 61 views
0

我使用咕嚕-誓言(https://github.com/CMTegner/grunt-vows)在以下gruntfile時拋出錯誤:grunt.js使用咕嚕,誓言

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

,並得到以下錯誤,當我運行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)

我相信,我做了一個某處出現簡單的錯誤,在gruntfile中看起來不合適?

由於提前,

回答

1

這與當地的安裝呻吟,這個模塊的一些問題了兼容性!如果你安裝了grunt 0.3.x(我認爲是你的問題),你可以使用這個插件的舊版本(應該是[email protected]或更早的版本)。

你可以做的最好的事情是將本地安裝的grunt升級到0.4.0(請參閱遷移指南:http://gruntjs.com/upgrading-from-0.3-to-0.4),因爲如果你想包含新的grunt插件,你會遇到很多問題。

當然,這將在現有的gruntfiles添加一些額外的工作

+0

完全問題:)謝謝 – danwoods 2013-03-28 14:06:03