How do i change the port an heroku server runs on? - node.js

I just configured my server to support https with an SSL certificate and i'm getting this weird error in my heroku logs.
Error: listen EADDRINUSE: address already in use :::23736
2019-07-02T20:29:56.810153+00:00 app[web.1]: Error: listen EADDRINUSE: address already in use :::23736
2019-07-02T20:29:56.810155+00:00 app[web.1]: at Server.setupListenHandle [as _listen2] (net.js:1279:14)
2019-07-02T20:29:56.810157+00:00 app[web.1]: at listenInCluster (net.js:1327:12)
2019-07-02T20:29:56.810160+00:00 app[web.1]: at Server.listen (net.js:1414:7)
2019-07-02T20:29:56.810162+00:00 app[web.1]: at Object.<anonymous> (/app/server.js:103:12)
2019-07-02T20:29:56.810163+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30)
2019-07-02T20:29:56.810166+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
2019-07-02T20:29:56.810168+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:653:32)
2019-07-02T20:29:56.810170+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
2019-07-02T20:29:56.810171+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:585:3)
2019-07-02T20:29:56.810174+00:00 app[web.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
2019-07-02T20:29:56.810176+00:00 app[web.1]: Emitted 'error' event at:
2019-07-02T20:29:56.810178+00:00 app[web.1]: at emitErrorNT (net.js:1306:8)
2019-07-02T20:29:56.810180+00:00 app[web.1]: at process._tickCallback (internal/process/next_tick.js:63:19)
2019-07-02T20:29:56.810182+00:00 app[web.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
2019-07-02T20:29:56.810184+00:00 app[web.1]: at startup (internal/bootstrap/node.js:283:19)
2019-07-02T20:29:56.810186+00:00 app[web.1]: at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
2019-07-02T20:29:56.819819+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-07-02T20:29:56.820414+00:00 app[web.1]: npm ERR! errno 1
2019-07-02T20:29:56.822143+00:00 app[web.1]: npm ERR! gbahdeyboh#1.0.0 start: `node server.js`
2019-07-02T20:29:56.822348+00:00 app[web.1]: npm ERR! Exit status 1
2019-07-02T20:29:56.822671+00:00 app[web.1]: npm ERR!
2019-07-02T20:29:56.822893+00:00 app[web.1]: npm ERR! Failed at the gbahdeyboh#1.0.0 start script.
2019-07-02T20:29:56.823098+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-07-02T20:29:56.829332+00:00 app[web.1]:
2019-07-02T20:29:56.829583+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-07-02T20:29:56.829738+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-07-02T20_29_56_825Z-debug.log
2019-07-02T20:29:56.895827+00:00 heroku[web.1]: State changed from starting to crashed
2019-07-02T20:29:56.902570+00:00 heroku[web.1]: State changed from crashed to starting
2019-07-02T20:29:56.878861+00:00 heroku[web.1]: Process exited with status 1
Is there a way to change what port heroku servers listen on?

Related

Heroku[router]: at=error code=H10 desc=”App crashed“ method=GET path=/favicon.ico”

I have a simple MERN APP, that works fine on localhost, but when I deploy it to Heroku I see a page with this error:
Application error An error occurred in the application and your page
could not be served. If you are the application owner, check your logs
for details. You can do this from the Heroku CLI with the command
heroku logs --tail
And the console is showing this: Failed to load resource: the server responded with a status of 503 (Service Unavailable)
An Image of that has also been attached!
And Heroku logs are also given below...
I'm new to MERN Dev, so can't really figure out what's the issue really is and Heroku logs are also not much of help, please help me!
Warning: heroku update available from 7.59.0 to 7.59.2.
2022-01-05T13:28:24.783142+00:00 app[web.1]:
2022-01-05T13:28:25.124488+00:00 app[web.1]: /app/node_modules/whatwg-url/lib/encoding.js:2
2022-01-05T13:28:25.124505+00:00 app[web.1]: const utf8Encoder = new TextEncoder();
2022-01-05T13:28:25.124505+00:00 app[web.1]: ^
2022-01-05T13:28:25.124506+00:00 app[web.1]:
2022-01-05T13:28:25.124507+00:00 app[web.1]: ReferenceError: TextEncoder is not defined
2022-01-05T13:28:25.124507+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/whatwg-url/lib/encoding.js:2:21)
2022-01-05T13:28:25.124508+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30)
2022-01-05T13:28:25.124508+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
2022-01-05T13:28:25.124509+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:653:32)
2022-01-05T13:28:25.124509+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
2022-01-05T13:28:25.124509+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:585:3)
2022-01-05T13:28:25.124509+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:690:17)
2022-01-05T13:28:25.124510+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:25:18)
2022-01-05T13:28:25.124511+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/whatwg-url/lib/url-state-machine.js:5:34)
2022-01-05T13:28:25.124511+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30)
2022-01-05T13:28:25.129285+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2022-01-05T13:28:25.129543+00:00 app[web.1]: npm ERR! errno 1
2022-01-05T13:28:25.130631+00:00 app[web.1]: npm ERR! server#1.0.0 start: `node server.js`
2022-01-05T13:28:25.130632+00:00 app[web.1]: npm ERR! Exit status 1
2022-01-05T13:28:25.130787+00:00 app[web.1]: npm ERR!
2022-01-05T13:28:25.130867+00:00 app[web.1]: npm ERR! Failed at the server#1.0.0 start script.
2022-01-05T13:28:25.130870+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2022-01-05T13:28:25.135681+00:00 app[web.1]:
2022-01-05T13:28:25.135782+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2022-01-05T13:28:25.135828+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2022-01-05T13_28_25_131Z-debug.log
2022-01-05T13:28:25.273876+00:00 heroku[web.1]: Process exited with status 1
2022-01-05T13:28:25.334794+00:00 heroku[web.1]: State changed from starting to crashed
2022-01-05T14:58:18.000000+00:00 app[api]: Build started by user sauviksood#gmail.com
2022-01-05T14:59:12.408461+00:00 app[api]: Deploy 278ece53 by user sauviksood#gmail.com
2022-01-05T14:59:12.408461+00:00 app[api]: Release v6 created by user sauviksood#gmail.com
2022-01-05T14:59:13.000000+00:00 app[api]: Build succeeded
2022-01-05T14:59:13.762177+00:00 heroku[web.1]: State changed from crashed to starting
2022-01-05T14:59:19.381206+00:00 heroku[web.1]: Starting process with command `npm start`
2022-01-05T14:59:21.141420+00:00 app[web.1]:
2022-01-05T14:59:21.141434+00:00 app[web.1]: > server#1.0.0 start /app
2022-01-05T14:59:21.141435+00:00 app[web.1]: > node server.js
2022-01-05T14:59:21.141435+00:00 app[web.1]:
2022-01-05T14:59:21.365509+00:00 app[web.1]: /app/node_modules/whatwg-url/lib/encoding.js:2
2022-01-05T14:59:21.365511+00:00 app[web.1]: const utf8Encoder = new TextEncoder();
2022-01-05T14:59:21.365511+00:00 app[web.1]: ^
2022-01-05T14:59:21.365512+00:00 app[web.1]:
2022-01-05T14:59:21.365512+00:00 app[web.1]: ReferenceError: TextEncoder is not defined
2022-01-05T14:59:21.365512+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/whatwg-url/lib/encoding.js:2:21)
2022-01-05T14:59:21.365513+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30)
2022-01-05T14:59:21.365513+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
2022-01-05T14:59:21.365514+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:653:32)
2022-01-05T14:59:21.365514+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
2022-01-05T14:59:21.365514+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:585:3)
2022-01-05T14:59:21.365514+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:690:17)
2022-01-05T14:59:21.365515+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:25:18)
2022-01-05T14:59:21.365516+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/whatwg-url/lib/url-state-machine.js:5:34)
2022-01-05T14:59:21.365518+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30)
2022-01-05T14:59:21.370906+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2022-01-05T14:59:21.371167+00:00 app[web.1]: npm ERR! errno 1
2022-01-05T14:59:21.371985+00:00 app[web.1]: npm ERR! server#1.0.0 start: `node server.js`
2022-01-05T14:59:21.372041+00:00 app[web.1]: npm ERR! Exit status 1
2022-01-05T14:59:21.372158+00:00 app[web.1]: npm ERR!
2022-01-05T14:59:21.372219+00:00 app[web.1]: npm ERR! Failed at the server#1.0.0 start script.
2022-01-05T14:59:21.372273+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2022-01-05T14:59:21.375303+00:00 app[web.1]:
2022-01-05T14:59:21.375391+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2022-01-05T14:59:21.375436+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2022-01-05T14_59_21_373Z-debug.log
2022-01-05T14:59:21.529167+00:00 heroku[web.1]: Process exited with status 1
2022-01-05T14:59:21.611061+00:00 heroku[web.1]: State changed from starting to crashed
2022-01-05T14:59:21.635160+00:00 heroku[web.1]: State changed from crashed to starting
2022-01-05T14:59:28.249204+00:00 heroku[web.1]: Starting process with command `npm start`
2022-01-05T14:59:29.604172+00:00 app[web.1]:
2022-01-05T14:59:29.604192+00:00 app[web.1]: > server#1.0.0 start /app
2022-01-05T14:59:29.604193+00:00 app[web.1]: > node server.js
2022-01-05T14:59:29.604193+00:00 app[web.1]:
2022-01-05T14:59:29.864349+00:00 app[web.1]: /app/node_modules/whatwg-url/lib/encoding.js:2
2022-01-05T14:59:29.864368+00:00 app[web.1]: const utf8Encoder = new TextEncoder();
2022-01-05T14:59:29.864369+00:00 app[web.1]: ^
2022-01-05T14:59:29.864369+00:00 app[web.1]:
2022-01-05T14:59:29.864370+00:00 app[web.1]: ReferenceError: TextEncoder is not defined
2022-01-05T14:59:29.864370+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/whatwg-url/lib/encoding.js:2:21)
2022-01-05T14:59:29.864370+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30)
2022-01-05T14:59:29.864371+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
2022-01-05T14:59:29.864371+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:653:32)
2022-01-05T14:59:29.864371+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
2022-01-05T14:59:29.864371+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:585:3)
2022-01-05T14:59:29.864372+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:690:17)
2022-01-05T14:59:29.864372+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:25:18)
2022-01-05T14:59:29.864373+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/whatwg-url/lib/url-state-machine.js:5:34)
2022-01-05T14:59:29.864373+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30)
2022-01-05T14:59:29.870542+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2022-01-05T14:59:29.870848+00:00 app[web.1]: npm ERR! errno 1
2022-01-05T14:59:29.871728+00:00 app[web.1]: npm ERR! server#1.0.0 start: `node server.js`
2022-01-05T14:59:29.871798+00:00 app[web.1]: npm ERR! Exit status 1
2022-01-05T14:59:29.871921+00:00 app[web.1]: npm ERR!
2022-01-05T14:59:29.871982+00:00 app[web.1]: npm ERR! Failed at the server#1.0.0 start script.
2022-01-05T14:59:29.872035+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2022-01-05T14:59:29.875332+00:00 app[web.1]:
2022-01-05T14:59:29.875429+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2022-01-05T14:59:29.875474+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2022-01-05T14_59_29_872Z-debug.log
2022-01-05T14:59:30.008365+00:00 heroku[web.1]: Process exited with status 1
2022-01-05T14:59:30.061904+00:00 heroku[web.1]: State changed from starting to crashed
2022-01-05T14:59:31.128259+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=movie-watchlist-mern.herokuapp.com request_id=f86c07e6-1ee6-42c9-88be-3c7d1a60e53d fwd="103.155.240.47" dyno= connect= service= status=503 bytes= protocol=https
2022-01-05T14:59:34.147698+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=movie-watchlist-mern.herokuapp.com request_id=c0ccd4db-98b3-40fa-90c1-ad33cfe5a065 fwd="103.155.240.47" dyno= connect= service= status=503 bytes= protocol=https
Your heroku setup needs an update to the version 7.59.2
For this:
You have to run npm command if npm used for the heroku cli installation in you device,
npm:
npm upgrade -g heroku
Or if heroku was installed with yarn then,
yarn:
yarn global upgrade heroku
This may help your issue

successful build in heroku but Application error

i'v noticed that this question been asked before but none of them covers my problem.
anyway i'v deployed a node.js project to heroku using the Heroku CLI , and it works 100%.
later on I linked it to GitHub and wanted to deploy it using GitHub , deploy was successful but the application giving an error.
I gitignored the node_modules , db and config just incase and that needed to be said.
I'v restarted all dynos
repo is set on private in GitHub
any ideas please ?
2021-06-12T08:01:52.352038+00:00 app[web.1]: npm ERR! Exit status 1
2021-06-12T08:01:52.352203+00:00 app[web.1]: npm ERR!
2021-06-12T08:01:52.352360+00:00 app[web.1]: npm ERR! Failed at the l6_13_04#1.0.0 start script.
2021-06-12T08:01:52.352478+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-06-12T08:01:52.363711+00:00 app[web.1]:
2021-06-12T08:01:52.363960+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-06-12T08:01:52.364068+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-06-12T08_01_52_353Z-debug.log
2021-06-12T08:01:52.467709+00:00 heroku[web.1]: Process exited with status 1
2021-06-12T08:01:52.554484+00:00 heroku[web.1]: State changed from starting to crashed
2021-06-12T08:28:17.040842+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=mapetme.herokuapp.com request_id=bac4c71c-e9a9-4df1-82d3-30049c040f7f fwd="109.253.222.209" dyno= connect= service= status=503 bytes= protocol=https
2021-06-12T08:32:34.601328+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=mapetme.herokuapp.com request_id=b28e1630-8739-44a1-8bab-50b6347b91e7 fwd="109.253.222.209" dyno= connect= service= status=503 bytes= protocol=https
2021-06-12T08:32:44.055618+00:00 heroku[web.1]: State changed from crashed to starting
2021-06-12T08:32:46.496214+00:00 heroku[web.1]: Starting process with command `npm start`
2021-06-12T08:32:48.862282+00:00 app[web.1]:
2021-06-12T08:32:48.862304+00:00 app[web.1]: > l6_13_04#1.0.0 start /app
2021-06-12T08:32:48.862305+00:00 app[web.1]: > node app
2021-06-12T08:32:48.862305+00:00 app[web.1]:
2021-06-12T08:32:49.439470+00:00 app[web.1]: internal/modules/cjs/loader.js:1122
2021-06-12T08:32:49.439537+00:00 app[web.1]: return process.dlopen(module, path.toNamespacedPath(filename));
2021-06-12T08:32:49.439539+00:00 app[web.1]: ^
2021-06-12T08:32:49.439540+00:00 app[web.1]:
2021-06-12T08:32:49.439541+00:00 app[web.1]: Error: /app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: invalid ELF header
2021-06-12T08:32:49.439542+00:00 app[web.1]: at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
2021-06-12T08:32:49.439543+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:928:32)
2021-06-12T08:32:49.439543+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:769:14)
2021-06-12T08:32:49.439543+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:952:19)
2021-06-12T08:32:49.439544+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:88:18)
2021-06-12T08:32:49.439544+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2021-06-12T08:32:49.439544+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1063:30)
2021-06-12T08:32:49.439545+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
2021-06-12T08:32:49.439545+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:928:32)
2021-06-12T08:32:49.439545+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:769:14)
2021-06-12T08:32:49.439546+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:952:19)
2021-06-12T08:32:49.439546+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:88:18)
2021-06-12T08:32:49.439546+00:00 app[web.1]: at Object.<anonymous> (/app/routes/users.js:2:16)
2021-06-12T08:32:49.439546+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1063:30)
2021-06-12T08:32:49.439547+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
2021-06-12T08:32:49.439547+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:928:32)
2021-06-12T08:32:49.453105+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-06-12T08:32:49.453413+00:00 app[web.1]: npm ERR! errno 1
2021-06-12T08:32:49.458918+00:00 app[web.1]: npm ERR! l6_13_04#1.0.0 start: `node app`
2021-06-12T08:32:49.459026+00:00 app[web.1]: npm ERR! Exit status 1
2021-06-12T08:32:49.459155+00:00 app[web.1]: npm ERR!
2021-06-12T08:32:49.459250+00:00 app[web.1]: npm ERR! Failed at the l6_13_04#1.0.0 start script.
2021-06-12T08:32:49.459341+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-06-12T08:32:49.464221+00:00 app[web.1]:
2021-06-12T08:32:49.464367+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-06-12T08:32:49.464451+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-06-12T08_32_49_460Z-debug.log
2021-06-12T08:32:49.523466+00:00 heroku[web.1]: Process exited with status 1
2021-06-12T08:32:49.596420+00:00 heroku[web.1]: State changed from starting to crashed
2021-06-12T08:32:49.622795+00:00 heroku[web.1]: State changed from crashed to starting
2021-06-12T08:32:52.222185+00:00 heroku[web.1]: Starting process with command `npm start`
2021-06-12T08:32:54.529651+00:00 app[web.1]:
2021-06-12T08:32:54.529669+00:00 app[web.1]: > l6_13_04#1.0.0 start /app
2021-06-12T08:32:54.529669+00:00 app[web.1]: > node app
2021-06-12T08:32:54.529670+00:00 app[web.1]:
2021-06-12T08:32:55.075602+00:00 app[web.1]: internal/modules/cjs/loader.js:1122
2021-06-12T08:32:55.075622+00:00 app[web.1]: return process.dlopen(module, path.toNamespacedPath(filename));
2021-06-12T08:32:55.075631+00:00 app[web.1]: ^
2021-06-12T08:32:55.075632+00:00 app[web.1]:
2021-06-12T08:32:55.075633+00:00 app[web.1]: Error: /app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: invalid ELF header
2021-06-12T08:32:55.075634+00:00 app[web.1]: at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
2021-06-12T08:32:55.075635+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:928:32)
2021-06-12T08:32:55.075635+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:769:14)
2021-06-12T08:32:55.075635+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:952:19)
2021-06-12T08:32:55.075636+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:88:18)
2021-06-12T08:32:55.075636+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2021-06-12T08:32:55.075636+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1063:30)
2021-06-12T08:32:55.075637+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
2021-06-12T08:32:55.075637+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:928:32)
2021-06-12T08:32:55.075637+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:769:14)
2021-06-12T08:32:55.075638+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:952:19)
2021-06-12T08:32:55.075638+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:88:18)
2021-06-12T08:32:55.075638+00:00 app[web.1]: at Object.<anonymous> (/app/routes/users.js:2:16)
2021-06-12T08:32:55.075639+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1063:30)
2021-06-12T08:32:55.075639+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
2021-06-12T08:32:55.075639+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:928:32)
2021-06-12T08:32:55.095077+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-06-12T08:32:55.095371+00:00 app[web.1]: npm ERR! errno 1
2021-06-12T08:32:55.102335+00:00 app[web.1]: npm ERR! l6_13_04#1.0.0 start: `node app`
2021-06-12T08:32:55.102427+00:00 app[web.1]: npm ERR! Exit status 1
2021-06-12T08:32:55.102549+00:00 app[web.1]: npm ERR!
2021-06-12T08:32:55.102638+00:00 app[web.1]: npm ERR! Failed at the l6_13_04#1.0.0 start script.
2021-06-12T08:32:55.102723+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-06-12T08:32:55.108249+00:00 app[web.1]:
2021-06-12T08:32:55.108497+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-06-12T08:32:55.108632+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-06-12T08_32_55_103Z-debug.log
2021-06-12T08:32:55.200979+00:00 heroku[web.1]: Process exited with status 1
2021-06-12T08:32:55.265806+00:00 heroku[web.1]: State changed from starting to crashed
try making the repo to public and check it works or not
after trying a bunch of more solutions on the internet.
only deleting the node_modules and pretty much initializing everything fixed it for me.

heroku deploy vue app TypeError: Object prototype may only be an Object or null: /dist/

this issue is driving me nuts.
TypeError: Object prototype may only be an Object or null: /dist/
I think heroku is failing due to an issue with a static serving issue as I am using a single page vue app served up by an express server. I'm not sure what this error means though? it seems to be referencing app.use(express.static(__dirname, '/dist/')); but I don't know what argument to give it besides the path?
my express server.js is quite simple:
const express = require('express');
const app = express();
app.use(express.static(__dirname, '/dist/'));
app.get(/.*/, function(req, res){
res.sendfile(__dirname + "/dist/index.html")
})
const port = process.env.PORT || 5000;
app.listen(port);
here are some of my heroku logs detailing the problem
2020-06-09T07:47:19.000000+00:00 app[api]: Build started by user luthertester#gmail.com
2020-06-09T07:48:47.890090+00:00 heroku[web.1]: State changed from crashed to starting
2020-06-09T07:48:47.712078+00:00 app[api]: Deploy d457ea7c by user luthertester#gmail.com
2020-06-09T07:48:47.712078+00:00 app[api]: Release v21 created by user luthertester#gmail.com
2020-06-09T07:48:55.749555+00:00 heroku[web.1]: Starting process with command `npm start`
2020-06-09T07:48:58.279945+00:00 heroku[web.1]: Process exited with status 1
2020-06-09T07:48:58.325770+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-09T07:48:58.027989+00:00 app[web.1]:
2020-06-09T07:48:58.028015+00:00 app[web.1]: > devdeepblog#0.1.0 start /app
2020-06-09T07:48:58.028016+00:00 app[web.1]: > node server.js
2020-06-09T07:48:58.028016+00:00 app[web.1]:
2020-06-09T07:48:58.213348+00:00 app[web.1]: /app/node_modules/serve-static/index.js:48
2020-06-09T07:48:58.213349+00:00 app[web.1]: var opts = Object.create(options || null)
2020-06-09T07:48:58.213350+00:00 app[web.1]: ^
2020-06-09T07:48:58.213350+00:00 app[web.1]:
2020-06-09T07:48:58.213351+00:00 app[web.1]: TypeError: Object prototype may only be an Object or null: /dist/
2020-06-09T07:48:58.213351+00:00 app[web.1]: at Function.create (<anonymous>)
2020-06-09T07:48:58.213352+00:00 app[web.1]: at Function.serveStatic [as static] (/app/node_modules/serve-static/index.js:48:21)
2020-06-09T07:48:58.213353+00:00 app[web.1]: at Object.<anonymous> (/app/server.js:4:23)
2020-06-09T07:48:58.213353+00:00 app[web.1]: at Module._compile (module.js:652:30)
2020-06-09T07:48:58.213353+00:00 app[web.1]: at Object.Module._extensions..js (module.js:663:10)
2020-06-09T07:48:58.213354+00:00 app[web.1]: at Module.load (module.js:565:32)
2020-06-09T07:48:58.213354+00:00 app[web.1]: at tryModuleLoad (module.js:505:12)
2020-06-09T07:48:58.213354+00:00 app[web.1]: at Function.Module._load (module.js:497:3)
2020-06-09T07:48:58.213355+00:00 app[web.1]: at Function.Module.runMain (module.js:693:10)
2020-06-09T07:48:58.213355+00:00 app[web.1]: at startup (bootstrap_node.js:191:16)
2020-06-09T07:48:58.218237+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-06-09T07:48:58.218654+00:00 app[web.1]: npm ERR! errno 1
2020-06-09T07:48:58.219698+00:00 app[web.1]: npm ERR! devdeepblog#0.1.0 start: `node server.js`
2020-06-09T07:48:58.219855+00:00 app[web.1]: npm ERR! Exit status 1
2020-06-09T07:48:58.220093+00:00 app[web.1]: npm ERR!
2020-06-09T07:48:58.220259+00:00 app[web.1]: npm ERR! Failed at the devdeepblog#0.1.0 start script.
2020-06-09T07:48:58.220430+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-06-09T07:48:58.226320+00:00 app[web.1]:
2020-06-09T07:48:58.226466+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-06-09T07:48:58.226574+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-06-09T07_48_58_221Z-debug.log

Running `node index.js` from command line works but when I use the start script in my package.json I get an EADDRINUSE /usr/bin/local/node error

I can run node index.js from the directly from the command line but when I run the start script that has the same command I get an error.
Here is the relative server info:
const PORT = process.env.NODE || 3000
app.listen(PORT, () => console.log(`Server running on ${PORT}`))
Here is the package.json script:
"scripts": {
"start": "node index.js"
},
Here is the terminal output ran from the project root running it without the script:
> node index.js
Server running on port 3000
Here is the terminal output running it with the script:
>yarn start
yarn run v1.10.1
$ node index.js
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE /usr/local/bin/node
at Server.setupListenHandle [as _listen2] (net.js:1343:19)
at listenInCluster (net.js:1401:12)
at Server.listen (net.js:1496:5)
at Function.listen (/Users/mmelv/Workspace/Projects/Reportably/server/node_modules/express/lib/application.js:618:24)
at Object.<anonymous> (/Users/mmelv/Workspace/Projects/Reportably/server/index.js:29:5)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
This has boggled me for hours. I've tried sudo killall node, lsof -i tcp:3000 returns nothing. I've reinstalled and upgraded node.
Also, I get the same error when I try to deploy it to Heroku:
2018-10-07T15:47:56.000000+00:00 app[api]: Build succeeded
2018-10-07T15:47:58.569471+00:00 heroku[web.1]: Starting process with command `npm start`
2018-10-07T15:48:01.927982+00:00 app[web.1]:
2018-10-07T15:48:01.928007+00:00 app[web.1]: > server#1.0.0 start /app
2018-10-07T15:48:01.928009+00:00 app[web.1]: > node index.js
2018-10-07T15:48:01.928010+00:00 app[web.1]:
2018-10-07T15:48:02.936929+00:00 app[web.1]: events.js:183
2018-10-07T15:48:02.936974+00:00 app[web.1]: throw er; // Unhandled 'error' event
2018-10-07T15:48:02.936976+00:00 app[web.1]: ^
2018-10-07T15:48:02.936977+00:00 app[web.1]:
2018-10-07T15:48:02.936979+00:00 app[web.1]: Error: listen EADDRINUSE /app/.heroku/node/bin/node
2018-10-07T15:48:02.936981+00:00 app[web.1]: at Object._errnoException (util.js:992:11)
2018-10-07T15:48:02.936982+00:00 app[web.1]: at _exceptionWithHostPort (util.js:1014:20)
2018-10-07T15:48:02.936984+00:00 app[web.1]: at Server.setupListenHandle [as _listen2] (net.js:1338:19)
2018-10-07T15:48:02.936985+00:00 app[web.1]: at listenInCluster (net.js:1396:12)
2018-10-07T15:48:02.936987+00:00 app[web.1]: at Server.listen (net.js:1491:5)
2018-10-07T15:48:02.936989+00:00 app[web.1]: at Function.listen (/app/node_modules/express/lib/application.js:618:24)
2018-10-07T15:48:02.936990+00:00 app[web.1]: at Object.<anonymous> (/app/index.js:29:5)
2018-10-07T15:48:02.936992+00:00 app[web.1]: at Module._compile (module.js:652:30)
2018-10-07T15:48:02.936993+00:00 app[web.1]: at Object.Module._extensions..js (module.js:663:10)
2018-10-07T15:48:02.936995+00:00 app[web.1]: at Module.load (module.js:565:32)
2018-10-07T15:48:02.936996+00:00 app[web.1]: at tryModuleLoad (module.js:505:12)
2018-10-07T15:48:02.936998+00:00 app[web.1]: at Function.Module._load (module.js:497:3)
2018-10-07T15:48:02.936999+00:00 app[web.1]: at Function.Module.runMain (module.js:693:10)
2018-10-07T15:48:02.937001+00:00 app[web.1]: at startup (bootstrap_node.js:191:16)
2018-10-07T15:48:02.937003+00:00 app[web.1]: at bootstrap_node.js:612:3
2018-10-07T15:48:03.081497+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-10-07T15:48:03.082095+00:00 app[web.1]: npm ERR! errno 1
2018-10-07T15:48:03.083978+00:00 app[web.1]: npm ERR! server#1.0.0 start: `node index.js`
2018-10-07T15:48:03.088003+00:00 app[web.1]: npm ERR! Exit status 1
2018-10-07T15:48:03.088362+00:00 app[web.1]: npm ERR!
2018-10-07T15:48:03.088616+00:00 app[web.1]: npm ERR! Failed at the server#1.0.0 start script.
2018-10-07T15:48:03.088965+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I'm not sure what else to do. Why can I run node index.js but not the start script that does the same thing?
I had to change process.env.NODE to process.env.PORT...
I know, I know...

Deploying Vue app to Heroku, cannot find module shelljs

I am trying to deploy a vue template to our heroku instance. I have setup the procfile to call the right build script but am getting this.
Error: Cannot find module 'shelljs'
And the logs from it are:
2017-10-19T18:14:59.663986+00:00 heroku[web.1]: State changed from crashed to starting
2017-10-19T18:15:05.595940+00:00 heroku[web.1]: Starting process with command `npm run dev`
2017-10-19T18:15:13.354029+00:00 app[web.1]:
2017-10-19T18:15:13.354061+00:00 app[web.1]: > genesisui-vue#1.8.4 dev /app
2017-10-19T18:15:13.354061+00:00 app[web.1]: > node build/dev-server.js
2017-10-19T18:15:13.354062+00:00 app[web.1]:
2017-10-19T18:15:13.882843+00:00 app[web.1]: module.js:529
2017-10-19T18:15:13.882854+00:00 app[web.1]: throw err;
2017-10-19T18:15:13.882855+00:00 app[web.1]: ^
2017-10-19T18:15:13.882855+00:00 app[web.1]:
2017-10-19T18:15:13.882856+00:00 app[web.1]: Error: Cannot find module 'shelljs'
2017-10-19T18:15:13.882857+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:527:15)
2017-10-19T18:15:13.882858+00:00 app[web.1]: at Function.Module._load (module.js:476:23)
2017-10-19T18:15:13.882859+00:00 app[web.1]: at Module.require (module.js:568:17)
2017-10-19T18:15:13.882859+00:00 app[web.1]: at require (internal/module.js:11:18)
2017-10-19T18:15:13.882860+00:00 app[web.1]: at Object.<anonymous> (/app/build/check-versions.js:4:13)
2017-10-19T18:15:13.882860+00:00 app[web.1]: at Module._compile (module.js:624:30)
2017-10-19T18:15:13.882861+00:00 app[web.1]: at Object.Module._extensions..js (module.js:635:10)
2017-10-19T18:15:13.882861+00:00 app[web.1]: at Module.load (module.js:545:32)
2017-10-19T18:15:13.882862+00:00 app[web.1]: at tryModuleLoad (module.js:508:12)
2017-10-19T18:15:13.882863+00:00 app[web.1]: at Function.Module._load (module.js:500:3)
2017-10-19T18:15:13.894056+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2017-10-19T18:15:13.894488+00:00 app[web.1]: npm ERR! errno 1
2017-10-19T18:15:13.896140+00:00 app[web.1]: npm ERR! genesisui-vue#1.8.4 dev: `node build/dev-server.js`
2017-10-19T18:15:13.896314+00:00 app[web.1]: npm ERR! Exit status 1
2017-10-19T18:15:13.896580+00:00 app[web.1]: npm ERR!
2017-10-19T18:15:13.896777+00:00 app[web.1]: npm ERR! Failed at the genesisui-vue#1.8.4 dev script.
2017-10-19T18:15:13.896948+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2017-10-19T18:15:15.163061+00:00 app[web.1]:
2017-10-19T18:15:15.166845+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2017-10-19T18:15:15.166959+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2017-10-19T18_15_13_902Z-debug.log
2017-10-19T18:15:15.282631+00:00 heroku[web.1]: Process exited with status 1
2017-10-19T18:15:15.299772+00:00 heroku[web.1]: State changed from starting to crashed
Any leads would be very grateful!!!
npm install shelljs --save
git commit - m “your comment”
git push -u origin master
git push heroku master

Resources