Node.js + socket.io在本地与foreman一起运行但在heroku上崩溃

时间:2014-07-26 22:38:57

标签: node.js heroku socket.io

在heroku上运行时出现以下错误:

4-07-26T22:24:01.691178 + 00:00 heroku [web.1]:状态从开始变为崩溃

2014-07-26T22:24:01.692242+00:00 heroku[web.1]: State changed from crashed to starting
2014-07-26T22:24:04.483585+00:00 app[web.1]: 
26)
...
2014-07-26T22:24:04.484066+00:00 app[web.1]:           ^
2014-07-26T22:24:04.485813+00:00 app[web.1]:     at Module.load (module.js:356:32)
2014-07-26T22:24:04.484057+00:00 app[web.1]:     throw err;
2014-07-26T22:24:04.485806+00:00 app[web.1]:     at require (module.js:380:17)
2014-07-26T22:24:04.483677+00:00 app[web.1]: module.js:340
2014-07-26T22:24:04.485808+00:00 app[web.1]:     at Object.<anonymous> (/app/node_modules/socket.io/node_modules/socket.io-parser/node_modules/emitter/index.js:6:13)

如果我使用,&#34; heroku labs:启用websockets&#34;,我得到&#34;没有这样的功能:websockets&#34;

1 个答案:

答案 0 :(得分:0)

问题

Heroku无法在你的../emitter/index.js中找到一个对象。 socket.io模块的一些文件夹是&#34; gitignored&#34;。 (为什么?)

看起来 websockets 不再是heroku:labs功能,默认情况下启用。我在没有启用实验室功能的情况下运行了socket.io聊天示例。

快速解决方案

git add -A --force |然后提交并部署

相关问题