簡體   English   中英

Node.js的Heroku部署錯誤

[英]Heroku deployment Error with node.js

該應用程序在node.js中編程,並使用socket.io進行實時請求。

該應用程序運行正常,但是今天我遇到了這個無限錯誤:

2015-10-08T08:31:37.477080+00:00 app[web.1]: Prevented node from exit...
2015-10-08T08:31:37.477495+00:00 app[web.1]: TypeError: Cannot read property 'length' of undefined
2015-10-08T08:31:37.477496+00:00 app[web.1]:     at onwriteDrain (_stream_writable.js:354:12)
2015-10-08T08:31:37.477497+00:00 app[web.1]:     at afterWrite (_stream_writable.js:344:5)
2015-10-08T08:31:37.477498+00:00 app[web.1]:     at wrapped (/app/node_modules/newrelic/lib/transaction/tracer/index.js:157:28)
2015-10-08T08:31:37.477498+00:00 app[web.1]:     at doNTCallback0 (node.js:408:9)
2015-10-08T08:31:37.477499+00:00 app[web.1]:     at Immediate._tickCallback [as _onImmediate] (node.js:337:13)
2015-10-08T08:31:37.477500+00:00 app[web.1]:     at processImmediate [as _immediateCallback] (timers.js:374:17)
2015-10-08T08:31:37.477873+00:00 app[web.1]: TypeError: Cannot read property 'length' of undefined
2015-10-08T08:31:37.477503+00:00 app[web.1]: Prevented node from exit...
2015-10-08T08:31:37.477875+00:00 app[web.1]:     at onwriteDrain (_stream_writable.js:354:12)
2015-10-08T08:31:37.477875+00:00 app[web.1]:     at afterWrite (_stream_writable.js:344:5)
2015-10-08T08:31:37.477876+00:00 app[web.1]:     at wrapped (/app/node_modules/newrelic/lib/transaction/tracer/index.js:157:28)
2015-10-08T08:31:37.477877+00:00 app[web.1]:     at Immediate._tickCallback [as _onImmediate] (node.js:337:13)
2015-10-08T08:31:37.477877+00:00 app[web.1]:     at doNTCallback0 (node.js:408:9)
2015-10-08T08:31:37.477878+00:00 app[web.1]:     at processImmediate [as _immediateCallback] (timers.js:374:17)
2015-10-08T08:31:37.477900+00:00 app[web.1]: Prevented node from exit...

誰能幫忙!

我會感激的,謝謝。

問題是來自npm的“請求”包,它與最新版本的node.js不兼容。

所以我在package.js中顯式添加了版本

"engines": {
  "node": "0.10.x"
},

現在一切正常。 謝謝

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM