【发布时间】: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