Heroku错误H14(没有web进程运行)
很确定有些人之前遇到过这个问题。
遵循所有的说明来设置节点和NPM。 当推到heroku没有错误。 但是当我打开应用程序,它显示“应用程序错误”
heroku ps
回报
Process State Command ------- --------- ------------ main.1 up for 1m node main.js
而
heroku logs
回报
Error H14 (No web processes running) -> GET mewtwo.herokuapp.com/ dyno= queue= wait= service= status=503 bytes=
我试着用heroku restart
启动应用程序,但仍然得到相同的错误。 谷歌周围,没有其他的解决scheme,而不是heroku restart
。 任何人试过其他方法?
答:(我把它放在这里,因为我的代表太低,无法发布答案)
好吧,终于自己想出来了。
显然在Procfile中,我宣称
main: node main.js
但是Heroku使用
web: node main.js
我认为命名可以是任何你想要的,但实际上它是严格的,至less现在,你需要使用networking来工作(heroku并没有强调这一点 – 保持警惕),直到我明白为什么这个严格,如果我可以改名字
您的Web进程的名称必须是web
,这是Heroku在初始部署时始终会扩展为“1”的过程。
Procfile中的其他服务可以被称为你想要的,但是你需要最初扩展它们(所以如果你愿意的话,你可以只有开发过程)。
更多信息在这里: http : //neilmiddleton.com/the-procfile-is-your-friend/ (caching版本: https : //web.archive.org/web/20130926005616/http : //www.neilmiddleton.com / the-procfile-is-your-friend )
我有同样的问题,但对我来说,这是因为我需要运行heroku ps:scale web=1