将React前端+ Node.js Express后端部署到Heroku

时间:2020-04-01 14:18:05

标签: reactjs heroku deployment

我一直在用React和Node.js(Express)编写我的全栈应用程序。 我已经将每个代码上传到了自己的git存储库-一个用于前端,另一个用于后端。 我想将这两个上传到Heroku。 我尝试仅上传前端代码,但出现此错误:

GET https://banana-tart-93887.herokuapp.com/favicon.ico 503 (Service Unavailable)

when I run heroku logs --tail it says:
2020-04-01T14:11:22.607320+00:00 app[web.1]: Could not find an open port at banana-tart-93887.herokuapp.com.
2020-04-01T14:11:22.607329+00:00 app[web.1]: Network error message: listen EADDRNOTAVAIL: address not available 52.21.209.244
2020-04-01T14:11:22.607330+00:00 app[web.1]:
2020-04-01T14:11:22.656808+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-04-01T14:11:22.657481+00:00 app[web.1]: npm ERR! errno 1
2020-04-01T14:11:22.659836+00:00 app[web.1]: npm ERR! my-app@0.1.0 start: `react-scripts start`
2020-04-01T14:11:22.660209+00:00 app[web.1]: npm ERR! Exit status 1
2020-04-01T14:11:22.660626+00:00 app[web.1]: npm ERR!
2020-04-01T14:11:22.660975+00:00 app[web.1]: npm ERR! Failed at the my-app@0.1.0 start script.
2020-04-01T14:11:22.661317+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-04-01T14:11:23.127039+00:00 heroku[web.1]: State changed from starting to crashed
2020-04-01T14:11:23.026944+00:00 app[web.1]:
2020-04-01T14:11:23.027467+00:00 app[web.1]: npm `enter code here`ERR! A complete log of this run can be found in:
2020-04-01T14:11:23.027786+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2020-04-01T14_11_22_662Z-debug.log

0 个答案:

没有答案