我在我的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)
];
}任何帮助我解决这个问题的帮助都是非常受欢迎的:)
发布于 2015-10-12 15:10:31
使用grunt-contrib-connect版本0.10.1似乎为我解决了这个问题。Issue 161可能是相关的。
https://stackoverflow.com/questions/32101264
复制相似问题