Heroku应用程序崩溃

时间:2020-08-10 22:24:57

标签: heroku logging mern

我最近构建了一个MERN堆栈应用程序。因为这是我的第一个此类指南,所以我将本教程系列(https://www.youtube.com/playlist?list=PLillGF-RfqbbiTGgA77tGO426V3hRF9iE)用作通用指南,尤其是在服务器端。即使该应用程序的内容有所不同并且我实现了其他一些功能,但该应用程序的结构实际上是相同的。

现在,我想使应用程序与heroku一起运行(如视频中所示)。 但是,当我将代码推送到heroku时,该应用一直崩溃。我打开了日志,这就是我得到的错误:

    2020-08-11T03:07:10.314848+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:878:14)
2020-08-11T03:07:10.314849+00:00 app[web.1]: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
2020-08-11T03:07:10.314849+00:00 app[web.1]: at internal/main/run_main_module.js:17:47 {
2020-08-11T03:07:10.314849+00:00 app[web.1]: code: 'MODULE_NOT_FOUND',
2020-08-11T03:07:10.314850+00:00 app[web.1]: requireStack: [ '/app/server.js' ]
2020-08-11T03:07:10.314850+00:00 app[web.1]: }
2020-08-11T03:07:10.330704+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-08-11T03:07:10.330940+00:00 app[web.1]: npm ERR! errno 1
2020-08-11T03:07:10.333787+00:00 app[web.1]: npm ERR! steffi@1.0.0 start: `node server.js`
2020-08-11T03:07:10.333895+00:00 app[web.1]: npm ERR! Exit status 1
2020-08-11T03:07:10.334073+00:00 app[web.1]: npm ERR!
2020-08-11T03:07:10.334210+00:00 app[web.1]: npm ERR! Failed at the steffi@1.0.0 start script.
2020-08-11T03:07:10.334313+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-08-11T03:07:10.344122+00:00 app[web.1]:
2020-08-11T03:07:10.344322+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-08-11T03:07:10.344441+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2020-08-11T03_07_10_335Z-debug.log
2020-08-11T03:07:10.389095+00:00 heroku[web.1]: Process exited with status 1
2020-08-11T03:07:10.431342+00:00 heroku[web.1]: State changed from starting to crashed
2020-08-11T08:45:48.247619+00:00 heroku[web.1]: State changed from crashed to starting
2020-08-11T08:46:00.002801+00:00 heroku[web.1]: Starting process with command `npm start`
2020-08-11T08:46:02.120377+00:00 app[web.1]:
2020-08-11T08:46:02.120405+00:00 app[web.1]: > steffi@1.0.0 start /app
2020-08-11T08:46:02.120406+00:00 app[web.1]: > node server.js
2020-08-11T08:46:02.120406+00:00 app[web.1]: 
2020-08-11T08:46:02.686644+00:00 app[web.1]: internal/modules/cjs/loader.js:968
2020-08-11T08:46:02.686672+00:00 app[web.1]: throw err;
2020-08-11T08:46:02.686672+00:00 app[web.1]: ^
2020-08-11T08:46:02.686672+00:00 app[web.1]:
2020-08-11T08:46:02.686674+00:00 app[web.1]: Error: Cannot find module './routes/APIs/Report'
2020-08-11T08:46:02.686674+00:00 app[web.1]: Require stack:
2020-08-11T08:46:02.686675+00:00 app[web.1]: - /app/server.js
2020-08-11T08:46:02.686677+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
2020-08-11T08:46:02.686677+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:841:27)
2020-08-11T08:46:02.686677+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:1025:19)
2020-08-11T08:46:02.686677+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:72:18)
2020-08-11T08:46:02.686678+00:00 app[web.1]: at Object.<anonymous> (/app/server.js:8:16)
2020-08-11T08:46:02.686678+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1137:30)
2020-08-11T08:46:02.686678+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
2020-08-11T08:46:02.686678+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:985:32)
2020-08-11T08:46:02.686679+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:878:14)
2020-08-11T08:46:02.686680+00:00 app[web.1]: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
2020-08-11T08:46:02.686680+00:00 app[web.1]: at internal/main/run_main_module.js:17:47 {
2020-08-11T08:46:02.686680+00:00 app[web.1]: code: 'MODULE_NOT_FOUND',
2020-08-11T08:46:02.686681+00:00 app[web.1]: requireStack: [ '/app/server.js' ]
2020-08-11T08:46:02.686681+00:00 app[web.1]: }
2020-08-11T08:46:02.696283+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-08-11T08:46:02.696490+00:00 app[web.1]: npm ERR! errno 1
2020-08-11T08:46:02.698937+00:00 app[web.1]: npm ERR! steffi@1.0.0 start: `node server.js`
2020-08-11T08:46:02.699033+00:00 app[web.1]: npm ERR! Exit status 1
2020-08-11T08:46:02.699145+00:00 app[web.1]: npm ERR!
2020-08-11T08:46:02.699229+00:00 app[web.1]: npm ERR! Failed at the steffi@1.0.0 start script.
2020-08-11T08:46:02.699312+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-08-11T08:46:02.706889+00:00 app[web.1]:
2020-08-11T08:46:02.707038+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-08-11T08:46:02.707136+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2020-08-11T08_46_02_699Z-debug.log
2020-08-11T08:46:02.751097+00:00 heroku[web.1]: Process exited with status 1
2020-08-11T08:46:02.788818+00:00 heroku[web.1]: State changed from starting to crashed
2020-08-11T14:22:15.896541+00:00 heroku[web.1]: State changed from crashed to starting
2020-08-11T14:22:29.138852+00:00 heroku[web.1]: Starting process with command `npm start`
2020-08-11T14:22:33.759937+00:00 app[web.1]:
2020-08-11T14:22:33.759960+00:00 app[web.1]: > steffi@1.0.0 start /app
2020-08-11T14:22:33.759961+00:00 app[web.1]: > node server.js
2020-08-11T14:22:33.759961+00:00 app[web.1]:
2020-08-11T14:22:34.574404+00:00 app[web.1]: internal/modules/cjs/loader.js:968
2020-08-11T14:22:34.574426+00:00 app[web.1]: throw err;
2020-08-11T14:22:34.574427+00:00 app[web.1]: ^
2020-08-11T14:22:34.574427+00:00 app[web.1]:
2020-08-11T14:22:34.574428+00:00 app[web.1]: Error: Cannot find module './routes/APIs/Report'
2020-08-11T14:22:34.574428+00:00 app[web.1]: Require stack:
2020-08-11T14:22:34.574429+00:00 app[web.1]: - /app/server.js
2020-08-11T14:22:34.574429+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
2020-08-11T14:22:34.574430+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:841:27)
2020-08-11T14:22:34.574430+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:1025:19)
2020-08-11T14:22:34.574430+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:72:18)
2020-08-11T14:22:34.574431+00:00 app[web.1]: at Object.<anonymous> (/app/server.js:8:16)
2020-08-11T14:22:34.574431+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1137:30)
2020-08-11T14:22:34.574431+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
2020-08-11T14:22:34.574432+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:985:32)
2020-08-11T14:22:34.574432+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:878:14)
2020-08-11T14:22:34.574433+00:00 app[web.1]: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
2020-08-11T14:22:34.574433+00:00 app[web.1]: at internal/main/run_main_module.js:17:47 {
2020-08-11T14:22:34.574434+00:00 app[web.1]: code: 'MODULE_NOT_FOUND',
2020-08-11T14:22:34.574435+00:00 app[web.1]: requireStack: [ '/app/server.js' ]
2020-08-11T14:22:34.574435+00:00 app[web.1]: }
2020-08-11T14:22:34.597512+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-08-11T14:22:34.597879+00:00 app[web.1]: npm ERR! errno 1
2020-08-11T14:22:34.602909+00:00 app[web.1]: npm ERR! steffi@1.0.0 start: `node server.js`
2020-08-11T14:22:34.603105+00:00 app[web.1]: npm ERR! Exit status 1
2020-08-11T14:22:34.603488+00:00 app[web.1]: npm ERR!
2020-08-11T14:22:34.603763+00:00 app[web.1]: npm ERR! Failed at the steffi@1.0.0 start script.
2020-08-11T14:22:34.603974+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-08-11T14:22:34.625203+00:00 app[web.1]:
2020-08-11T14:22:34.626034+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-08-11T14:22:34.626253+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2020-08-11T14_22_34_613Z-debug.log
2020-08-11T14:22:34.714592+00:00 heroku[web.1]: Process exited with status 1
2020-08-11T14:22:34.756698+00:00 heroku[web.1]: State changed from starting to crashed
2020-08-11T18:46:15.852670+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=tagesberichte.herokuapp.com request_id=ba691bfe-def4-474f-9ac6-7ec994824c19 fwd="81.217.30.193" dyno= connect= service= status=503 bytes= protocol=https
2020-08-11T18:46:16.217361+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=tagesberichte.herokuapp.com request_id=0872c7dd-5396-4da7-a9c6-88fc22adb5bc fwd="81.217.30.193" dyno= connect= service= status=503 bytes= protocol=https
2020-08-11T18:49:13.569812+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=tagesberichte.herokuapp.com request_id=4b4a6c67-9e6c-4d9e-a99a-e5c4d194d99f fwd="81.217.30.193" dyno= connect= service= status=503 bytes= protocol=https
2020-08-11T18:50:53.665135+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=tagesberichte.herokuapp.com request_id=9489e7f5-cda1-490b-a4f9-2ab453ed519c fwd="81.217.30.193" dyno= connect= service= status=503 bytes= protocol=https
2020-08-11T19:02:59.282527+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=tagesberichte.herokuapp.com request_id=a9bbed3f-0a27-45ec-be9d-8312d9303604 fwd="81.217.30.193" dyno= connect= service= status=503 bytes= protocol=https

这是我第一次使用MERN堆栈和heroku,我必须承认我真的不知道错误日志的含义。似乎heroku找不到某些文件,我也不十分清楚为什么。作为参考,这是我推送到heroku的项目(减去mongoDB的API):https://github.com/lamorak13/tagesberichte

我为完成这项工作所能提供的每条建议而感到欣慰。非常感谢:)

0 个答案:

没有答案