Heroku部署问题,状态代码为127和node.js



我正试图用node.js在Heroku上部署我的应用程序。应用程序在我的本地运行良好,但当我试图在Heroku上部署它时,会出现以下错误:

2022-03-13T00:12:16.474210+00:00 heroku[web.1]: Starting process with command `bin/boot`
2022-03-13T00:12:17.528943+00:00 app[web.1]: bash: bin/boot: No such file or directory
2022-03-13T00:12:17.679770+00:00 heroku[web.1]: Process exited with status 127
2022-03-13T00:12:17.738233+00:00 heroku[web.1]: State changed from starting to crashed
2022-03-13T00:13:07.280433+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sopra-fs22-gulec-egeonu-client.herokuapp.com request_id=73dc7825-de2b-4a24-bf3f-4d7bfe67ec60 fwd="213.55.224.62" dyno= connect= service= status=503 bytes= protocol=https
2022-03-13T00:13:07.460574+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sopra-fs22-gulec-egeonu-client.herokuapp.com request_id=d29010bf-9c0b-4e27-b902-9540d393f667 fwd="213.55.224.62" dyno= connect= service= status=503 bytes= protocol=https
2022-03-13T00:13:41.656858+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sopra-fs22-gulec-egeonu-client.herokuapp.com request_id=91ecbc00-ee15-4eed-bbfd-c3d3af522548 fwd="213.55.224.62" dyno= connect= service= status=503 bytes= protocol=https
2022-03-13T00:13:41.867824+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sopra-fs22-gulec-egeonu-client.herokuapp.com request_id=cfd378e9-ab85-46a3-b636-3e4fac1140ad fwd="213.55.224.62" dyno= connect= service= status=503 bytes= protocol=https

我的优点是:

web: bin/boot

和软件包.json

{
"name": "sopra-fs22-client-template",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.24.0",
"moment": "^2.29.1",
"node-gyp": "^8.4.1",
"node-sass": "^7.0.1",
"react": "^17.0.2",
"react-datetime-picker": "^3.5.0",
"react-dom": "^17.0.2",
"react-router-dom": "^5.3.0",
"react-scripts": "^5.0.0",
"styled-components": "^5.3.3"
},
"scripts": {
"dev": "react-scripts start",
"start": "serve -s build",
"build": "react-scripts build",
"eject": "react-scripts eject",
"test": "react-scripts test --env=jsdom",
"heroku-postbuild": "npm run build"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}

我也查看了其他帖子,也尝试了其他事情,但我不知道还能在哪里查看,非常感谢。

尝试将您的Procfile更改为此

web: npm run start

我已经删除了我的节点模块,并从package-lock.json中复制了依赖项,并将其粘贴到package.json 中

我发现nodemon不在依赖项部分,然后我添加了:";"开始":"nodemon index.js";,在脚本中,npm i,再次并部署它,它成功了!

最新更新