【问题标题】:grunt-contrib-connect error :middleware undefinedgrunt-contrib-connect 错误:中间件未定义
【发布时间】:2015-11-13 02:14:14
【问题描述】:

我正在为我的 AngularJS 应用程序使用 yeoman 的角度生成器。这个生成器包括 grunt 和 grunt-contrib-connect,它们非常有用……但是依赖关系已经过时,所以我决定更新它们。

这样做时,我遇到了 grunt-contrib-connect 错误,这是我使用 --verbose 选项的时候:

Running "connect:test" (connect) task
Verifying property connect.test exists in config...OK
File: [no files]
Options: protocol="http", port=9001, hostname="localhost", base=".", directory=null, 
keepalive=false, debug=false, livereload=35729, open=false, useAvailablePort=false, 
onCreateServer=null, middleware=undefined
Warning: undefined is not a function Use --force to continue.

Aborted due to warnings.

看来是中间件造成了这个问题,这里是:

middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect.static('test'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect.static(appConfig.app)
            ];
          }

任何帮助我解决这个问题的帮助都非常受欢迎:)

【问题讨论】:

  • 我也有同样的问题,至今没有解决。 FWIW,我不认为 middleware=undefined 是问题所在,因为我在 grunt connect 工作的项目中看到了同样的问题。

标签: gruntjs grunt-contrib-connect


【解决方案1】:

使用grunt-contrib-connect 0.10.1 版似乎为我解决了这个问题。 Issue 161 可能是相关的。

【讨论】:

    猜你喜欢
    • 2015-01-25
    • 1970-01-01
    • 2015-08-24
    • 1970-01-01
    • 1970-01-01
    • 2017-06-12
    • 1970-01-01
    • 2013-12-28
    • 1970-01-01
    相关资源
    最近更新 更多