2015-08-19 21 views
5

我爲我的AngularJS應用使用yeoman的角度發生器。這個生成器包括grunt和grunt-contrib-connect,這非常有用......但依賴關係已經過時了,所以我決定更新它們。grunt-contrib-connect錯誤:中間件undefined

在這樣做時,我有咕嚕-的contrib連一個錯誤,這是當我使用--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) 
      ]; 
      } 

任何援助,以幫助我搞清楚了這一點比歡迎:)

+0

我有同樣的問題,目前尚未解決。 FWIW,但我認爲'middleware = undefined'不是問題,因爲我在grunt connect工程中看到相同的問題。 – user1338062

回答

0

使用grunt-contrib-connect版本0.10.1似乎來解決這個問題對我來說更多。可能與Issue 161有關。