Развертывание веб-приложения MERN на Heroku - Ошибка приложения - PullRequest
0 голосов
/ 29 января 2020

Я попытался запустить веб-приложение MERN-стека и запустить его через Heroku.

Я перепробовал все возможные варианты поиска ошибок в Интернете.

Добавление Procfile, добавление стартового скрипта, определенных npm, пряжи и версий узлов в пакете. json ...

Ничего, что помогло мне, ошибки продолжают появляться.

В интерфейсе Heroku I получаю сообщение «ваше приложение успешно развернуто», но когда я пытаюсь посетить 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
...