我在下面的grunt文件中使用了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');
}; 当我运行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中有没有看起来不合适的地方?
提前谢谢你,
丹
发布于 2013-03-27 18:55:16
这是一些与您本地安装的grunt和此模块的兼容性问题!
如果你已经安装了Grun0.3.x(我认为这是你的问题),你可以使用这个插件的旧版本(应该是grunt-vows@0.3.1或更早)。
也许你能做的最好的事情就是将你本地安装的grunt升级到0.4.0 (参见这里的迁移指南:http://gruntjs.com/upgrading-from-0.3-to-0.4),因为如果你想包含新的grunt-plugins,你会经常遇到这个问题。
当然,这会在已经存在的gruntfiles中添加一些额外的工作
https://stackoverflow.com/questions/15606311
复制相似问题