简体   繁体   中英

Heroku deployment Error with node.js

The application is programmed in node.js and using socket.io for real-time requests.

the application was working fine, but today I'm getting this infinitely error:

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...

can anyone help please!

i'll appreciate it, Thanks.

the problem was the "request" package from npm, it's not compatible with the last version of node.js.

So I add the version explicitly in package.js

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

now everything works fine. Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM