gpt4 book ai didi

node.js - React 应用程序在本地运行,在 Heroku 错误代码=H10 上崩溃

转载 作者:搜寻专家 更新时间:2023-10-31 23:58:55 27 4
gpt4 key购买 nike

应用程序在 Windows 中运行“npm start”后运行良好,但当我从 github 拉入 Heroku 时,我只是收到一个错误。

package.json:

{
"name": "tic-tac-toe",
"version": "0.1.0",

"dependencies": {
"react": "^15.5.4",
"react-dom": "^15.5.4"
},
"engines": {
"node": "6.10.3",
"npm":"3.10.10"
},
"devDependencies": {
"react-scripts": "1.0.7"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}

和错误日志:

 app[web.1]: npm ERR!     npm bugs tic-tac-toe
app[web.1]: npm ERR! Or if that isn't available, you can get their info via:
app[web.1]: npm ERR! npm owner ls tic-tac-toe
app[web.1]: npm ERR! There is likely additional logging output above.
app[web.1]:
app[web.1]: npm ERR! Please include the following file with any support request:
app[web.1]: npm ERR! /app/npm-debug.log
heroku[web.1]: Process exited with status 1
heroku[web.1]: State changed from starting to crashed
heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=react-tac-to.herokuapp.com request_id=c3cf2461-1989-4734-a7d5-157eb81c9643 fwd="24.29.73.46" dyno= connect= service= status=503 bytes= protocol=https
heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=react-tac-to.herokuapp.com request_id=05109629-cbb4-4927-9d13-8a3a37fedb93 fwd="24.29.73.46" dyno= connect= service= status=503 bytes= protocol=https

问题的本质让我认为这是基于配置的,而不是在主要的 app.js 代码中。主文件有点长,所以如果你想看的话,我会在Github上链接到它: https://github.com/owenpercoco/React-Tac-Toe

最佳答案

我遇到了同样的问题,但上面的解决方案不适用于我在 Heroku 中的 React 应用程序。我已将构建包更新为 create-react-app,它对我有用。

heroku buildpacks:set mars/create-react-app

关于node.js - React 应用程序在本地运行,在 Heroku 错误代码=H10 上崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44319832/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com