how to fix heroku error while deploying an expressjs app? - javascript

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.

Related

Method Not Allowed heroku deploy

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

I can not deploy my nodejs based app to Heroku

I have created an app that upload some files and than send me object like that
{"name":"MEHMET SAYIN CV - 10_2021.pdf","type":"application/pdf","size":99771}
I used multer to handle uploading files. When I upload it to heroku I failed.I want to share the logs related.
2021-10-15T15:51:02.457409+00:00 app[api]: Deploy 6e984f86 by user sayinmehmet47#gmail.com
2021-10-15T15:51:02.457409+00:00 app[api]: Release v11 created by user sayinmehmet47#gmail.com
2021-10-15T15:51:03.599539+00:00 heroku[web.1]: State changed from crashed to starting
2021-10-15T15:51:05.000000+00:00 app[api]: Build succeeded
2021-10-15T15:51:05.698098+00:00 heroku[web.1]: Starting process with command `npm start`
2021-10-15T15:51:06.737506+00:00 app[web.1]:
2021-10-15T15:51:06.737526+00:00 app[web.1]: > file_metadata#0.0.1 start /app
2021-10-15T15:51:06.737527+00:00 app[web.1]: > node server.js
2021-10-15T15:51:06.737527+00:00 app[web.1]:
2021-10-15T15:51:07.036041+00:00 app[web.1]: connected
2021-10-15T15:51:07.068246+00:00 app[web.1]: /app/node_modules/mkdirp/index.js:91
2021-10-15T15:51:07.068247+00:00 app[web.1]: throw err0;
2021-10-15T15:51:07.068248+00:00 app[web.1]: ^
2021-10-15T15:51:07.068248+00:00 app[web.1]:
2021-10-15T15:51:07.068248+00:00 app[web.1]: Error: EROFS: read-only file system, mkdir '/public'
2021-10-15T15:51:07.068249+00:00 app[web.1]: at Object.mkdirSync (fs.js:1013:3)
2021-10-15T15:51:07.068249+00:00 app[web.1]: at sync (/app/node_modules/mkdirp/index.js:72:13)
2021-10-15T15:51:07.068250+00:00 app[web.1]: at sync (/app/node_modules/mkdirp/index.js:78:24)
2021-10-15T15:51:07.068250+00:00 app[web.1]: at Function.sync (/app/node_modules/mkdirp/index.js:78:24)
2021-10-15T15:51:07.068250+00:00 app[web.1]: at new DiskStorage (/app/node_modules/multer/storage/disk.js:21:12)
2021-10-15T15:51:07.068251+00:00 app[web.1]: at module.exports (/app/node_modules/multer/storage/disk.js:65:10)
2021-10-15T15:51:07.068251+00:00 app[web.1]: at new Multer (/app/node_modules/multer/index.js:15:20)
2021-10-15T15:51:07.068252+00:00 app[web.1]: at multer (/app/node_modules/multer/index.js:95:12)
2021-10-15T15:51:07.068252+00:00 app[web.1]: at Object.<anonymous> (/app/api/files.js:4:16)
2021-10-15T15:51:07.068252+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1085:14) {
2021-10-15T15:51:07.068253+00:00 app[web.1]: errno: -30,
2021-10-15T15:51:07.068253+00:00 app[web.1]: syscall: 'mkdir',
2021-10-15T15:51:07.068253+00:00 app[web.1]: code: 'EROFS',
2021-10-15T15:51:07.068254+00:00 app[web.1]: path: '/public'
2021-10-15T15:51:07.068254+00:00 app[web.1]: }
2021-10-15T15:51:07.079497+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-10-15T15:51:07.079732+00:00 app[web.1]: npm ERR! errno 1
2021-10-15T15:51:07.083831+00:00 app[web.1]: npm ERR! file_metadata#0.0.1 start: `node server.js`
2021-10-15T15:51:07.083871+00:00 app[web.1]: npm ERR! Exit status 1
2021-10-15T15:51:07.083924+00:00 app[web.1]: npm ERR!
2021-10-15T15:51:07.083988+00:00 app[web.1]: npm ERR! Failed at the file_metadata#0.0.1 start script.
2021-10-15T15:51:07.083989+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-10-15T15:51:07.089384+00:00 app[web.1]:
2021-10-15T15:51:07.089446+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-10-15T15:51:07.089472+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-10-15T15_51_07_084Z-debug.log
2021-10-15T15:51:07.196350+00:00 heroku[web.1]: Process exited with status 1
2021-10-15T15:51:07.347289+00:00 heroku[web.1]: State changed from starting to crashed
2021-10-15T15:51:12.784398+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=filedownl12.herokuapp.com request_id=fe098106-1546-4b7c-9b8c-fefe790dfae7 fwd="77.49.34.161" dyno= connect= service= status=503 bytes= protocol=https
2021-10-15T15:51:13.747221+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=filedownl12.herokuapp.com request_id=8173d073-97c1-45e1-afab-c3b2da397e12 fwd="77.49.34.161" dyno= connect= service= status=503 bytes= protocol=https
2021-10-15T16:04:45.000000+00:00 app[api]: Build started by user sayinmehmet47#gmail.com
2021-10-15T16:05:21.465576+00:00 app[api]: Deploy 1f51e389 by user sayinmehmet47#gmail.com
2021-10-15T16:05:21.465576+00:00 app[api]: Release v12 created by user sayinmehmet47#gmail.com
2021-10-15T16:05:23.278268+00:00 heroku[web.1]: State changed from crashed to starting
2021-10-15T16:05:24.000000+00:00 app[api]: Build succeeded
2021-10-15T16:05:26.141343+00:00 heroku[web.1]: Starting process with command `node ./server.js`
2021-10-15T16:05:27.754473+00:00 app[web.1]: connected
2021-10-15T16:05:27.819924+00:00 app[web.1]: /app/node_modules/mkdirp/index.js:91
2021-10-15T16:05:27.819926+00:00 app[web.1]: throw err0;
2021-10-15T16:05:27.819926+00:00 app[web.1]: ^
2021-10-15T16:05:27.819927+00:00 app[web.1]:
2021-10-15T16:05:27.819927+00:00 app[web.1]: Error: EROFS: read-only file system, mkdir '/public'
2021-10-15T16:05:27.819928+00:00 app[web.1]: at Object.mkdirSync (fs.js:1013:3)
2021-10-15T16:05:27.819928+00:00 app[web.1]: at sync (/app/node_modules/mkdirp/index.js:72:13)
2021-10-15T16:05:27.819928+00:00 app[web.1]: at sync (/app/node_modules/mkdirp/index.js:78:24)
2021-10-15T16:05:27.819929+00:00 app[web.1]: at Function.sync (/app/node_modules/mkdirp/index.js:78:24)
2021-10-15T16:05:27.819929+00:00 app[web.1]: at new DiskStorage (/app/node_modules/multer/storage/disk.js:21:12)
2021-10-15T16:05:27.819930+00:00 app[web.1]: at module.exports (/app/node_modules/multer/storage/disk.js:65:10)
2021-10-15T16:05:27.819930+00:00 app[web.1]: at new Multer (/app/node_modules/multer/index.js:15:20)
2021-10-15T16:05:27.819931+00:00 app[web.1]: at multer (/app/node_modules/multer/index.js:95:12)
2021-10-15T16:05:27.819931+00:00 app[web.1]: at Object.<anonymous> (/app/api/files.js:4:16)
2021-10-15T16:05:27.819931+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1085:14) {
2021-10-15T16:05:27.819932+00:00 app[web.1]: errno: -30,
2021-10-15T16:05:27.819932+00:00 app[web.1]: syscall: 'mkdir',
2021-10-15T16:05:27.819932+00:00 app[web.1]: code: 'EROFS',
2021-10-15T16:05:27.819933+00:00 app[web.1]: path: '/public'
2021-10-15T16:05:27.819933+00:00 app[web.1]: }
2021-10-15T16:05:27.968565+00:00 heroku[web.1]: Process exited with status 1
2021-10-15T16:05:28.098649+00:00 heroku[web.1]: State changed from starting to crashed
2021-10-15T16:05:28.136896+00:00 heroku[web.1]: State changed from crashed to starting
2021-10-15T16:05:30.375434+00:00 heroku[web.1]: Starting process with command `node ./server.js`
2021-10-15T16:05:32.063799+00:00 app[web.1]: connected
2021-10-15T16:05:32.108031+00:00 app[web.1]: /app/node_modules/mkdirp/index.js:91
2021-10-15T16:05:32.108033+00:00 app[web.1]: throw err0;
2021-10-15T16:05:32.108033+00:00 app[web.1]: ^
2021-10-15T16:05:32.108033+00:00 app[web.1]:
2021-10-15T16:05:32.108034+00:00 app[web.1]: Error: EROFS: read-only file system, mkdir '/public'
2021-10-15T16:05:32.108034+00:00 app[web.1]: at Object.mkdirSync (fs.js:1013:3)
2021-10-15T16:05:32.108035+00:00 app[web.1]: at sync (/app/node_modules/mkdirp/index.js:72:13)
2021-10-15T16:05:32.108035+00:00 app[web.1]: at sync (/app/node_modules/mkdirp/index.js:78:24)
2021-10-15T16:05:32.108035+00:00 app[web.1]: at Function.sync (/app/node_modules/mkdirp/index.js:78:24)
2021-10-15T16:05:32.108036+00:00 app[web.1]: at new DiskStorage (/app/node_modules/multer/storage/disk.js:21:12)
2021-10-15T16:05:32.108036+00:00 app[web.1]: at module.exports (/app/node_modules/multer/storage/disk.js:65:10)
2021-10-15T16:05:32.108036+00:00 app[web.1]: at new Multer (/app/node_modules/multer/index.js:15:20)
2021-10-15T16:05:32.108037+00:00 app[web.1]: at multer (/app/node_modules/multer/index.js:95:12)
2021-10-15T16:05:32.108037+00:00 app[web.1]: at Object.<anonymous> (/app/api/files.js:4:16)
2021-10-15T16:05:32.108037+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1085:14) {
2021-10-15T16:05:32.108038+00:00 app[web.1]: errno: -30,
2021-10-15T16:05:32.108041+00:00 app[web.1]: syscall: 'mkdir',
2021-10-15T16:05:32.108041+00:00 app[web.1]: code: 'EROFS',
2021-10-15T16:05:32.108041+00:00 app[web.1]: path: '/public'
2021-10-15T16:05:32.108041+00:00 app[web.1]: }
2021-10-15T16:05:32.267952+00:00 heroku[web.1]: Process exited with status 1
2021-10-15T16:05:32.695933+00:00 heroku[web.1]: State changed from starting to crashed
2021-10-15T16:05:33.707024+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=filedownl12.herokuapp.com request_id=c9fdfd08-1b36-450e-a4de-fb65785677a4 fwd="77.49.34.161" dyno= connect= service= status=503 bytes= protocol=https
2021-10-15T16:05:34.925481+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=filedownl12.herokuapp.com request_id=3aca34c2-47e0-4f99-9884-13b91ed25f99 fwd="77.49.34.161" dyno= connect= service= status=503 bytes= protocol=https
2021-10-15T16:13:09.486503+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=filedownl12.herokuapp.com request_id=e41ba396-2172-4804-a573-0fafc1a2c47b fwd="77.49.34.161" dyno= connect= service= status=503 bytes= protocol=https
2021-10-15T16:13:10.694600+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=filedownl12.herokuapp.com request_id=4ef46b32-012c-43b2-8342-0a0637d5a29b fwd="77.49.34.161" dyno= connect= service= status=503 bytes= protocol=https
I also tried to be sure if I set the variables for MONGO_URI,I also set them. Also I created a procfile and write inside it
web: node ./server.js
But it didnt works. I lastly want to share my directories picture.

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

sanitize-html npm module not working on Heroku deploy

I installed the sanitize-html npm library on my node.js and express application. I am working on Cloud9 IDE, which allows a preview of your site. Sanitize-html does its job and works perfectly in the preview, but when I attempt to deploy my app to the web with heroku, I get an application error. I know the error is due to sanitize-html, because when I remove it, and deploy my app, it all works fine. This is my heroku log:
2016-02-22T16:35:13.344238+00:00 heroku[web.1]: State changed from crashed to starting
2016-02-22T16:35:14.684861+00:00 heroku[web.1]: Starting process with command `npm start`
2016-02-22T16:35:06.369072+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sharecookie.herokuapp.com request_id=b37b7b05-5b82-4668-80fb-5714a0ddbc61 fwd="207.74.9.2" dyno= connect= service= status=503 bytes=
2016-02-22T16:35:15.916200+00:00 app[web.1]:
2016-02-22T16:35:15.916220+00:00 app[web.1]: > node bin/www
2016-02-22T16:35:15.916221+00:00 app[web.1]:
2016-02-22T16:35:16.489614+00:00 app[web.1]: npm ERR! Linux 3.13.0-77-generic
2016-02-22T16:35:16.472662+00:00 app[web.1]: module.js:341
2016-02-22T16:35:16.472665+00:00 app[web.1]: throw err;
2016-02-22T16:35:16.489936+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-02-22T16:35:16.490118+00:00 app[web.1]: npm ERR! node v5.6.0
2016-02-22T16:35:16.472666+00:00 app[web.1]: ^
2016-02-22T16:35:16.472667+00:00 app[web.1]:
2016-02-22T16:35:16.472668+00:00 app[web.1]: Error: Cannot find module 'sanitize-html'
2016-02-22T16:35:16.472670+00:00 app[web.1]: at Module.require (module.js:367:17)
2016-02-22T16:35:16.472670+00:00 app[web.1]: at require (internal/module.js:16:19)
2016-02-22T16:35:16.472671+00:00 app[web.1]: at Object.<anonymous> (/app/routes/index.js:11:20)
2016-02-22T16:35:16.472671+00:00 app[web.1]: at Module._compile (module.js:413:34)
2016-02-22T16:35:16.472672+00:00 app[web.1]: at Object.Module._extensions..js (module.js:422:10)
2016-02-22T16:35:16.472676+00:00 app[web.1]: at Object.<anonymous> (/app/app.js:14:14)
2016-02-22T16:35:16.472677+00:00 app[web.1]: at Module._compile (module.js:413:34)
Blah blah blah, it's saying it cannot find the 'sanitize-html' module, even though it's installed in node_modules, and referenced in my index.js as var sanitizeHtml = require('sanitize-html'); This is really frustrating. Any help is appreciated :)
I found an answer browsing other questions. I needed to use git add -A --force to completely re-add all my modules, and that worked. Kind of odd

Heroku Node.js App Crashing | module.js:340 error

My Heroku app is crashing, I believe before it even gets to the Procfile. I am experiencing the same problem as here:
Cannot execute Node.js app on Heroku successfully (crashes each time)
The only difference is that my package.json file has Express included
package.json
{
"name": "weathersocket",
"version": "0.0.1",
"description": "text based weather",
"main": "weather.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/agreen757/weathersocket.github.io"
},
"keywords": [
"demo",
"heroku",
"weather"
],
"author": "Adrian Green",
"license": "MIT",
"bugs": {
"url": "https://github.com/agreen757/weathersocket.github.io/issues"
},
"homepage": "https://github.com/agreen757/weathersocket.github.io",
"dependencies": {
"body-parser": "^1.6.6",
"consolidate": "^0.10.0",
"cookie-parser": "^1.3.2",
"express": "^4.8.6",
"mongodb": "^1.4.9",
"socket.io": "^1.0.6",
"swig": "^1.4.2"
}
}
I have tried to the foreman utility locally and everything works properly.
My main weather.js file contains:
server.listen(4000);
console.log("Express server started on 4000");
Any help would be greatly appreciated.
Update: Heroku logs
`2014-08-28T14:29:14.866955+00:00 heroku[web.1]: State changed from crashed to starting
2014-08-28T14:29:18.414238+00:00 app[web.1]:
2014-08-28T14:29:18.414259+00:00 app[web.1]: > node weather.js
2014-08-28T14:29:18.414257+00:00 app[web.1]: > weathersocket#10.3.1 start /app
2014-08-28T14:29:18.414260+00:00 app[web.1]:
2014-08-28T14:29:18.755300+00:00 app[web.1]:
2014-08-28T14:29:18.755380+00:00 app[web.1]: module.js:340
2014-08-28T14:29:18.755637+00:00 app[web.1]: throw err;
2014-08-28T14:29:18.755646+00:00 app[web.1]: ^
2014-08-28T14:29:18.757013+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:338:15)
2014-08-28T14:29:18.757015+00:00 app[web.1]: at Function.Module._load (module.js:280:25)
2014-08-28T14:29:18.757011+00:00 app[web.1]: Error: Cannot find module 'socket.io'
2014-08-28T14:29:18.757016+00:00 app[web.1]: at Module.require (module.js:364:17)
2014-08-28T14:29:18.757017+00:00 app[web.1]: at require (module.js:380:17)
2014-08-28T14:29:18.757019+00:00 app[web.1]: at Object.<anonymous> (/app/weather.js:6:10)
2014-08-28T14:29:18.757020+00:00 app[web.1]: at Module._compile (module.js:456:26)
2014-08-28T14:29:18.757022+00:00 app[web.1]: at Object.Module._extensions..js (module.js:474:10)
2014-08-28T14:29:18.757023+00:00 app[web.1]: at Module.load (module.js:356:32)
2014-08-28T14:29:18.757025+00:00 app[web.1]: at Function.Module._load (module.js:312:12)
2014-08-28T14:29:18.757026+00:00 app[web.1]: at Function.Module.runMain (module.js:497:10)
2014-08-28T14:29:18.765774+00:00 app[web.1]:
2014-08-28T14:29:18.770873+00:00 app[web.1]: npm ERR!
2014-08-28T14:29:18.770460+00:00 app[web.1]: npm ERR! weathersocket#10.3.1 start: `node weather.js`
2014-08-28T14:29:18.770720+00:00 app[web.1]: npm ERR! Exit status 8
2014-08-28T14:29:18.770945+00:00 app[web.1]: npm ERR! Failed at the weathersocket#10.3.1 start script.
2014-08-28T14:29:18.771539+00:00 app[web.1]: npm ERR! This is most likely a problem with the weathersocket package,
2014-08-28T14:29:18.771696+00:00 app[web.1]: npm ERR! not with npm itself.
2014-08-28T14:29:18.771844+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2014-08-28T14:29:18.772002+00:00 app[web.1]: npm ERR! node weather.js
2014-08-28T14:29:18.772821+00:00 app[web.1]: npm ERR! System Linux 3.8.11-ec2
2014-08-28T14:29:18.773778+00:00 app[web.1]: npm ERR! npm -v 1.4.23
2014-08-28T14:29:18.772468+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2014-08-28T14:29:18.773030+00:00 app[web.1]: npm ERR! command "/app/vendor/node/bin/node" "/app/vendor/node/bin/npm" "start"
2014-08-28T14:29:18.773608+00:00 app[web.1]: npm ERR! node -v v0.10.31
2014-08-28T14:29:18.772297+00:00 app[web.1]: npm ERR! npm owner ls weathersocket
2014-08-28T14:29:18.775689+00:00 app[web.1]: npm ERR! Additional logging details can be found in:
2014-08-28T14:29:18.772151+00:00 app[web.1]: npm ERR! You can get their info via:
2014-08-28T14:29:18.773383+00:00 app[web.1]: npm ERR! cwd /app
2014-08-28T14:29:18.775539+00:00 app[web.1]: npm ERR!
2014-08-28T14:29:18.773965+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2014-08-28T14:29:18.776097+00:00 app[web.1]: npm ERR! not ok code 0
2014-08-28T14:29:18.775840+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2014-08-28T14:29:19.793237+00:00 heroku[web.1]: State changed from starting to crashed
2014-08-28T14:29:16.891824+00:00 heroku[web.1]: Starting process with command `npm start`
2014-08-28T14:29:19.781258+00:00 heroku[web.1]: Process exited with status 1`
I see a few things you could improve, as fakemeta states in his commentary, you should be using the heroku variables to listen port and to have the IP.
You should also include in your package.json:
"scripts": {
"start": "node server.js"
},
"main": "server.js"
So the system know what to do and where is your express server
//-------------EDIT----------------------------//
Cant you try to deploy without node_modules folder?, once you push heroku will install those packages, i mean at least just for debugging purposes

Categories

Resources