【发布时间】:2022-01-12 23:55:46
【问题描述】:
我一直在尝试部署我的网站。它可以在我的本地计算机上运行,但是当我将它部署到 Heroku 时它不起作用。
这是 Heroku 的日志:
2022-01-12T09:31:04.854187+00:00 heroku[web.1]: Process exited with status 1
2022-01-12T09:31:05.082730+00:00 heroku[web.1]: State changed from starting to crashed
2022-01-12T15:07:15.575516+00:00 heroku[web.1]: State changed from crashed to starting
2022-01-12T15:07:17.952102+00:00 heroku[web.1]: Starting process with command `npm start`
2022-01-12T15:07:19.220594+00:00 app[web.1]: npm ERR! missing script: start
2022-01-12T15:07:19.224923+00:00 app[web.1]:
2022-01-12T15:07:19.225102+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2022-01-12T15:07:19.225149+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2022-01-12T15_07_19_221Z-debug.log
2022-01-12T15:07:19.394790+00:00 heroku[web.1]: Process exited with status 1
2022-01-12T15:07:19.459851+00:00 heroku[web.1]: State changed from starting to crashed
【问题讨论】:
-
missing script: start- 做你定义了一个启动脚本吗?这就是 Heroku requires by default。给minimal reproducible example。 -
如果您愿意,您也可以在
Procfile中指定您的流程。 Heroku 优先使用它而不是启动脚本(如果存在)。