为什么我在Heroku nodejs托管中遇到此错误?

时间:2020-09-07 20:55:42

标签: node.js heroku hosting

heroku托管idk时遇到问题,我该怎么办。 (端口可能正确:const PORT = process.env.PORT ||)

2020-09-07T20:45:20.640779+00:00 heroku[web.1]: State changed from crashed to starting
2020-09-07T20:45:20.304911+00:00 app[api]: Deploy d8237452 by user maurerkrisztian@gmail.com
2020-09-07T20:45:20.304911+00:00 app[api]: Release v7 created by user maurerkrisztian@gmail.com
2020-09-07T20:45:20.000000+00:00 app[api]: Build succeeded
2020-09-07T20:45:25.983410+00:00 heroku[web.1]: Starting process with command `npm start`
2020-09-07T20:45:28.650802+00:00 app[web.1]:
2020-09-07T20:45:28.650814+00:00 app[web.1]: > simple-rest-api@1.0.0 start /app
2020-09-07T20:45:28.650814+00:00 app[web.1]: > ts-node-dev app.ts
2020-09-07T20:45:28.650814+00:00 app[web.1]:
2020-09-07T20:45:29.326452+00:00 app[web.1]: ts-node-dev ver. 1.0.0-pre.58 (using ts-node ver. 8.10.2, typescript ver. 3.9.7)
2020-09-07T20:45:39.103732+00:00 app[web.1]: [ERROR] 20:45:39 Error: Cannot parse config file: '/app/config/production.json': SyntaxError: Unexpected end of JSON input
2020-09-07T20:46:26.541466+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-09-07T20:46:26.561313+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-09-07T20:46:26.665093+00:00 heroku[web.1]: Process exited with status 137
2020-09-07T20:46:26.718342+00:00 heroku[web.1]: State changed from starting to crashed
2020-09-07T20:46:28.765964+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/api/echo" host=anime-stream-api.herokuapp.com request_id=d2794c21-f597-44e0-86f8-d6df00c2fac1 fwd="84.236.68.164" dyno= connect= service= status=503 bytes= protocol=https
2020-09-07T20:46:30.035002+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=anime-stream-api.herokuapp.com request_id=2a36961c-812a-412c-acb3-13b01d962394 fwd="84.236.68.164" dyno= connect= service= status=503 bytes= protocol=https
2020-09-07T20:46:34.664255+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/api/echo" host=anime-stream-api.herokuapp.com request_id=1b02724a-887e-4881-8fde-2e025fc6ed1c fwd="84.236.68.164" dyno= connect= service= status=503 bytes= protocol=https

1 个答案:

答案 0 :(得分:0)

production.json 可能有错误,请检查其是否为有效的JSON代码