Heroku错误H14(没有web进程运行) [英] Heroku Error H14 (No web processes running)
问题描述
遵循所有说明来设置节点和npm。推向英雄时,没有错误。但是,当我打开应用程序,它显示应用程序错误
heroku ps
返回
过程状态命令
------- --------- ------------
main.1 up for 1m node main.js
同时
heroku日志
退货
错误H14(没有web进程正在运行) - > GET mewtwo.herokuapp.com/ dyno = queue = wait = service = status = 503 bytes =
I尝试用
低到后来回答)heroku restart
重新启动应用程序,但仍然得到相同的错误。除了heroku restart
之外,谷歌还没有其他解决方案。任何人试过其他方法?
确定终于搞清楚了。
显然在Procfile中,我声明
main:node main.js
但Heroku使用
web:node main.js
我认为命名可以是任何您想要的,但实际上它是严格的,您需要使用 web 工作(heroku并没有强调这一点 - 保持警惕)至少现在,直到我弄清楚为什么这个严格,如果我可以改变名称。
解决方案您的web进程的名称必须为
web
,是Heroku在初始部署时始终会扩展为'1'的过程。
Procfile中的其他服务可以称为您想要的,但您需要首先对其进行缩放(所以你可以在那里只有开发流程,如果你想)。
更多信息在这里: http://neilmiddleton.com/the-procfile-is-your-friend/
(缓存版本: https://web.archive。 org / web / 20130926005616 / http://www.neilmiddleton.com/the-procfile-is-your-friend )Pretty sure some people encountered this problem before.
Followed all the instructions to setup node and npm. When pushing to heroku there were no errors. But when I open the app, it shows "Application Error"
heroku ps
returns
Process State Command ------- --------- ------------ main.1 up for 1m node main.js
while
heroku logs
returns
Error H14 (No web processes running) -> GET mewtwo.herokuapp.com/ dyno= queue= wait= service= status=503 bytes=
I tried restarting the app with
heroku restart
but still get the same error. Google around and there were no other solution other thanheroku restart
. Anyone tried other methods ?
Answer: (I put it here since my rep is too low to post answer yet)
Ok finally figured it out myself.
Apparently in the Procfile, I declared
main: node main.js
but Heroku uses
web: node main.js
I thought the naming can be anything you want but it is actually strict, you need to use web for it to work (heroku did not emphasize this - be wary) at least for now, until I figure out why this strictness and if I can change the name.
解决方案The name of your web process must be
web
, and this is the process that Heroku will always scale to '1' on initial deploy.Other services in the Procfile can be called what you want, but you need to scale them initially (so you can have dev only processes in there if you want).
More information here: http://neilmiddleton.com/the-procfile-is-your-friend/ (the cached version: https://web.archive.org/web/20130926005616/http://www.neilmiddleton.com/the-procfile-is-your-friend)
这篇关于Heroku错误H14(没有web进程运行)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!