2011-09-01 76 views
1
$ node server.js 

node.js:134 
     throw e; // process.nextTick error, or 'error' event on first tick 
     ^
TypeError: Object #<Object> has no method 'bodyDecoder' 
    at HTTPServer.<anonymous> (/home/jrg/Realtime-Demo/settings.js:20:18) 
    at HTTPServer.configure (/home/jrg/Realtime-Demo/node_modules/express/lib/http.js:543:61) 
    at Object.<anonymous> (/home/jrg/Realtime-Demo/settings.js:18:5) 
    at Module._compile (module.js:402:26) 
    at Object..js (module.js:408:10) 
    at Module.load (module.js:334:31) 
    at Function._load (module.js:293:12) 
    at require (module.js:346:19) 
    at Object.<anonymous> (/home/jrg/Realtime-Demo/server.js:9:13) 
    at Module._compile (module.js:402:26) 

當我嘗試運行Instagram node.js Realtime Demo項目。該服務器是Ubuntu 10.04(如果這有所作爲,我懷疑)。Crytip node.js錯誤

這不是Express framework giving a very strange error的重複 - 我嘗試了那裏的指示,他們沒有工作。

回答

1

connect and express has bodyParser middleware,but not bodyDecoder

它在1.0.0版本的connect中重命名。這是一個理由,爲什麼node.js項目必須有package.json描述符與依賴部分,其中組件版本可能是固定的。

您可以安裝0.5.10版本的連接或嘗試替換bodyDecoderbodyParser