Method Not Allowed heroku deploy - javascript

Hello I am deploying for the first time with heroku, and I have a problem.
When doing git push heroku master everything works correctly, but when entering the site through the browser it shows me only the message of Method Not Allowed
About the project: It is made with nodejs, express, postgres and sequelize on the backend side and with react on the front side.
The database is already uploaded and is working correctly! but when uploading the project it doesn't work
when doing heroku logs -n 200 it returns me
› Warning: heroku update available from 7.59.1 to 7.59.2.
2021-12-28T00:46:51.552641+00:00 app[api]: Initial release by user ivanleodomin00#gmail.com
2021-12-28T00:46:51.552641+00:00 app[api]: Release v1 created by user ivanleodomin00#gmail.com
2021-12-28T00:46:55.112224+00:00 app[api]: Release v2 created by user ivanleodomin00#gmail.com
2021-12-28T00:46:55.112224+00:00 app[api]: Enable Logplex by user ivanleodomin00#gmail.com
2021-12-28T00:47:57.250526+00:00 app[api]: Attach DATABASE (#ref:postgresql-amorphous-18095) by user ivanleodomin00#gmail.com
2021-12-28T00:47:57.250526+00:00 app[api]: Running release v3 commands by user ivanleodomin00#gmail.com
2021-12-28T00:47:57.275444+00:00 app[api]: #ref:postgresql-amorphous-18095 completed provisioning, setting DATABASE_URL. by user ivanleodomin00#gmail.com
2021-12-28T00:47:57.275444+00:00 app[api]: Release v4 created by user ivanleodomin00#gmail.com
2021-12-28T01:10:18.000000+00:00 app[api]: Build started by user ivanleodomin00#gmail.com
2021-12-28T01:10:38.372557+00:00 app[api]: Deploy abd73b84 by user ivanleodomin00#gmail.com
2021-12-28T01:10:38.372557+00:00 app[api]: Release v5 created by user ivanleodomin00#gmail.com
2021-12-28T01:10:38.387597+00:00 app[api]: Scaled to web#1:Free by user ivanleodomin00#gmail.com
2021-12-28T01:10:39.000000+00:00 app[api]: Build succeeded
2021-12-28T01:10:41.897243+00:00 heroku[web.1]: Starting process with command `npm start`
2021-12-28T01:10:43.543463+00:00 app[web.1]:
2021-12-28T01:10:43.543478+00:00 app[web.1]: > e-commerce#0.1.0 start /app
2021-12-28T01:10:43.543478+00:00 app[web.1]: > per-env
2021-12-28T01:10:43.543478+00:00 app[web.1]:
2021-12-28T01:10:43.561920+00:00 app[web.1]: sh: 1: per-env: not found
2021-12-28T01:10:43.568721+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-12-28T01:10:43.568931+00:00 app[web.1]: npm ERR! syscall spawn
2021-12-28T01:10:43.569020+00:00 app[web.1]: npm ERR! file sh
2021-12-28T01:10:43.569124+00:00 app[web.1]: npm ERR! errno ENOENT
2021-12-28T01:10:43.573632+00:00 app[web.1]: npm ERR! e-commerce#0.1.0 start: `per-env`
2021-12-28T01:10:43.573685+00:00 app[web.1]: npm ERR! spawn ENOENT
2021-12-28T01:10:43.573770+00:00 app[web.1]: npm ERR!
2021-12-28T01:10:43.573839+00:00 app[web.1]: npm ERR! Failed at the e-commerce#0.1.0 start script.
2021-12-28T01:10:43.573890+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-12-28T01:10:43.579537+00:00 app[web.1]:
2021-12-28T01:10:43.579638+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-12-28T01:10:43.579689+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-12-28T01_10_43_574Z-debug.log
2021-12-28T01:10:43.703276+00:00 heroku[web.1]: Process exited with status 1
2021-12-28T01:10:43.758598+00:00 heroku[web.1]: State changed from starting to crashed
2021-12-28T01:10:43.763138+00:00 heroku[web.1]: State changed from crashed to starting
2021-12-28T01:10:46.370206+00:00 heroku[web.1]: Starting process with command `npm start`
2021-12-28T01:10:47.472121+00:00 app[web.1]:
2021-12-28T01:10:47.472132+00:00 app[web.1]: > e-commerce#0.1.0 start /app
2021-12-28T01:10:47.472132+00:00 app[web.1]: > per-env
2021-12-28T01:10:47.472132+00:00 app[web.1]:
2021-12-28T01:10:47.476034+00:00 app[web.1]: sh: 1: per-env: not found
2021-12-28T01:10:47.479992+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-12-28T01:10:47.480158+00:00 app[web.1]: npm ERR! syscall spawn
2021-12-28T01:10:47.480221+00:00 app[web.1]: npm ERR! file sh
2021-12-28T01:10:47.480286+00:00 app[web.1]: npm ERR! errno ENOENT
2021-12-28T01:10:47.482318+00:00 app[web.1]: npm ERR! e-commerce#0.1.0 start: `per-env`
2021-12-28T01:10:47.482361+00:00 app[web.1]: npm ERR! spawn ENOENT
2021-12-28T01:10:47.482406+00:00 app[web.1]: npm ERR!
2021-12-28T01:10:47.482446+00:00 app[web.1]: npm ERR! Failed at the e-commerce#0.1.0 start script.
2021-12-28T01:10:47.482482+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-12-28T01:10:47.486127+00:00 app[web.1]:
2021-12-28T01:10:47.486197+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-12-28T01:10:47.486228+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-12-28T01_10_47_483Z-debug.log
2021-12-28T01:10:47.615077+00:00 heroku[web.1]: Process exited with status 1
2021-12-28T01:10:47.682401+00:00 heroku[web.1]: State changed from starting to crashed
2021-12-28T01:19:01.000000+00:00 app[api]: Build started by user ivanleodomin00#gmail.com
2021-12-28T01:19:21.617612+00:00 app[api]: Deploy 481231e4 by user ivanleodomin00#gmail.com
2021-12-28T01:19:21.617612+00:00 app[api]: Release v6 created by user ivanleodomin00#gmail.com
2021-12-28T01:19:22.000000+00:00 app[api]: Build succeeded
2021-12-28T01:19:22.754313+00:00 heroku[web.1]: State changed from crashed to starting
2021-12-28T01:19:25.218296+00:00 heroku[web.1]: Starting process with command `npm start`
2021-12-28T01:19:26.154715+00:00 app[web.1]:
2021-12-28T01:19:26.154724+00:00 app[web.1]: > e-commerce#0.1.0 start /app
2021-12-28T01:19:26.154724+00:00 app[web.1]: > npm run server
2021-12-28T01:19:26.154725+00:00 app[web.1]:
2021-12-28T01:19:26.358957+00:00 app[web.1]:
2021-12-28T01:19:26.358959+00:00 app[web.1]: > e-commerce#0.1.0 server /app
2021-12-28T01:19:26.358959+00:00 app[web.1]: > nodemon server.js
2021-12-28T01:19:26.358960+00:00 app[web.1]:
2021-12-28T01:19:26.363664+00:00 app[web.1]: sh: 1: nodemon: not found
2021-12-28T01:19:26.367517+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-12-28T01:19:26.367670+00:00 app[web.1]: npm ERR! syscall spawn
2021-12-28T01:19:26.367739+00:00 app[web.1]: npm ERR! file sh
2021-12-28T01:19:26.367822+00:00 app[web.1]: npm ERR! errno ENOENT
2021-12-28T01:19:26.370782+00:00 app[web.1]: npm ERR! e-commerce#0.1.0 server: `nodemon server.js`
2021-12-28T01:19:26.370823+00:00 app[web.1]: npm ERR! spawn ENOENT
2021-12-28T01:19:26.370876+00:00 app[web.1]: npm ERR!
2021-12-28T01:19:26.370924+00:00 app[web.1]: npm ERR! Failed at the e-commerce#0.1.0 server script.
2021-12-28T01:19:26.370966+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-12-28T01:19:26.373409+00:00 app[web.1]:
2021-12-28T01:19:26.373479+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-12-28T01:19:26.373515+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-12-28T01_19_26_371Z-debug.log
2021-12-28T01:19:26.381218+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-12-28T01:19:26.381440+00:00 app[web.1]: npm ERR! errno 1
2021-12-28T01:19:26.385033+00:00 app[web.1]: npm ERR! e-commerce#0.1.0 start: `npm run server`
2021-12-28T01:19:26.385078+00:00 app[web.1]: npm ERR! Exit status 1
2021-12-28T01:19:26.385133+00:00 app[web.1]: npm ERR!
2021-12-28T01:19:26.385190+00:00 app[web.1]: npm ERR! Failed at the e-commerce#0.1.0 start script.
2021-12-28T01:19:26.385249+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-12-28T01:19:26.388004+00:00 app[web.1]:
2021-12-28T01:19:26.388101+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-12-28T01:19:26.388128+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-12-28T01_19_26_385Z-debug.log
2021-12-28T01:19:26.532464+00:00 heroku[web.1]: Process exited with status 1
2021-12-28T01:19:26.580646+00:00 heroku[web.1]: State changed from starting to crashed
2021-12-28T02:10:34.000000+00:00 app[api]: Build started by user ivanleodomin00#gmail.com
2021-12-28T02:10:55.246466+00:00 app[api]: Release v7 created by user ivanleodomin00#gmail.com
2021-12-28T02:10:55.246466+00:00 app[api]: Deploy 408cc0e7 by user ivanleodomin00#gmail.com
2021-12-28T02:10:56.000000+00:00 app[api]: Build succeeded
2021-12-28T02:10:56.665889+00:00 heroku[web.1]: State changed from crashed to starting
2021-12-28T02:10:59.192072+00:00 heroku[web.1]: Starting process with command `npm start`
2021-12-28T02:11:00.408464+00:00 app[web.1]:
2021-12-28T02:11:00.408486+00:00 app[web.1]: > e-commerce#0.1.0 start /app
2021-12-28T02:11:00.408486+00:00 app[web.1]: > node server.js
2021-12-28T02:11:00.408486+00:00 app[web.1]:
2021-12-28T02:11:00.924625+00:00 app[web.1]: Tue, 28 Dec 2021 02:11:00 GMT express-session deprecated undefined resave option; provide resave option at server.js:19:9
2021-12-28T02:11:00.925307+00:00 app[web.1]: Tue, 28 Dec 2021 02:11:00 GMT express-session deprecated undefined saveUninitialized option; provide saveUninitialized option at server.js:19:9
2021-12-28T02:11:00.925975+00:00 app[web.1]: Warning: connect.session() MemoryStore is not
2021-12-28T02:11:00.925976+00:00 app[web.1]: designed for a production environment, as it will leak
2021-12-28T02:11:00.925976+00:00 app[web.1]: memory, and will not scale past a single process.
2021-12-28T02:11:01.052123+00:00 app[web.1]: listen on port 4747
2021-12-28T02:11:59.280273+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2021-12-28T02:11:59.310519+00:00 heroku[web.1]: Stopping process with SIGKILL
2021-12-28T02:11:59.457957+00:00 heroku[web.1]: Process exited with status 137
2021-12-28T02:11:59.513246+00:00 heroku[web.1]: State changed from starting to crashed
2021-12-28T02:11:59.517764+00:00 heroku[web.1]: State changed from crashed to starting
2021-12-28T02:12:01.776449+00:00 heroku[web.1]: Starting process with command `npm start`
2021-12-28T02:12:02.697087+00:00 app[web.1]:
2021-12-28T02:12:02.697102+00:00 app[web.1]: > e-commerce#0.1.0 start /app
2021-12-28T02:12:02.697102+00:00 app[web.1]: > node server.js
2021-12-28T02:12:02.697103+00:00 app[web.1]:
2021-12-28T02:12:03.109575+00:00 app[web.1]: Tue, 28 Dec 2021 02:12:03 GMT express-session deprecated undefined resave option; provide resave option at server.js:19:9
2021-12-28T02:12:03.109947+00:00 app[web.1]: Tue, 28 Dec 2021 02:12:03 GMT express-session deprecated undefined saveUninitialized option; provide saveUninitialized option at server.js:19:9
2021-12-28T02:12:03.110335+00:00 app[web.1]: Warning: connect.session() MemoryStore is not
2021-12-28T02:12:03.110336+00:00 app[web.1]: designed for a production environment, as it will leak
2021-12-28T02:12:03.110336+00:00 app[web.1]: memory, and will not scale past a single process.
2021-12-28T02:12:03.270410+00:00 app[web.1]: listen on port 4747
2021-12-28T02:13:02.321588+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2021-12-28T02:13:02.385589+00:00 heroku[web.1]: Stopping process with SIGKILL
2021-12-28T02:13:02.423619+00:00 app[web.1]: Error waiting for process to terminate: No child processes
2021-12-28T02:13:02.555802+00:00 heroku[web.1]: Process exited with status 22
2021-12-28T02:13:02.619496+00:00 heroku[web.1]: State changed from starting to crashed
2021-12-28T02:24:06.811349+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=devmusic-e.herokuapp.com request_id=b963cdda-25f1-40ad-ad48-453d230fd1d0 fwd="181.165.54.184" dyno= connect= service= status=503 bytes= protocol=https
2021-12-28T02:24:07.567128+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=devmusic-e.herokuapp.com request_id=e4181dab-522f-4d25-8cf7-571e2f47abb2 fwd="181.165.54.184" dyno= connect= service= status=503 bytes= protocol=https
2021-12-28T02:27:20.713535+00:00 app[api]: Starting process with command `rails console` by user ivanleodomin00#gmail.com
2021-12-28T02:27:23.597696+00:00 heroku[run.8831]: Awaiting client
2021-12-28T02:27:23.612526+00:00 heroku[run.8831]: Starting process with command `rails console`
2021-12-28T02:27:23.768779+00:00 heroku[run.8831]: State changed from starting to up
2021-12-28T02:27:26.931258+00:00 heroku[run.8831]: Process exited with status 127
2021-12-28T02:27:26.991577+00:00 heroku[run.8831]: State changed from up to complete
2021-12-28T02:27:32.365105+00:00 app[api]: Starting process with command `rails console` by user ivanleodomin00#gmail.com
2021-12-28T02:27:35.374067+00:00 heroku[run.9154]: Awaiting client
2021-12-28T02:27:35.382164+00:00 heroku[run.9154]: State changed from starting to up
2021-12-28T02:27:35.392551+00:00 heroku[run.9154]: Starting process with command `rails console`
2021-12-28T02:27:38.713398+00:00 heroku[run.9154]: Process exited with status 127
2021-12-28T02:27:38.759105+00:00 heroku[run.9154]: State changed from up to complete
2021-12-28T02:30:02.434663+00:00 app[api]: Starting process with command `rails console` by user ivanleodomin00#gmail.com
2021-12-28T02:30:05.749584+00:00 heroku[run.5828]: Awaiting client
2021-12-28T02:30:05.759879+00:00 heroku[run.5828]: State changed from starting to up
2021-12-28T02:30:05.766832+00:00 heroku[run.5828]: Starting process with command `rails console`
2021-12-28T02:30:09.092845+00:00 heroku[run.5828]: Process exited with status 127
2021-12-28T02:30:09.145510+00:00 heroku[run.5828]: State changed from up to complete
2021-12-28T02:33:06.079727+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=devmusic-e.herokuapp.com request_id=49e83d77-278f-470d-9f6b-fa7706e1584c fwd="181.165.54.184" dyno= connect= service= status=503 bytes= protocol=https
2021-12-28T02:33:06.764438+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=devmusic-e.herokuapp.com request_id=3b4a6dac-235a-4a9f-b6e5-0a29ff44616e fwd="181.165.54.184" dyno= connect= service= status=503 bytes= protocol=https

Related

Heroku error on deployment - ( Request Timeout )

I have a reactjs / nodejs app being run, and I am trying to host with Heroku... The app is deployed live, but I cant actually load anything. In my logs I see this:
2021-04-18T23:41:58.000000+00:00 app[api]: Build succeeded
2021-04-18T23:42:14.395000+00:00 app[web.1]: npm WARN shared#1.0.0 No description
2021-04-18T23:42:14.422024+00:00 app[web.1]: npm WARN shared#1.0.0 No repository field.
2021-04-18T23:42:14.422890+00:00 app[web.1]:
2021-04-18T23:42:14.682226+00:00 app[web.1]: added 1 package from 6 contributors and audited 486 packages in 17.344s
2021-04-18T23:42:15.300879+00:00 app[web.1]: found 56017 vulnerabilities (40514 low, 15 moderate, 15488 high)
2021-04-18T23:42:15.300903+00:00 app[web.1]: run `npm audit fix` to fix them, or `npm audit` for details
2021-04-18T23:42:15.361457+00:00 app[web.1]: /app/.heroku/node/lib/node_modules/shared -> /app/shared
2021-04-18T23:42:15.391152+00:00 app[web.1]: /app/react-web/node_modules/shared -> /app/.heroku/node/lib/node_modules/shared -> /app/shared
2021-04-18T23:42:16.015673+00:00 app[web.1]:
2021-04-18T23:42:16.015683+00:00 app[web.1]: > react-web#0.1.0 start /app/react-web
2021-04-18T23:42:16.015687+00:00 app[web.1]: > node --max_old_space_size=2560 checkEnvironmentForBuild && react-app-rewired start
2021-04-18T23:42:16.015687+00:00 app[web.1]:
2021-04-18T23:42:20.857742+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.16.225.30/
2021-04-18T23:42:20.858248+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2021-04-18T23:42:20.858378+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/react-web/public
2021-04-18T23:42:20.858506+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2021-04-18T23:42:20.858836+00:00 app[web.1]: Starting the development server...
2021-04-18T23:42:20.858837+00:00 app[web.1]:
2021-04-18T23:42:21.460296+00:00 heroku[web.1]: State changed from starting to up
2021-04-18T23:42:52.656047+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=cleaningassistant.herokuapp.com request_id=3b1180dc-c080-4624-8a97-d9247577dc3f fwd="99.249.30.56" dyno=web.1 connect=0ms service=30001ms status=503 bytes=0 protocol=https
it is basically saying Request Timeout, when all my start scripts are correct. The only thing it could be looking for is for me to define a port. The problem is, this isn't a nodejs app, its reactjs, so not sure what to do there.
app set up:
please let me know if anyone has any suggestions.

How to solve not found error in heroku after deployment

I'm tried to upload a MERN stack project on heroku, when I push my project then does not show me any error, but after that when I tried to open my app then show me error like this:
Then when I see on heroku logs show me error like this:
2021-04-02T04:39:53.640765+00:00 app[web.1]: }
2021-04-02T04:39:53.673306+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-04-02T04:39:53.673901+00:00 app[web.1]: npm ERR! errno 1
2021-04-02T04:39:53.688128+00:00 app[web.1]: npm ERR! react-boiler-plate#1.0.0 start: `node server/index.js`
2021-04-02T04:39:53.688366+00:00 app[web.1]: npm ERR! Exit status 1
2021-04-02T04:39:53.688645+00:00 app[web.1]: npm ERR!
2021-04-02T04:39:53.688864+00:00 app[web.1]: npm ERR! Failed at the react-boiler-plate#1.0.0 start script.
2021-04-02T04:39:53.689072+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-04-02T04:39:53.702373+00:00 app[web.1]:
2021-04-02T04:39:53.702750+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-04-02T04:39:53.702956+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-04-02T04_39_53_691Z-debug.log
2021-04-02T04:39:53.801523+00:00 heroku[web.1]: Process exited with status 1
2021-04-02T04:39:57.606025+00:00 app[web.1]:
2021-04-02T04:39:57.606043+00:00 app[web.1]: > react-boiler-plate#1.0.0 start /app
2021-04-02T04:39:57.606044+00:00 app[web.1]: > node server/index.js
2021-04-02T04:39:57.606044+00:00 app[web.1]:
2021-04-02T04:39:59.617643+00:00 app[web.1]: (node:21) Warning: Accessing non-existent property 'count' of module exports inside circular dependency
2021-04-02T04:39:59.617704+00:00 app[web.1]: (Use `node --trace-warnings ...` to show where the warning was created)
2021-04-02T04:39:59.618588+00:00 app[web.1]: (node:21) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
2021-04-02T04:39:59.618717+00:00 app[web.1]: (node:21) Warning: Accessing non-existent property 'remove' of module exports inside circular dependency
2021-04-02T04:39:59.618853+00:00 app[web.1]: (node:21) Warning: Accessing non-existent property 'updateOne' of module exports inside circular dependency
2021-04-02T04:39:59.619452+00:00 app[web.1]: Server Listening on 52400
2021-04-02T04:39:59.664202+00:00 heroku[web.1]: State changed from starting to up
2021-04-02T04:40:00.154607+00:00 app[web.1]: MongoDB Connected...
2021-04-02T04:40:02.562719+00:00 heroku[router]: at=info method=GET path="/" host=portfolio-show.herokuapp.com request_id=482fc0ad-4dbf-4d68-a0b8-4ad915f0356d fwd="116.58.200.211" dyno=web.1 connect=0ms service=81ms status=404 bytes=412 protocol=https
2021-04-02T04:40:02.564414+00:00 app[web.1]: Error: ENOENT: no such file or directory, stat '/app/client/build/index.html'
2021-04-02T04:40:12.580732+00:00 heroku[router]: at=info method=GET path="/" host=portfolio-show.herokuapp.com request_id=0cb0a90a-eefe-4730-97f2-58ad7601fb31 fwd="116.58.200.211" dyno=web.1 connect=0ms service=11ms status=404 bytes=412 protocol=https
2021-04-02T04:40:12.581974+00:00 app[web.1]: Error: ENOENT: no such file or directory, stat '/app/client/build/index.html'
2021-04-02T04:41:07.703010+00:00 heroku[router]: at=info method=GET path="/" host=portfolio-show.herokuapp.com request_id=5195792b-17a0-4044-82a6-8e392f3bc920 fwd="116.58.200.211" dyno=web.1 connect=0ms service=13ms status=404 bytes=412 protocol=https
2021-04-02T04:41:07.703565+00:00 app[web.1]: Error: ENOENT: no such file or directory, stat '/app/client/build/index.html'
2021-04-02T04:43:56.612829+00:00 app[web.1]: Error: ENOENT: no such file or directory, stat '/app/client/build/index.html'
2021-04-02T04:43:56.614507+00:00 heroku[router]: at=info method=GET path="/" host=portfolio-show.herokuapp.com request_id=24d996e4-a43f-427c-89d5-a83fad29ec8e fwd="116.58.200.211" dyno=web.1 connect=2ms service=15ms status=404 bytes=412 protocol=https
2021-04-02T04:47:24.095734+00:00 app[api]: Set NODE_ENV config vars by user alaminsheikh30025#gmail.com
2021-04-02T04:47:24.095734+00:00 app[api]: Release v7 created by user alaminsheikh30025#gmail.com
2021-04-02T04:47:24.300332+00:00 heroku[web.1]: Restarting
2021-04-02T04:47:24.302570+00:00 heroku[web.1]: State changed from up to starting
2021-04-02T04:47:26.081387+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2021-04-02T04:47:26.273408+00:00 heroku[web.1]: Process exited with status 143
2021-04-02T04:47:28.480334+00:00 heroku[web.1]: Starting process with command `npm start`
2021-04-02T04:47:32.050957+00:00 app[web.1]:
2021-04-02T04:47:32.050999+00:00 app[web.1]: > react-boiler-plate#1.0.0 start /app
2021-04-02T04:47:32.051000+00:00 app[web.1]: > node server/index.js
2021-04-02T04:47:32.051001+00:00 app[web.1]:
2021-04-02T04:47:33.084385+00:00 app[web.1]: (node:21) Warning: Accessing non-existent property 'count' of module exports inside circular dependency
2021-04-02T04:47:33.084397+00:00 app[web.1]: (Use `node --trace-warnings ...` to show where the warning was created)
2021-04-02T04:47:33.085117+00:00 app[web.1]: (node:21) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
2021-04-02T04:47:33.085232+00:00 app[web.1]: (node:21) Warning: Accessing non-existent property 'remove' of module exports inside circular dependency
2021-04-02T04:47:33.085334+00:00 app[web.1]: (node:21) Warning: Accessing non-existent property 'updateOne' of module exports inside circular dependency
2021-04-02T04:47:33.085964+00:00 app[web.1]: Server Listening on 8465
2021-04-02T04:47:33.331113+00:00 app[web.1]: MongoDB Connected...
2021-04-02T04:47:33.388190+00:00 heroku[web.1]: State changed from starting to up
2021-04-02T04:47:34.346673+00:00 heroku[router]: at=info method=GET path="/" host=portfolio-show.herokuapp.com request_id=183fcfe3-db55-4a00-b385-9d7d66f60ed4 fwd="116.58.200.211" dyno=web.1 connect=1ms service=24ms status=404 bytes=412 protocol=https
2021-04-02T04:47:34.348398+00:00 app[web.1]: Error: ENOENT: no such file or directory, stat '/app/client/build/index.html'
2021-04-02T04:48:45.968962+00:00 heroku[router]: at=info method=GET path="/" host=portfolio-show.herokuapp.com request_id=2a1df37e-9697-4cf4-be41-cc907f6cb724 fwd="116.58.200.211" dyno=web.1 connect=0ms service=16ms status=404 bytes=412 protocol=https
2021-04-02T04:48:45.969496+00:00 app[web.1]: Error: ENOENT: no such file or directory, stat '/app/client/build/index.html'
2021-04-02T04:55:29.405371+00:00 app[web.1]: Error: ENOENT: no such file or directory, stat '/app/client/build/index.html'
2021-04-02T04:55:29.405889+00:00 heroku[router]: at=info method=GET path="/" host=portfolio-show.herokuapp.com request_id=b9b8b037-8c4a-4c58-9fc9-d116af2283e9 fwd="116.58.200.211" dyno=web.1 connect=0ms service=10ms status=404 bytes=412 protocol=https
2021-04-02T05:02:01.000000+00:00 app[api]: Build started by user alaminsheikh30025#gmail.com
2021-04-02T05:02:35.128829+00:00 app[api]: Deploy 7dd2269f by user alaminsheikh30025#gmail.com
2021-04-02T05:02:35.128829+00:00 app[api]: Release v8 created by user alaminsheikh30025#gmail.com
2021-04-02T05:02:35.313075+00:00 heroku[web.1]: Restarting
2021-04-02T05:02:35.315983+00:00 heroku[web.1]: State changed from up to starting
2021-04-02T05:02:36.000000+00:00 app[api]: Build succeeded
2021-04-02T05:02:36.713360+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2021-04-02T05:02:36.983404+00:00 heroku[web.1]: Process exited with status 143
2021-04-02T05:02:39.085257+00:00 heroku[web.1]: Starting process with command `npm start`
2021-04-02T05:02:42.325482+00:00 app[web.1]:
2021-04-02T05:02:42.326048+00:00 app[web.1]: > react-boiler-plate#1.0.0 start /app
2021-04-02T05:02:42.326051+00:00 app[web.1]: > node server/index.js
2021-04-02T05:02:42.326053+00:00 app[web.1]:
2021-04-02T05:02:43.565518+00:00 app[web.1]: (node:21) Warning: Accessing non-existent property 'count' of module exports inside circular dependency
2021-04-02T05:02:43.565529+00:00 app[web.1]: (Use `node --trace-warnings ...` to show where the warning was created)
2021-04-02T05:02:43.566549+00:00 app[web.1]: (node:21) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
2021-04-02T05:02:43.566660+00:00 app[web.1]: (node:21) Warning: Accessing non-existent property 'remove' of module exports inside circular dependency
2021-04-02T05:02:43.566774+00:00 app[web.1]: (node:21) Warning: Accessing non-existent property 'updateOne' of module exports inside circular dependency
2021-04-02T05:02:43.567285+00:00 app[web.1]: Server Listening on 58335
2021-04-02T05:02:43.757613+00:00 app[web.1]: MongoDB Connected...
2021-04-02T05:02:43.923407+00:00 heroku[web.1]: State changed from starting to up
2021-04-02T05:03:06.224704+00:00 heroku[router]: at=info method=GET path="/" host=portfolio-show.herokuapp.com request_id=0dfe3e56-29e2-4abd-9326-30f22a3f3a3f fwd="116.58.200.211" dyno=web.1 connect=3ms service=24ms status=404 bytes=412 protocol=https
2021-04-02T05:03:06.226724+00:00 app[web.1]: Error: ENOENT: no such file or directory, stat '/app/client/build/index.html'
2021-04-02T05:37:05.548583+00:00 heroku[web.1]: Idling
2021-04-02T05:37:05.550224+00:00 heroku[web.1]: State changed from up to down
2021-04-02T05:37:06.905027+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2021-04-02T05:37:07.188301+00:00 heroku[web.1]: Process exited with status 143
2021-04-02T05:45:52.000000+00:00 app[api]: Build started by user alaminsheikh30025#gmail.com
2021-04-02T05:46:24.941298+00:00 app[api]: Deploy 3d2e9eec by user alaminsheikh30025#gmail.com
2021-04-02T05:46:24.941298+00:00 app[api]: Release v9 created by user alaminsheikh30025#gmail.com
2021-04-02T05:46:25.895329+00:00 heroku[web.1]: State changed from down to starting
2021-04-02T05:46:26.000000+00:00 app[api]: Build succeeded
2021-04-02T05:46:29.859262+00:00 heroku[web.1]: Starting process with command `node index.js`
2021-04-02T05:46:33.688119+00:00 app[web.1]: (node:4) Warning: Accessing non-existent property 'count' of module exports inside circular dependency
2021-04-02T05:46:33.688136+00:00 app[web.1]: (Use `node --trace-warnings ...` to show where the warning was created)
2021-04-02T05:46:33.688805+00:00 app[web.1]: (node:4) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
2021-04-02T05:46:33.688950+00:00 app[web.1]: (node:4) Warning: Accessing non-existent property 'remove' of module exports inside circular dependency
2021-04-02T05:46:33.689117+00:00 app[web.1]: (node:4) Warning: Accessing non-existent property 'updateOne' of module exports inside circular dependency
2021-04-02T05:46:33.689750+00:00 app[web.1]: Server Listening on 3542
2021-04-02T05:46:33.946525+00:00 app[web.1]: MongoDB Connected...
2021-04-02T05:46:34.274995+00:00 heroku[web.1]: State changed from starting to up
2021-04-02T05:46:41.770270+00:00 heroku[router]: at=info method=GET path="/" host=portfolio-show.herokuapp.com request_id=c42834c5-a16c-4c12-ab34-41f2a229d0d6 fwd="116.58.200.211" dyno=web.1 connect=0ms service=48ms status=404 bytes=412 protocol=https
2021-04-02T05:46:41.775861+00:00 app[web.1]: Error: ENOENT: no such file or directory, stat '/app/client/build/index.html'
I have config file by this way:
.dev.js file:
module.exports = {
mongoURI:
"mongodb+srv://username:pass#demo.erwyk.mongodb.net/PORTFOLIO?retryWrites=true&w=majority",
};
prod.js file:
module.exports = {
mongoURI: process.env.MONGO_URI,
};
key.js file:
if (process.env.NODE_ENV === 'production') {
module.exports = require('./prod');
} else {
module.exports = require('./dev');
}
then I have add config file on heroku:
Any Suggestion Please.
Actually I was problem on project config, I have solved by this way:
Make configuration for heroku deployment
specify npm and node version for frontend deployment.[check version npm -v and node -v]
Then npm run build for client folder
Put environment variable for production mode in heroku website [for me MONGO_URI]
then go to server folder inside package.js
add this line of code
script {
....
"heroku-postbuild": "NPM_PRODUCTION:false npm install --prefix client && npm run build --prefix client"
}
That's it.
then go to terminal...
heroku login
git init
git add .
git commit -m "bug fixed"
heroku git:remote -a <app_name> (if already created a app in heroku, otherwise heroku create)
git push heroku master
heroku open
Hope app will run successfully,
Thank you, [if still faced any problem then let me know in the comment section]

MERN Heorku App Works Locally, Stores Data In MLAB but wont work using deployment link

I have this project working locally and it seems to be interacting with the mLab database on heroku when I save information through my localhost. However, when I use the heroku link, I get an application error which tells me to take a look at the logs. I posted a picture of the full log below.
Here is a link to the repo:https://github.com/TheGreekCuban/ButterflySocial
Heroku deployed link: https://butterflysocial.herokuapp.com/
I've tried deleting package-lock.json and node modules, I've made sure my config variables match up, I've read all similar material on the internet and still can't figure it out. I think it has to do with either:
The build process
The mlab connection
See error messages below.
I expect the app to run as it does locally. The error messages when I write heroku logs --tail are:
2019-10-10T06:50:37.277769+00:00 app[web.1]: at Connection.emit (events.js:198:13)
2019-10-10T06:50:37.277771+00:00 app[web.1]: at processMessage (/app/node_modules/mongodb/lib/core/connection/connection.js:364:10)
2019-10-10T06:50:37.277773+00:00 app[web.1]: at Socket.<anonymous> (/app/node_modules/mongodb/lib/core/connection/connection.js:533:15)
2019-10-10T06:50:37.277776+00:00 app[web.1]: at Socket.emit (events.js:198:13)
2019-10-10T06:50:37.277778+00:00 app[web.1]: at addChunk (_stream_readable.js:288:12)
2019-10-10T06:50:37.27778+00:00 app[web.1]: at readableAddChunk (_stream_readable.js:269:11)
2019-10-10T06:50:37.277782+00:00 app[web.1]: at Socket.Readable.push (_stream_readable.js:224:10)
2019-10-10T06:50:37.277784+00:00 app[web.1]: at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
2019-10-10T06:50:37.291411+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-10-10T06:50:37.292117+00:00 app[web.1]: npm ERR! errno 1
2019-10-10T06:50:37.293986+00:00 app[web.1]: npm ERR! mern#1.0.0 start:prod: `node server.js`
2019-10-10T06:50:37.294229+00:00 app[web.1]: npm ERR! Exit status 1
2019-10-10T06:50:37.294617+00:00 app[web.1]: npm ERR!
2019-10-10T06:50:37.29488+00:00 app[web.1]: npm ERR! Failed at the mern#1.0.0 start:prod script.
2019-10-10T06:50:37.29508+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-10-10T06:50:37.302171+00:00 app[web.1]:
2019-10-10T06:50:37.302456+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-10-10T06:50:37.30261+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-10-10T06_50_37_297Z-debug.log
2019-10-10T06:50:37.75424+00:00 app[web.1]:
2019-10-10T06:50:37.754257+00:00 app[web.1]: > mern#1.0.0 start:dev /app
2019-10-10T06:50:37.754259+00:00 app[web.1]: > concurrently "nodemon --ignore 'client/*'" "npm run client"
2019-10-10T06:50:37.754261+00:00 app[web.1]:
2019-10-10T06:50:37.760003+00:00 app[web.1]: sh: 1: concurrently: not found
2019-10-10T06:50:37.765837+00:00 app[web.1]: npm ERR! file sh
2019-10-10T06:50:37.766059+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-10-10T06:50:37.766219+00:00 app[web.1]: npm ERR! errno ENOENT
2019-10-10T06:50:37.766365+00:00 app[web.1]: npm ERR! syscall spawn
2019-10-10T06:50:37.76744+00:00 app[web.1]: npm ERR! mern#1.0.0 start:dev: `concurrently "nodemon --ignore 'client/*'" "npm run client"`
2019-10-10T06:50:37.767549+00:00 app[web.1]: npm ERR! spawn ENOENT
2019-10-10T06:50:37.767758+00:00 app[web.1]: npm ERR!
2019-10-10T06:50:37.767881+00:00 app[web.1]: npm ERR! Failed at the mern#1.0.0 start:dev script.
2019-10-10T06:50:37.768053+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-10-10T06:50:37.772518+00:00 app[web.1]:
2019-10-10T06:50:37.772726+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-10-10T06:50:37.772869+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-10-10T06_50_37_769Z-debug.log
2019-10-10T06:50:37.780063+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-10-10T06:50:37.780556+00:00 app[web.1]: npm ERR! errno 1
2019-10-10T06:50:37.78215+00:00 app[web.1]: npm ERR! mern#1.0.0 start: `if-env NODE_ENV=production && npm run start:prod || npm run start:dev`
2019-10-10T06:50:37.782339+00:00 app[web.1]: npm ERR! Exit status 1
2019-10-10T06:50:37.782696+00:00 app[web.1]: npm ERR!
2019-10-10T06:50:37.782965+00:00 app[web.1]: npm ERR! Failed at the mern#1.0.0 start script.
2019-10-10T06:50:37.783129+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-10-10T06:50:37.788035+00:00 app[web.1]:
2019-10-10T06:50:37.788187+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-10-10T06:50:37.78828+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-10-10T06_50_37_784Z-debug.log
2019-10-10T06:50:37.843017+00:00 heroku[web.1]: Process exited with status 1
2019-10-10T06:50:37.880511+00:00 heroku[web.1]: State changed from up to crashed
2019-10-10T07:01:30.93415+00:00 heroku[web.1]: State changed from crashed to starting
2019-10-10T07:01:47.992091+00:00 heroku[web.1]: Starting process with command `npm start`
2019-10-10T07:01:51.884742+00:00 app[web.1]:
2019-10-10T07:01:51.884761+00:00 app[web.1]: > mern#1.0.0 start /app
2019-10-10T07:01:51.884764+00:00 app[web.1]: > if-env NODE_ENV=production && npm run start:prod || npm run start:dev
2019-10-10T07:01:51.884766+00:00 app[web.1]:
2019-10-10T07:01:52.543917+00:00 app[web.1]:
2019-10-10T07:01:52.543943+00:00 app[web.1]: > mern#1.0.0 start:prod /app
2019-10-10T07:01:52.543946+00:00 app[web.1]: > node server.js
2019-10-10T07:01:52.543948+00:00 app[web.1]:
2019-10-10T07:01:54.038422+00:00 heroku[web.1]: source=web.1 dyno=heroku.149127838.c5e2572d-1b0e-42da-9a10-477a612609fa sample#memory_total=74.10MB sample#memory_rss=74.09MB sample#memory_cache=0.00MB sample#memory_swap=0.00MB sample#memory_pgpgin=19495pages sample#memory_pgpgout=3592pages sample#memory_quota=512.00MB
2019-10-10T07:01:54.299616+00:00 app[web.1]: mongodb://heroku_dvgm3n64:e7q2lkul6l3elf7qp3qbvu69vi#ds333248.mlab.com:33248/heroku_dvgm3n64
2019-10-10T07:01:54.333212+00:00 app[web.1]: does this do stuffs
2019-10-10T07:01:54.341108+00:00 app[web.1]: mongodb://useralex1:Emerson1*#ds333248.mlab.com:33248/heroku_dvgm3n64
2019-10-10T07:01:54.353677+00:00 app[web.1]: (node:42) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
2019-10-10T07:01:54.354266+00:00 app[web.1]: 🌎 ==> API Server now listening on PORT 12283!
2019-10-10T07:01:54.421227+00:00 app[web.1]: /app/node_modules/mongodb/lib/topologies/server.js:240
2019-10-10T07:01:54.42123+00:00 app[web.1]: throw err;
2019-10-10T07:01:54.421233+00:00 app[web.1]: ^
2019-10-10T07:01:54.421235+00:00 app[web.1]:
2019-10-10T07:01:54.421237+00:00 app[web.1]: MongoNetworkError: failed to connect to server [ds333248.mlab.com:33248] on first connect [MongoError: Authentication failed.]
2019-10-10T07:01:54.42124+00:00 app[web.1]: at Pool.<anonymous> (/app/node_modules/mongodb/lib/core/topologies/server.js:431:11)
2019-10-10T07:01:54.421242+00:00 app[web.1]: at Pool.emit (events.js:198:13)
2019-10-10T07:01:54.421244+00:00 app[web.1]: at connect (/app/node_modules/mongodb/lib/core/connection/pool.js:580:14)
2019-10-10T07:01:54.421246+00:00 app[web.1]: at callback (/app/node_modules/mongodb/lib/core/connection/connect.js:109:5)
2019-10-10T07:01:54.421248+00:00 app[web.1]: at provider.auth.err (/app/node_modules/mongodb/lib/core/connection/connect.js:352:21)
2019-10-10T07:01:54.42125+00:00 app[web.1]: at _authenticateSingleConnection (/app/node_modules/mongodb/lib/core/auth/auth_provider.js:66:11)
2019-10-10T07:01:54.421253+00:00 app[web.1]: at sendAuthCommand (/app/node_modules/mongodb/lib/core/auth/scram.js:177:16)
2019-10-10T07:01:54.421255+00:00 app[web.1]: at Connection.messageHandler (/app/node_modules/mongodb/lib/core/connection/connect.js:334:5)
2019-10-10T07:01:54.421257+00:00 app[web.1]: at Connection.emit (events.js:198:13)
2019-10-10T07:01:54.421259+00:00 app[web.1]: at processMessage (/app/node_modules/mongodb/lib/core/connection/connection.js:364:10)
2019-10-10T07:01:54.421261+00:00 app[web.1]: at Socket.<anonymous> (/app/node_modules/mongodb/lib/core/connection/connection.js:533:15)
2019-10-10T07:01:54.421263+00:00 app[web.1]: at Socket.emit (events.js:198:13)
2019-10-10T07:01:54.421265+00:00 app[web.1]: at addChunk (_stream_readable.js:288:12)
2019-10-10T07:01:54.421267+00:00 app[web.1]: at readableAddChunk (_stream_readable.js:269:11)
2019-10-10T07:01:54.421269+00:00 app[web.1]: at Socket.Readable.push (_stream_readable.js:224:10)
2019-10-10T07:01:54.421271+00:00 app[web.1]: at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
2019-10-10T07:01:54.44114+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-10-10T07:01:54.442022+00:00 app[web.1]: npm ERR! errno 1
2019-10-10T07:01:54.444207+00:00 app[web.1]: npm ERR! mern#1.0.0 start:prod: `node server.js`
2019-10-10T07:01:54.444479+00:00 app[web.1]: npm ERR! Exit status 1
2019-10-10T07:01:54.444934+00:00 app[web.1]: npm ERR!
2019-10-10T07:01:54.445255+00:00 app[web.1]: npm ERR! Failed at the mern#1.0.0 start:prod script.
2019-10-10T07:01:54.44552+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-10-10T07:01:54.458793+00:00 app[web.1]:
2019-10-10T07:01:54.459372+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-10-10T07:01:54.459708+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-10-10T07_01_54_447Z-debug.log
2019-10-10T07:01:55.403829+00:00 app[web.1]:
2019-10-10T07:01:55.403851+00:00 app[web.1]: > mern#1.0.0 start:dev /app
2019-10-10T07:01:55.403855+00:00 app[web.1]: > concurrently "nodemon --ignore 'client/*'" "npm run client"
2019-10-10T07:01:55.403857+00:00 app[web.1]:
2019-10-10T07:01:55.465173+00:00 app[web.1]: sh: 1: concurrently: not found
2019-10-10T07:01:55.476951+00:00 app[web.1]: npm ERR! file sh
2019-10-10T20:54:45.636326+00:00 heroku[web.1]: State changed from crashed to starting
2019-10-10T20:54:59.872839+00:00 heroku[web.1]: Starting process with command `npm start`
2019-10-10T20:55:02.396371+00:00 app[web.1]:
2019-10-10T20:55:02.39639+00:00 app[web.1]: > mern#1.0.0 start /app
2019-10-10T20:55:02.396393+00:00 app[web.1]: > if-env NODE_ENV=production && npm run start:prod || npm run start:dev
2019-10-10T20:55:02.396395+00:00 app[web.1]:
2019-10-10T20:55:02.889922+00:00 app[web.1]:
2019-10-10T20:55:02.889946+00:00 app[web.1]: > mern#1.0.0 start:prod /app
2019-10-10T20:55:02.889949+00:00 app[web.1]: > node server.js
2019-10-10T20:55:02.889952+00:00 app[web.1]:
2019-10-10T20:55:03.004906+00:00 app[web.1]: internal/modules/cjs/loader.js:638
2019-10-10T20:55:03.004911+00:00 app[web.1]: throw err;
2019-10-10T20:55:03.004913+00:00 app[web.1]: ^
2019-10-10T20:55:03.004915+00:00 app[web.1]:
2019-10-10T20:55:03.00492+00:00 app[web.1]: Error: Cannot find module 'dotenv'
2019-10-10T20:55:03.004923+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
2019-10-10T20:55:03.004925+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:562:25)
2019-10-10T20:55:03.004927+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:692:17)
2019-10-10T20:55:03.004929+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:25:18)
2019-10-10T20:55:03.004931+00:00 app[web.1]: at Object.<anonymous> (/app/server.js:1:1)
2019-10-10T20:55:03.004933+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:778:30)
2019-10-10T20:55:03.004935+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
2019-10-10T20:55:03.004937+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:653:32)
2019-10-10T20:55:03.004938+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
2019-10-10T20:55:03.004943+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:585:3)
2019-10-10T20:55:03.010806+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-10-10T20:55:03.011262+00:00 app[web.1]: npm ERR! errno 1
2019-10-10T20:55:03.012792+00:00 app[web.1]: npm ERR! mern#1.0.0 start:prod: `node server.js`
2019-10-10T20:55:03.012894+00:00 app[web.1]: npm ERR! Exit status 1
2019-10-10T20:55:03.013145+00:00 app[web.1]: npm ERR!
2019-10-10T20:55:03.013407+00:00 app[web.1]: npm ERR! Failed at the mern#1.0.0 start:prod script.
2019-10-10T20:55:03.013617+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-10-10T20:55:03.023551+00:00 app[web.1]:
2019-10-10T20:55:03.023712+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-10-10T20:55:03.023791+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-10-10T20_55_03_015Z-debug.log
2019-10-10T20:55:03.413352+00:00 app[web.1]:
2019-10-10T20:55:03.413367+00:00 app[web.1]: > mern#1.0.0 start:dev /app
2019-10-10T20:55:03.41337+00:00 app[web.1]: > concurrently "nodemon --ignore 'client/*'" "npm run client"
2019-10-10T20:55:03.413372+00:00 app[web.1]:
2019-10-10T20:55:03.418825+00:00 app[web.1]: sh: 1: concurrently: not found
2019-10-10T20:55:03.425842+00:00 app[web.1]: npm ERR! file sh
2019-10-10T20:55:03.426173+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-10-10T20:55:03.426436+00:00 app[web.1]: npm ERR! errno ENOENT
2019-10-10T20:55:03.426736+00:00 app[web.1]: npm ERR! syscall spawn
2019-10-10T20:55:03.428257+00:00 app[web.1]: npm ERR! mern#1.0.0 start:dev: `concurrently "nodemon --ignore 'client/*'" "npm run client"`
2019-10-10T20:55:03.428478+00:00 app[web.1]: npm ERR! spawn ENOENT
2019-10-10T20:55:03.428731+00:00 app[web.1]: npm ERR!
2019-10-10T20:55:03.428905+00:00 app[web.1]: npm ERR! Failed at the mern#1.0.0 start:dev script.
2019-10-10T20:55:03.429153+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-10-10T20:55:03.437512+00:00 app[web.1]:
2019-10-10T20:55:03.437701+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-10-10T20:55:03.437824+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-10-10T20_55_03_430Z-debug.log
2019-10-10T20:55:03.454807+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-10-10T20:55:03.455813+00:00 app[web.1]: npm ERR! errno 1
2019-10-10T20:55:03.457977+00:00 app[web.1]: npm ERR! mern#1.0.0 start: `if-env NODE_ENV=production && npm run start:prod || npm run start:dev`
2019-10-10T20:55:03.458149+00:00 app[web.1]: npm ERR! Exit status 1
2019-10-10T20:55:03.458451+00:00 app[web.1]: npm ERR!
2019-10-10T20:55:03.45864+00:00 app[web.1]: npm ERR! Failed at the mern#1.0.0 start script.
2019-10-10T20:55:03.458836+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-10-10T20:55:03.477987+00:00 app[web.1]:
2019-10-10T20:55:03.481718+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-10-10T20:55:03.481808+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-10-10T20_55_03_460Z-debug.log
2019-10-10T20:55:03.545013+00:00 heroku[web.1]: Process exited with status 1
2019-10-10T20:55:03.590878+00:00 heroku[web.1]: State changed from starting to crashed
2019-10-10T21:05:03.51307+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=HEAD path="/" host=butterflysocial.herokuapp.com request_id=fe75c157-e88e-4ca7-b764-32d93928a0e6 fwd="217.182.175.162" dyno= connect= service= status=503 bytes= protocol=https
2019-10-10T21:06:36.454645+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=butterflysocial.herokuapp.com request_id=58559acb-45a6-4d8e-b6e0-38e757eca259 fwd="199.185.67.21" dyno= connect= service= status=503 bytes= protocol=https
2019-10-10T21:06:36.326591+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=butterflysocial.herokuapp.com request_id=95fa4af1-c658-4bfc-a56a-2604aeda2e3b fwd="18.236.7.105" dyno= connect= service= status=503 bytes= protocol=http
2019-10-10T21:06:39.322455+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=butterflysocial.herokuapp.com request_id=7b0ec73c-cfcf-428f-a2f2-a8067e621627 fwd="199.185.67.21" dyno= connect= service= status=503 bytes= protocol=https
2019-10-10T21:08:55.015408+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=butterflysocial.herokuapp.com request_id=f1f065b2-ee5c-4a6b-86e0-39a54898d9b4 fwd="89.247.167.20" dyno= connect= service= status=503 bytes= protocol=https
2019-10-10T21:08:55.447502+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=butterflysocial.herokuapp.com request_id=29cf9121-5e49-48c3-9404-9b61112d9d74 fwd="89.247.167.20" dyno= connect= service= status=503 bytes= protocol=https

how to fix heroku error while deploying an expressjs app?

I've been trying to fix a heroku api but I keep getting an error which I cant fix. The app is not even running, it goes straight to the error. It was working until I recently made an update to the api.
The error is shown as
2019-10-18T21:40:06.936984+00:00 app[web.1]: at Function.Module._load
(internal/modules/cjs/loader.js:585:3)
2019-10-18T21:40:06.936986+00:00 app[web.1]: at Module.require
(internal/modules/cjs/loader.js:692:17)
2019-10-18T21:40:06.936988+00:00 app[web.1]: at require
(internal/modules/cjs/helpers.js:25:18)
2019-10-18T21:40:06.936989+00:00 app[web.1]: at Object.<anonymous> (/app/routes/api.js:7:16)
2019-10-18T21:40:06.936991+00:00 app[web.1]: at Module._compile
(internal/modules/cjs/loader.js:778:30)
2019-10-18T21:40:06.944691+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-10-18T21:40:06.945081+00:00 app[web.1]: npm ERR! errno 1
2019-10-18T21:40:06.946204+00:00 app[web.1]: npm ERR! quickJobs-api#1.0.0 start: `node
server.js`
2019-10-18T21:40:06.946319+00:00 app[web.1]: npm ERR! Exit status 1
2019-10-18T21:40:06.946542+00:00 app[web.1]: npm ERR!
2019-10-18T21:40:06.946663+00:00 app[web.1]: npm ERR! Failed at the quickJobs-api#1.0.0 start script.
2019-10-18T21:40:06.946779+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-10-18T21:40:06.953214+00:00 app[web.1]:
2019-10-18T21:40:06.953367+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-10-18T21:40:06.953452+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-10-18T21_40_06_948Z-debug.log
2019-10-18T21:40:07.008783+00:00 heroku[web.1]: Process exited with status 1
2019-10-18T21:40:24.571093+00:00 heroku[web.1]: State changed from crashed to starting
2019-10-18T22:05:16.977483+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=quickjobsapi.herokuapp.com request_id=a50a5c3e-7152-4ce1-942f-df572188531b fwd="63.143.196.162" dyno= connect= serv
ice= status=503 bytes= protocol=https
2019-10-18T22:05:17.639126+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=quickjobsapi.herokuapp.com request_id=405f9fd7-ae38-478e-b182-7e5306ab0fa6 fwd="63.143.196.162" dyno= co
nnect= service= status=503 bytes= protocol=https
2019-10-18T22:05:48.086732+00:00 heroku[web.1]: State changed from crashed to starting
2019-10-18T22:05:50.688489+00:00 heroku[web.1]: Starting process with command `npm start`
2019-10-18T22:05:53.119843+00:00 app[web.1]:
2019-10-18T22:05:53.119869+00:00 app[web.1]: > quickJobs-api#1.0.0 start /app
2019-10-18T22:05:53.119871+00:00 app[web.1]: > node server.js
2019-10-18T22:05:53.119872+00:00 app[web.1]:
2019-10-18T22:05:54.001916+00:00 heroku[web.1]: State changed from starting to crashed
2019-10-18T22:05:53.873724+00:00 app[web.1]: internal/modules/cjs/loader.js:807
2019-10-18T22:05:53.873754+00:00 app[web.1]: return process.dlopen(module, path.toNamespacedPath(filename));
2019-10-18T22:05:53.873756+00:00 app[web.1]: ^
2019-10-18T22:05:53.873758+00:00 app[web.1]:
2019-10-18T22:05:53.873760+00:00 app[web.1]: Error: /app/node_modules/bcrypt/lib/binding/bcrypt_lib.node: invalid ELF header
2019-10-18T22:05:53.873761+00:00 app[web.1]: at Object.Module._extensions..node (internal/modules/cjs/loader.js:807:18)
2019-10-18T22:05:53.873763+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:653:32)
2019-10-18T22:05:53.873765+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
2019-10-18T22:05:53.873767+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:585:3)
2019-10-18T22:05:53.873768+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:692:17)
2019-10-18T22:05:53.873770+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:25:18)
2019-10-18T22:05:53.873771+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2019-10-18T22:05:53.873773+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:778:30)
2019-10-18T22:05:53.882321+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-10-18T22:05:53.882732+00:00 app[web.1]: npm ERR! errno 1
2019-10-18T22:05:53.883970+00:00 app[web.1]: npm ERR! quickJobs-api#1.0.0 start: `node server.js`
2019-10-18T22:05:53.884082+00:00 app[web.1]: npm ERR! Exit status 1
2019-10-18T22:05:53.884277+00:00 app[web.1]: npm ERR!
2019-10-18T22:05:53.884398+00:00 app[web.1]: npm ERR! Failed at the quickJobs-api#1.0.0 start script.
2019-10-18T22:05:53.884514+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-10-18T22:05:53.914312+00:00 app[web.1]:
2019-10-18T22:05:53.914489+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-10-18T22:05:53.914584+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-10-18T22_05_53_885Z-debug.log
2019-10-18T22:05:54.019964+00:00 heroku[web.1]: State changed from crashed to starting
2019-10-18T22:05:53.977749+00:00 heroku[web.1]: Process exited with status 1
2019-10-18T22:05:57.322980+00:00 heroku[web.1]: Starting process with command `npm start`
2019-10-18T22:06:00.008642+00:00 app[web.1]:
2019-10-18T22:06:00.008674+00:00 app[web.1]: > quickJobs-api#1.0.0 start /app
2019-10-18T22:06:00.008676+00:00 app[web.1]: > node server.js
2019-10-18T22:06:00.008678+00:00 app[web.1]:
2019-10-18T22:06:00.907169+00:00 app[web.1]: internal/modules/cjs/loader.js:807
2019-10-18T22:06:00.907208+00:00 app[web.1]: return process.dlopen(module, path.toNamespacedPath(filename));
2019-10-18T22:06:00.907211+00:00 app[web.1]: ^
2019-10-18T22:06:00.907214+00:00 app[web.1]:
2019-10-18T22:06:00.907216+00:00 app[web.1]: Error: /app/node_modules/bcrypt/lib/binding/bcrypt_lib.node: invalid ELF header
2019-10-18T22:06:00.907218+00:00 app[web.1]: at Object.Module._extensions..node (internal/modules/cjs/loader.js:807:18)
2019-10-18T22:06:00.907220+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:653:32)
2019-10-18T22:06:00.907223+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
2019-10-18T22:06:00.907225+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:585:3)
2019-10-18T22:06:00.907228+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:692:17)
2019-10-18T22:06:00.907229+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:25:18)
2019-10-18T22:06:00.907232+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2019-10-18T22:06:00.907234+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:778:30)
2019-10-18T22:06:00.907235+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
2019-10-18T22:06:00.907238+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:653:32)
2019-10-18T22:06:00.907242+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
2019-10-18T22:06:00.907244+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:585:3)
2019-10-18T22:06:00.907247+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:692:17)
2019-10-18T22:06:00.907249+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:25:18)
2019-10-18T22:06:00.907251+00:00 app[web.1]: at Object.<anonymous> (/app/routes/api.js:7:16)
2019-10-18T22:06:00.907253+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:778:30)
2019-10-18T22:06:00.925298+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-10-18T22:06:00.925759+00:00 app[web.1]: npm ERR! errno 1
2019-10-18T22:06:00.926956+00:00 app[web.1]: npm ERR! quickJobs-api#1.0.0 start: `node server.js`
2019-10-18T22:06:00.927125+00:00 app[web.1]: npm ERR! Exit status 1
2019-10-18T22:06:00.927387+00:00 app[web.1]: npm ERR!
2019-10-18T22:06:00.927644+00:00 app[web.1]: npm ERR! Failed at the quickJobs-api#1.0.0 start script.
2019-10-18T22:06:00.927832+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-10-18T22:06:00.942491+00:00 app[web.1]:
2019-10-18T22:06:00.942496+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-10-18T22:06:00.942498+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-10-18T22_06_00_929Z-debug.log
2019-10-18T22:06:01.013650+00:00 heroku[web.1]: State changed from starting to crashed
2019-10-18T22:06:00.991627+00:00 heroku[web.1]: Process exited with status 1
Git
2019-10-18T22:06:00.778487+00:00 heroku[web.1]: State changed from starting to up
2019-10-18T22:06:01.574620+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=quickjobsapi.herokuapp.com request_id=e500ac9e-cc2f-4cde-9f91-8424f36c57f2 fwd="63.143.196.162" dyno= connect= serv
ice= status=503 bytes= protocol=https
2019-10-18T22:06:02.282334+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=quickjobsapi.herokuapp.com request_id=38013505-dfbc-4e8a-90e4-e55077f9b467 fwd="63.143.196.162" dyno= co
nnect= service= status=503 bytes= protocol=https
My server.js file has
const express = require('express')
const bodyParser = require('body-parser')
const cors = require('cors')
const app = express()
app.use(cors())
//const PORT = process.env.PORT || 3000;
app.listen(process.env.PORT || 3000,function(){
console.log('server has been started')
})
app.use(bodyParser.json({limit: "500mb"}));
app.use(bodyParser.urlencoded({limit: "500mb", extended: true, parameterLimit:50000}));
app.use('/api',require('./routes/api'))
The other files are just the api and the schema for mongodb.
Please help
I see that there is a bcrypt related error. Are you using different Node.js version on your local dev and your prod? If yes then try to ignore the package manager lock file yarn.lock or package-lock.json.
lock file usually "hold" version specific dependency, in some case package with native dependency like bcrypt can cause some issue.

heroku logs sh: 1: concurrently: not found

2017-10-08T20:06:11.093118+00:00 heroku[web.1]: Starting process with command `npm start`
2017-10-08T20:06:15.431068+00:00 app[web.1]:
2017-10-08T20:06:15.431083+00:00 app[web.1]: > shopping-cart-app#0.1.0 start /app
2017-10-08T20:06:15.431084+00:00 app[web.1]: > concurrently "npm run server" "npm run client"
2017-10-08T20:06:15.439379+00:00 app[web.1]: sh: 1: concurrently: not found
2017-10-08T20:06:15.446591+00:00 app[web.1]: npm ERR! file sh
2017-10-08T20:06:15.431085+00:00 app[web.1]:
2017-10-08T20:06:15.447135+00:00 app[web.1]: npm ERR! errno ENOENT
2017-10-08T20:06:15.447368+00:00 app[web.1]: npm ERR! syscall spawn
2017-10-08T20:06:15.446893+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2017-10-08T20:06:15.453425+00:00 app[web.1]: npm ERR!
2017-10-08T20:06:15.448865+00:00 app[web.1]: npm ERR! shopping-cart-app#0.1.0 start: `concurrently "npm run server" "npm run client"`
2017-10-08T20:06:15.453636+00:00 app[web.1]: npm ERR! Failed at the shopping-cart-app#0.1.0 start script.
2017-10-08T20:06:15.464269+00:00 app[web.1]:
2017-10-08T20:06:15.453115+00:00 app[web.1]: npm ERR! spawn ENOENT
2017-10-08T20:06:15.453824+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2017-10-08T20:06:15.469282+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2017-10-08T20:06:15.469426+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2017-10-08T20_06_15_456Z-debug.log
2017-10-08T20:06:15.625015+00:00 heroku[web.1]: State changed from starting to crashed
2017-10-08T20:06:15.627831+00:00 heroku[web.1]: State changed from crashed to starting
2017-10-08T20:06:15.609086+00:00 heroku[web.1]: Process exited with status 1
2017-10-08T20:06:20.543684+00:00 heroku[web.1]: Starting process with command `npm start`
2017-10-08T20:06:23.048216+00:00 heroku[web.1]: Process exited with status 1
2017-10-08T20:06:22.944636+00:00 app[web.1]: > shopping-cart-app#0.1.0 start /app
2017-10-08T20:06:22.944621+00:00 app[web.1]:
2017-10-08T20:06:22.944637+00:00 app[web.1]: > concurrently "npm run server" "npm run client"
2017-10-08T20:06:22.944637+00:00 app[web.1]:
2017-10-08T20:06:22.951908+00:00 app[web.1]: sh: 1: concurrently: not found
2017-10-08T20:06:22.957587+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2017-10-08T20:06:22.957261+00:00 app[web.1]: npm ERR! file sh
2017-10-08T20:06:22.957843+00:00 app[web.1]: npm ERR! errno ENOENT
2017-10-08T20:06:22.959735+00:00 app[web.1]: npm ERR! spawn ENOENT
2017-10-08T20:06:22.958098+00:00 app[web.1]: npm ERR! syscall spawn
2017-10-08T20:06:22.959544+00:00 app[web.1]: npm ERR! shopping-cart-app#0.1.0 start: `concurrently "npm run server" "npm run client"`
2017-10-08T20:06:22.960008+00:00 app[web.1]: npm ERR!
2017-10-08T20:06:22.960225+00:00 app[web.1]: npm ERR! Failed at the shopping-cart-app#0.1.0 start script.
2017-10-08T20:06:22.966218+00:00 app[web.1]:
2017-10-08T20:06:22.966570+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2017-10-08T20_06_22_962Z-debug.log
2017-10-08T20:06:22.960452+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2017-10-08T20:06:22.966432+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2017-10-08T20:06:23.060706+00:00 heroku[web.1]: State changed from starting to crashed
I can run the app on my localhost but it crashes in heroku. It seems that I am having issues with the concurrently package while starting app in heroku. I used npm i -S concurrently but it downloads under dev dependancies. Is there some type of setting in Heroku that I need to change to use concurrently?
apt-get install nodejs-legacy
npm install -g tsc
npm install -g concurrently
npm install -g typescript
try this command

Categories

Resources