我试图通过Heroku启动并运行MERN堆栈网络应用。
我尝试了所有可以在线查找的关于我得到的错误的选项。
添加Procfile,在package.json中添加启动脚本,定义的npm,yarn和节点版本...
没有什么能帮助我继续出现错误。
在Heroku界面中,我收到消息“您的应用程序已成功部署”,但是当我尝试访问url时,它始终显示“应用程序错误”。
我将我的错误日志放在下面,我对其进行了过滤,但是它仍然很大,因为我不想删除潜在的重要消息...
有人可以看看它,并给我一些关于我做错了什么的解释吗?
到GitHub存储库的链接是-> https://github.com/Brundeco/gdmGentRebrand2019
谢谢!
npm ERR! nmd-mern-template@1.0.0 start: `node index.js`
npm ERR! Exit status 1
npm ERR! Failed at the nmd-mern-template@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Starting process with command `npm start`
State changed from starting to crashed
Process exited with status 1
> nmd-mern-template@1.0.0 start /app
> node index.js
internal/modules/cjs/loader.js:670
throw err;
^
Error: Cannot find module '/app/index.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:668:15)
at Function.Module._load (internal/modules/cjs/loader.js:591:27)
at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)
at internal/main/run_main_module.js:21:11
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nmd-mern-template@1.0.0 start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nmd-mern-template@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /app/.npm/_logs/2020-01-29T12_23_23_875Z-debug.log
2020-01-29T12:23:24.985796+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=gdmprojectmernstack.herokuapp.com request_id=70ea8153-51a5-40b7-ac67-662c88350888 fwd="78.22.204.232" dyno= connect= service= status=503 bytes= protocol=https
2020-01-29T12:23:26.847866+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=gdmprojectmernstack.herokuapp.com request_id=82f0da56-606c-43aa-978f-1526a23a04df fwd="78.22.204.232" dyno= connect= service= status=503 bytes= protocol=https
2020-01-29T12:29:57.000000+00:00 app[api]: Build started by user ...
2020-01-29T12:30:58.514973+00:00 app[api]: Deploy ff8e7ef3 by user ...
2020-01-29T12:30:59.835434+00:00 heroku[web.1]: State changed from crashed to starting
Release v14 created by user ...
Build succeeded
Starting process with command `npm start`
State changed from starting to crashed
Process exited with status 1
> nmd-mern-template@1.0.0 start /app
> node ./src/server/index.js
/app/src/server/index.js:5
import config from './config';
^^^^^^
SyntaxError: Unexpected identifier
at Module._compile (internal/modules/cjs/loader.js:760:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)
at internal/main/run_main_module.js:21:11
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nmd-mern-template@1.0.0 start: `node ./src/server/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nmd-mern-template@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /app/.npm/_logs/2020-01-29T12_31_07_487Z-debug.log
State changed from crashed to starting
Starting process with command `npm start`
State changed from starting to crashed
Process exited with status 1
> nmd-mern-template@1.0.0 start /app
> node ./src/server/index.js
/app/src/server/index.js:5
import config from './config';
^^^^^^
SyntaxError: Unexpected identifier
at Module._compile (internal/modules/cjs/loader.js:760:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)
at internal/main/run_main_module.js:21:11
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nmd-mern-template@1.0.0 start: `node ./src/server/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nmd-mern-template@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /app/.npm/_logs/2020-01-29T12_34_53_901Z-debug.log