在运行grunt watch的时候,它会在运行express服务器任务时抛出警告并中止

在运行grunt watch的时候,它会在运行express服务器任务时抛出警告并中止。

警告如下:

Running "express-server:devServer" (express-server) task Warning: Object function createServer() { function app(req, res, next){ app.handle(req, res, next); } merge(app, proto); merge(app, EventEmitter.prototype); app.route = '/'; app.stack = []; return app; } has no method 'static' Use --force to continue. Aborted due to warnings. 

我有类似的问题,解决scheme是降低grunt-contrib连接到版本0.10.1

所以编辑你的package.json:

 "grunt-contrib-connect": "0.10.1", 

然后运行

 npm update 

在你的项目目录中。

我认为他们在v11中改变了中间件function参数。 我使用AngularJS generator v0.12.1中的Gruntfile.js