【发布时间】:2020-05-21 23:21:53
【问题描述】:
我正在尝试在 Heroku 上部署 React 应用程序。我在日志文件中看到它的构建很好。在浏览器上运行它时,它会说,“正在启动开发服务器......”。但是突然就报错了。
进程以状态 0 退出。
和
状态从开始变为崩溃。
我在谷歌上搜索了很多,找到了很多解决这个特定错误的方法,但没有一个对我有用。
这是我的 package.json 文件:
"engines": {
"node": "10.16.3",
"npm": "6.1.0",
"yarn": "1.22.4"
},
脚本:
"scripts": {
"start": "react-scripts start",
"dev": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
我使用的是纱线而不是 npm。
这是我在部署后单击查看按钮时所说的内容:
2020-05-21T23:10:18.672143+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=testmystorespeed.herokuapp.com request_id=83e14391-8f4a-442b-8ee6-6904d095e258 fwd="39.42.33.31" dyno= connect= service= status=503 bytes= protocol=https
和
2020-05-21T23:10:20.773731+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=testmystorespeed.herokuapp.com request_id=e8a2be81-7d60-44f4-9746-f2e2f3789e79 fwd="39.42.33.31" dyno= connect= service= status=503 bytes= protocol=https
注意也许有人说这是一个重复的问题,但我已经尝试了我在 StackOverflow 和其他论坛中找到的几乎所有内容。
【问题讨论】:
标签: node.js reactjs npm yarnpkg