【发布时间】:2018-07-29 11:20:39
【问题描述】:
我尝试将 node js 应用程序部署到 heroku。但总是出现应用程序错误..
这是我的网络日志
2018-02-19T09:00:51.759639+00:00 heroku[web.1]:状态从 崩溃到开始 2018-02-19T09:00:54.029447+00:00 heroku[web.1]: 使用命令
node index.js启动进程 2018-02-19T09:00:55.992998+00:00 app[web.1]:服务器在端口上启动 3000 2018-02-19T09:01:54.487612+00:00 heroku[web.1]:错误 R10(启动 timeout) -> Web 进程未能在 60 秒内绑定到 $PORT 启动 2018-02-19T09:01:54.487612+00:00 heroku[web.1]:停止 使用 SIGKILL 2018-02-19T09:01:54.622011+00:00 heroku[web.1] 处理: 状态从开始变为崩溃 2018-02-19T09:01:54.608384+00:00 heroku[web.1]:进程退出 状态 137
在我的终端中它警告说没有找到 env 文件
这是更新的日志..
2018-02-20T22:33:28.164758+00:00 app[web.1]: 在 Module._compile (module.js:570:32) 2018-02-20T22:33:28.164760+00:00 应用 [web.1]: 在 Object.Module._extensions..js (module.js:579:10) 2018-02-20T22:33:28.164761+00:00 应用 [web.1]:在 Module.load (module.js:487:32) 2018-02-20T22:33:28.164763+00:00 应用 [web.1]: 在 tryModuleLoad (module.js:446:12) 2018-02-20T22:33:28.164765+00:00 app[web.1]:在 Function.Module._load (module.js:438:3) 2018-02-20T22:33:28.164766+00:00 应用 [web.1]:在 Module.runMain (module.js:604:10) 2018-02-20T22:33:28.164768+00:00 应用 [web.1]: 在 运行 (bootstrap_node.js:389:7) 2018-02-20T22:33:28.164769+00:00 app[web.1]:启动时(bootstrap_node.js:149:9) 2018-02-20T22:33:28.164771+00:00 应用 [web.1]: 在 bootstrap_node.js:504:3 2018-02-20T22:33:41.623294+00:00 heroku[路由器]: at=error code=H10 desc="App crashed" 方法=GET path="/" 主机=realtime-tracker.herokuapp.com request_id=f5ccc5ea-8044-454e-95d5-9175b93a4be3 fwd="110.54.168.160" dyno=连接=服务=状态=503字节=协议=https 2018-02-20T22:33:42.405421+00:00 heroku[路由器]: at=error code=H10 desc="应用程序崩溃" 方法=GET path="/favicon.ico" 主机=实时跟踪器.herokuapp.com request_id=9a88d409-6292-4361-b6ca-057e8b8fd5ad fwd="110.54.168.160" dyno=连接=服务=状态=503字节=协议=https断开连接 从日志流。可能会发生您看不到的事件 这里!正在尝试重新连接... 2018-02-20T22:33:28.164758+00:00 app[web.1]:在 Module._compile (module.js:570:32) 2018-02-20T22:33:28.164760+00:00 应用程序 [web.1]:在 Object.Module._extensions..js (module.js:579:10) 2018-02-20T22:33:28.164761+00:00 应用 [web.1]:在 Module.load (module.js:487:32) 2018-02-20T22:33:28.164763+00:00 应用 [web.1]: 在 tryModuleLoad (module.js:446:12) 2018-02-20T22:33:28.164765+00:00 app[web.1]:在 Function.Module._load (module.js:438:3) 2018-02-20T22:33:28.164766+00:00 应用 [web.1]:在 Module.runMain (module.js:604:10) 2018-02-20T22:33:28.164768+00:00 应用 [web.1]: 在 运行 (bootstrap_node.js:389:7) 2018-02-20T22:33:28.164769+00:00 app[web.1]:启动时(bootstrap_node.js:149:9) 2018-02-20T22:33:28.164771+00:00 应用 [web.1]: 在 bootstrap_node.js:504:3 2018-02-20T22:33:41.623294+00:00 heroku[路由器]: at=error code=H10 desc="App crashed" 方法=GET path="/" 主机=realtime-tracker.herokuapp.com request_id=f5ccc5ea-8044-454e-95d5-9175b93a4be3 fwd="110.54.168.160" dyno=连接=服务=状态=503字节=协议=https 2018-02-20T22:33:42.405421+00:00 heroku[路由器]: at=error code=H10 desc="应用程序崩溃" 方法=GET path="/favicon.ico" 主机=实时跟踪器.herokuapp.com request_id=9a88d409-6292-4361-b6ca-057e8b8fd5ad fwd="110.54.168.160" dyno=连接=服务=状态=503字节=协议=https断开连接 从日志流。可能会发生您看不到的事件 这里!正在尝试重新连接... 2018-02-20T22:33:28.164758+00:00 app[web.1]:在 Module._compile (module.js:570:32) 2018-02-20T22:33:28.164760+00:00 应用程序 [web.1]:在 Object.Module._extensions..js (module.js:579:10) 2018-02-20T22:33:28.164761+00:00 应用 [web.1]:在 Module.load (module.js:487:32) 2018-02-20T22:33:28.164763+00:00 应用 [web.1]: 在 tryModuleLoad (module.js:446:12) 2018-02-20T22:33:28.164765+00:00 app[web.1]:在 Function.Module._load (module.js:438:3) 2018-02-20T22:33:28.164766+00:00 应用 [web.1]:在 Module.runMain (module.js:604:10) 2018-02-20T22:33:28.164768+00:00 应用 [web.1]: 在 运行 (bootstrap_node.js:389:7) 2018-02-20T22:33:28.164769+00:00 app[web.1]:启动时(bootstrap_node.js:149:9) 2018-02-20T22:33:28.164771+00:00 应用 [web.1]: 在 bootstrap_node.js:504:3 2018-02-20T22:33:41.623294+00:00 heroku[路由器]: at=error code=H10 desc="App crashed" 方法=GET path="/" 主机=realtime-tracker.herokuapp.com request_id=f5ccc5ea-8044-454e-95d5-9175b93a4be3 fwd="110.54.168.160" dyno=连接=服务=状态=503字节=协议=https 2018-02-20T22:33:42.405421+00:00 heroku[路由器]: at=error code=H10 desc="应用程序崩溃" 方法=GET path="/favicon.ico" 主机=实时跟踪器.herokuapp.com request_id=9a88d409-6292-4361-b6ca-057e8b8fd5ad fwd="110.54.168.160" dyno=连接=服务=状态=503字节=协议=https
【问题讨论】: