【问题标题】:While running grunt watch - it throws warning while running express server task and aborts运行 grunt watch - 它在运行快速服务器任务并中止时抛出警告
【发布时间】:2014-10-13 12:04:45
【问题描述】:

在运行 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.

【问题讨论】:

    标签: node.js express gruntjs grunt-contrib-watch


    【解决方案1】:

    我遇到了类似的问题,解决方案是将 grunt-contrib-connect 降级到版本 0.10.1

    所以编辑你的 package.json:

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

    然后运行

    npm update
    

    在您的项目目录中。

    我认为他们在 v11 中更改了中间件函数参数。我使用来自 AngularJS 生成器 v0.12.1 的 Gruntfile.js

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-06-04
      • 2013-05-25
      • 1970-01-01
      • 1970-01-01
      • 2014-10-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多