I have discovered that when I run my Node Application on my computer as a localhost machine using MongoLab back end it works perfectly but sadly after pushing the project using Git to Heroku server, the back end seems to fail executing the server. This is what I had found when entering heroku logs
2014-08-15T02:50:59.646594+00:00 app[web.1]: ^
2014-08-15T02:50:59.648767+00:00 app[web.1]: at Object.Module._extensions..js (module.js:474:10)
2014-08-15T02:50:59.648760+00:00 app[web.1]: at Module.require (module.js:364:17)
2014-08-15T02:50:59.648770+00:00 app[web.1]: at Function.Module._load (module.js:312:12)
2014-08-15T02:50:59.648758+00:00 app[web.1]: at Function.Module._load (module.js:280:25)
2014-08-15T02:50:59.648766+00:00 app[web.1]: at Module._compile (module.js:456:26)
2014-08-15T02:50:59.648769+00:00 app[web.1]: at Module.load (module.js:356:32)
2014-08-15T02:50:59.648762+00:00 app[web.1]: at require (module.js:380:17)
2014-08-15T02:51:01.523808+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teenword.
herokuapp.com request_id=baaae02b-22f3-48f3-94dc-9c272b78d1a5 fwd="184.73.33.68" dyno= connect= service= status=503 byte
s=
2014-08-15T02:50:56+00:00 heroku[slug-compiler]: Slug compilation finished
2014-08-15T02:53:14.064750+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/login" host=teen
word.herokuapp.com request_id=eff2ca9e-c4d4-4ac7-9475-b8034ed8d43b fwd="31.13.157.69" dyno= connect= service= status=503
bytes=
2014-08-15T02:56:37.094873+00:00 heroku[api]: Scale to web=1 by peter.soboyejo#aol.com
2014-08-15T02:59:00.813302+00:00 app[web.1]:
2014-08-15T02:59:00.814146+00:00 app[web.1]: throw err;
2014-08-15T02:59:00.814328+00:00 app[web.1]: ^
2014-08-15T02:59:00.817013+00:00 app[web.1]: Error: Cannot find module 'merge-descriptors'
2014-08-15T02:59:00.817016+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:338:15)
2014-08-15T02:59:00.817018+00:00 app[web.1]: at Function.Module._load (module.js:280:25)
2014-08-15T02:59:00.817019+00:00 app[web.1]: at Module.require (module.js:364:17)
2014-08-15T02:59:00.817021+00:00 app[web.1]: at require (module.js:380:17)
2014-08-15T02:59:00.817022+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/express/lib/express.js:5:13)
2014-08-15T02:59:00.817023+00:00 app[web.1]: at Module._compile (module.js:456:26)
2014-08-15T02:59:00.817025+00:00 app[web.1]: at Object.Module._extensions..js (module.js:474:10)
2014-08-15T02:59:00.817026+00:00 app[web.1]: at Module.load (module.js:356:32)
2014-08-15T02:59:00.817027+00:00 app[web.1]: at Function.Module._load (module.js:312:12)
2014-08-15T02:59:00.817029+00:00 app[web.1]: at Module.require (module.js:364:17)
2014-08-15T02:59:00.813688+00:00 app[web.1]: module.js:340
2014-08-15T02:59:01.814561+00:00 heroku[web.1]: State changed from starting to crashed
2014-08-15T03:00:16.967002+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teenword.
herokuapp.com request_id=b403ea1c-65fd-4198-a691-7ebd688db707 fwd="199.231.242.26" dyno= connect= service= status=503 by
tes=
2014-08-15T03:02:03+00:00 heroku[slug-compiler]: Slug compilation started
2014-08-15T03:02:31.673064+00:00 app[web.1]:
2014-08-15T03:02:31.680188+00:00 app[web.1]: throw err;
2014-08-15T03:02:31.680198+00:00 app[web.1]: ^
2014-08-15T03:02:31.693110+00:00 app[web.1]: Error: Cannot find module 'merge-descriptors'
2014-08-15T03:02:31.693116+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:338:15)
2014-08-15T03:02:31.693118+00:00 app[web.1]: at Function.Module._load (module.js:280:25)
2014-08-15T03:02:31.693119+00:00 app[web.1]: at Module.require (module.js:364:17)
2014-08-15T03:02:31.693122+00:00 app[web.1]: at require (module.js:380:17)
2014-08-15T03:02:31.693123+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/express/lib/express.js:5:13)
2014-08-15T03:02:31.693125+00:00 app[web.1]: at Module._compile (module.js:456:26)
2014-08-15T03:02:31.693126+00:00 app[web.1]: at Object.Module._extensions..js (module.js:474:10)
2014-08-15T03:02:31.693128+00:00 app[web.1]: at Module.load (module.js:356:32)
2014-08-15T03:02:31.693129+00:00 app[web.1]: at Function.Module._load (module.js:312:12)
2014-08-15T03:02:31.693131+00:00 app[web.1]: at Module.require (module.js:364:17)
2014-08-15T03:02:28+00:00 heroku[slug-compiler]: Slug compilation finished
2014-08-15T03:02:31.679640+00:00 app[web.1]: module.js:340
2014-08-15T03:02:33.235216+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teenword.
herokuapp.com request_id=92321ac0-1ee9-4dda-a782-580107c89ff7 fwd="184.73.33.68" dyno= connect= service= status=503 byte
s=
2014-08-15T03:05:39+00:00 heroku[slug-compiler]: Slug compilation started
2014-08-15T03:05:57+00:00 heroku[slug-compiler]: Slug compilation finished
2014-08-15T03:05:58.051436+00:00 heroku[web.1]: State changed from crashed to starting
2014-08-15T03:06:01.982628+00:00 heroku[web.1]: State changed from starting to crashed
2014-08-15T03:06:00.100160+00:00 heroku[web.1]: Starting process with command `node server.js`
2014-08-15T03:06:01.974783+00:00 heroku[web.1]: Process exited with status 8
2014-08-15T03:07:37.569248+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/login" host=teen
word.herokuapp.com request_id=4327c523-1ca7-49f5-8c64-b4a52b7f57b7 fwd="31.13.157.69" dyno= connect= service= status=503
bytes=
2014-08-15T03:08:51.801138+00:00 heroku[api]: Scale to web=1 by peter.soboyejo#aol.com
2014-08-15T03:11:36.779299+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/signup" host=tee
nword.herokuapp.com request_id=4dc53622-d8ea-40ad-9bbf-f1eb3954e9a6 fwd="24.14.146.249" dyno= connect= service= status=5
03 bytes=
2014-08-15T03:22:55+00:00 heroku[slug-compiler]: Slug compilation started
2014-08-15T03:23:11.884248+00:00 app[web.1]:
2014-08-15T03:23:16.902395+00:00 app[web.1]: module.js:340
2014-08-15T03:23:11.884725+00:00 app[web.1]: module.js:340
2014-08-15T03:23:11.884916+00:00 app[web.1]: throw err;
2014-08-15T03:23:11.884927+00:00 app[web.1]: ^
2014-08-15T03:23:11.887410+00:00 app[web.1]: Error: Cannot find module 'merge-descriptors'
2014-08-15T03:23:11.887417+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:338:15)
2014-08-15T03:23:11.887419+00:00 app[web.1]: at Function.Module._load (module.js:280:25)
2014-08-15T03:23:11.887421+00:00 app[web.1]: at Module.require (module.js:364:17)
2014-08-15T03:23:11.887424+00:00 app[web.1]: at require (module.js:380:17)
2014-08-15T03:23:11.887427+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/express/lib/express.js:5:13)
2014-08-15T03:23:11.887429+00:00 app[web.1]: at Module._compile (module.js:456:26)
2014-08-15T03:23:11.887431+00:00 app[web.1]: at Object.Module._extensions..js (module.js:474:10)
2014-08-15T03:23:11.887433+00:00 app[web.1]: at Module.load (module.js:356:32)
2014-08-15T03:23:11.887435+00:00 app[web.1]: at Function.Module._load (module.js:312:12)
2014-08-15T03:23:11.887437+00:00 app[web.1]: at Module.require (module.js:364:17)
2014-08-15T03:23:16.901816+00:00 app[web.1]:
2014-08-15T03:23:16.902692+00:00 app[web.1]: throw err;
2014-08-15T03:23:16.902698+00:00 app[web.1]: ^
2014-08-15T03:23:16.904869+00:00 app[web.1]: Error: Cannot find module 'merge-descriptors'
2014-08-15T03:23:16.904872+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:338:15)
2014-08-15T03:23:16.904873+00:00 app[web.1]: at Function.Module._load (module.js:280:25)
2014-08-15T03:23:16.904875+00:00 app[web.1]: at Module.require (module.js:364:17)
2014-08-15T03:23:16.904877+00:00 app[web.1]: at require (module.js:380:17)
2014-08-15T03:23:16.904879+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/express/lib/express.js:5:13)
2014-08-15T03:23:16.904881+00:00 app[web.1]: at Module._compile (module.js:456:26)
2014-08-15T03:23:16.904883+00:00 app[web.1]: at Object.Module._extensions..js (module.js:474:10)
2014-08-15T03:23:16.904884+00:00 app[web.1]: at Module.load (module.js:356:32)
2014-08-15T03:23:16.904886+00:00 app[web.1]: at Function.Module._load (module.js:312:12)
2014-08-15T03:23:16.904887+00:00 app[web.1]: at Module.require (module.js:364:17)
2014-08-15T03:23:08.660195+00:00 heroku[api]: Deploy b60ead0 by peter.soboyejo#aol.com
2014-08-15T03:23:18.679853+00:00 heroku[web.1]: Process exited with status 8
2014-08-15T03:23:08.660396+00:00 heroku[api]: Release v14 created by peter.soboyejo#aol.com
2014-08-15T03:23:29.486685+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/login" host=teen
word.herokuapp.com request_id=bc8ed6e0-58cc-4aa6-9c07-0a764f35c40b fwd="31.13.157.69" dyno= connect= service= status=503
bytes=
2014-08-15T03:23:28.867038+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/login" host=teen
word.herokuapp.com request_id=6533a904-6f1c-4cf9-a5ae-d1f1adb0d85e fwd="31.13.157.69" dyno= connect= service= status=503
bytes=
2014-08-15T03:23:15.635910+00:00 heroku[web.1]: Starting process with command `node server.js`
2014-08-15T03:23:08+00:00 heroku[slug-compiler]: Slug compilation finished
2014-08-15T03:26:52+00:00 heroku[slug-compiler]: Slug compilation started
2014-08-15T03:27:06+00:00 heroku[slug-compiler]: Slug compilation finished
2014-08-15T03:27:10.320448+00:00 app[web.1]: module.js:340
2014-08-15T03:27:02.446174+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" hos
t=teenword.herokuapp.com request_id=6331dbf1-aa2f-4fea-b7ed-3703705e309a fwd="50.89.215.155" dyno= connect= service= sta
tus=503 bytes=
2014-08-15T03:27:09.170120+00:00 heroku[web.1]: Starting process with command `node server.js`
2014-08-15T03:27:11.651208+00:00 heroku[web.1]: Process exited with status 8
2014-08-15T03:27:17.338857+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=teenword.
herokuapp.com request_id=86b8be74-cf19-4977-bc1b-114b383aaad9 fwd="31.13.157.69" dyno= connect= service= status=503 byte
s=
Related
I am trying to deploy my app to Heroku, however, i am running into some problems that i don't understand. I searched for similar problems but to no success. I ran heroku open but it only displays application error.
The error below is after committing then typing heroku logs --tail
2022-10-27T15:29:24.523556+00:00 heroku[web.1]: Process exited with status 1
2022-10-27T15:29:24.587530+00:00 heroku[web.1]: State changed from starting to crashed
2022-10-27T15:59:56.758114+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=vaulteer.herokuapp.com request_id=1cc5af25-d8cc-4fc0-a8db-562612eba0e1 fwd="49.145.42.80" dyno= connect= service= status=503 bytes= protocol=https
2022-10-27T16:00:32.097214+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=vaulteer.herokuapp.com request_id=93cf8986-eb7b-4e9f-995e-846f4f08c8c1 fwd="49.145.42.80" dyno= connect= service= status=503 bytes= protocol=https
2022-10-27T16:01:09.820661+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=vaulteer.herokuapp.com request_id=c94e620d-2c3c-42e1-820b-763011dd8e58 fwd="49.145.42.80" dyno= connect= service= status=503 bytes= protocol=https
2022-10-27T16:01:15.043521+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=vaulteer.herokuapp.com request_id=cbe6c51b-5bc6-4898-ac5f-f5ba77bb488d fwd="49.145.42.80" dyno= connect= service= status=503 bytes= protocol=https
2022-10-27T18:07:29.924304+00:00 heroku[web.1]: State changed from crashed to starting
2022-10-27T18:07:36.794181+00:00 heroku[web.1]: Starting process with command `npm start`
2022-10-27T18:07:38.902356+00:00 app[web.1]: npm WARN config production Use `--omit=dev` instead.
2022-10-27T18:07:38.915737+00:00 app[web.1]:
2022-10-27T18:07:38.915738+00:00 app[web.1]: > password-manager#1.0.0 start
2022-10-27T18:07:38.915739+00:00 app[web.1]: > node server/server.js
2022-10-27T18:07:38.915739+00:00 app[web.1]:
2022-10-27T18:07:38.984836+00:00 app[web.1]: node:internal/modules/cjs/loader:998
2022-10-27T18:07:38.984840+00:00 app[web.1]: throw err;
2022-10-27T18:07:38.984841+00:00 app[web.1]: ^
2022-10-27T18:07:38.984841+00:00 app[web.1]:
2022-10-27T18:07:38.984841+00:00 app[web.1]: Error: Cannot find module './debug'
2022-10-27T18:07:38.984842+00:00 app[web.1]: Require stack:
2022-10-27T18:07:38.984842+00:00 app[web.1]: - /app/node_modules/debug/src/node.js
2022-10-27T18:07:38.984842+00:00 app[web.1]: - /app/node_modules/debug/src/index.js
2022-10-27T18:07:38.984842+00:00 app[web.1]: - /app/node_modules/finalhandler/index.js
2022-10-27T18:07:38.984843+00:00 app[web.1]: - /app/node_modules/express/lib/application.js
2022-10-27T18:07:38.984843+00:00 app[web.1]: - /app/node_modules/express/lib/express.js
2022-10-27T18:07:38.984843+00:00 app[web.1]: - /app/node_modules/express/index.js
2022-10-27T18:07:38.984844+00:00 app[web.1]: - /app/server/server.js
2022-10-27T18:07:38.984844+00:00 app[web.1]: at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
2022-10-27T18:07:38.984845+00:00 app[web.1]: at Module._load (node:internal/modules/cjs/loader:841:27)
2022-10-27T18:07:38.984845+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:1061:19)
2022-10-27T18:07:38.984845+00:00 app[web.1]: at require (node:internal/modules/cjs/helpers:103:18)
2022-10-27T18:07:38.984864+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/debug/src/node.js:14:28)
2022-10-27T18:07:38.984865+00:00 app[web.1]: at Module._compile (node:internal/modules/cjs/loader:1159:14)
2022-10-27T18:07:38.984865+00:00 app[web.1]: at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
2022-10-27T18:07:38.984865+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:1037:32)
2022-10-27T18:07:38.984865+00:00 app[web.1]: at Module._load (node:internal/modules/cjs/loader:878:12)
2022-10-27T18:07:38.984866+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:1061:19) {
2022-10-27T18:07:38.984866+00:00 app[web.1]: code: 'MODULE_NOT_FOUND',
2022-10-27T18:07:38.984866+00:00 app[web.1]: requireStack: [
2022-10-27T18:07:38.984866+00:00 app[web.1]: '/app/node_modules/debug/src/node.js',
2022-10-27T18:07:38.984867+00:00 app[web.1]: '/app/node_modules/debug/src/index.js',
2022-10-27T18:07:38.984867+00:00 app[web.1]: '/app/node_modules/finalhandler/index.js',
2022-10-27T18:07:38.984867+00:00 app[web.1]: '/app/node_modules/express/lib/application.js',
2022-10-27T18:07:38.984868+00:00 app[web.1]: '/app/node_modules/express/lib/express.js',
2022-10-27T18:07:38.984868+00:00 app[web.1]: '/app/node_modules/express/index.js',
2022-10-27T18:07:38.984868+00:00 app[web.1]: '/app/server/server.js'
2022-10-27T18:07:38.984868+00:00 app[web.1]: ]
2022-10-27T18:07:38.984869+00:00 app[web.1]: }
2022-10-27T18:07:38.984873+00:00 app[web.1]:
2022-10-27T18:07:38.984874+00:00 app[web.1]: Node.js v18.12.0
2022-10-27T18:07:39.125526+00:00 heroku[web.1]: Process exited with status 1
2022-10-27T18:07:39.324865+00:00 heroku[web.1]: State changed from starting to crashed
2022-10-27T19:52:09.765683+00:00 heroku[web.1]: State changed from crashed to starting
2022-10-27T19:52:16.335694+00:00 heroku[web.1]: Starting process with command `npm start`
2022-10-27T19:52:18.194757+00:00 app[web.1]: npm WARN config production Use `--omit=dev` instead.
2022-10-27T19:52:18.206356+00:00 app[web.1]:
2022-10-27T19:52:18.206357+00:00 app[web.1]: > password-manager#1.0.0 start
2022-10-27T19:52:18.206358+00:00 app[web.1]: > node server/server.js
2022-10-27T19:52:18.206358+00:00 app[web.1]:
2022-10-27T19:52:18.269847+00:00 app[web.1]: node:internal/modules/cjs/loader:998
2022-10-27T19:52:18.269852+00:00 app[web.1]: throw err;
2022-10-27T19:52:18.269852+00:00 app[web.1]: ^
2022-10-27T19:52:18.269852+00:00 app[web.1]:
2022-10-27T19:52:18.269852+00:00 app[web.1]: Error: Cannot find module './debug'
2022-10-27T19:52:18.269853+00:00 app[web.1]: Require stack:
2022-10-27T19:52:18.269853+00:00 app[web.1]: - /app/node_modules/debug/src/node.js
2022-10-27T19:52:18.269853+00:00 app[web.1]: - /app/node_modules/debug/src/index.js
2022-10-27T19:52:18.269854+00:00 app[web.1]: - /app/node_modules/finalhandler/index.js
2022-10-27T19:52:18.269854+00:00 app[web.1]: - /app/node_modules/express/lib/application.js
2022-10-27T19:52:18.269854+00:00 app[web.1]: - /app/node_modules/express/lib/express.js
2022-10-27T19:52:18.269854+00:00 app[web.1]: - /app/node_modules/express/index.js
2022-10-27T19:52:18.269855+00:00 app[web.1]: - /app/server/server.js
2022-10-27T19:52:18.269855+00:00 app[web.1]: at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
2022-10-27T19:52:18.269875+00:00 app[web.1]: at Module._load (node:internal/modules/cjs/loader:841:27)
2022-10-27T19:52:18.269875+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:1061:19)
2022-10-27T19:52:18.269876+00:00 app[web.1]: at require (node:internal/modules/cjs/helpers:103:18)
2022-10-27T19:52:18.269876+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/debug/src/node.js:14:28)
2022-10-27T19:52:18.269876+00:00 app[web.1]: at Module._compile (node:internal/modules/cjs/loader:1159:14)
2022-10-27T19:52:18.269876+00:00 app[web.1]: at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
2022-10-27T19:52:18.269877+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:1037:32)
2022-10-27T19:52:18.269877+00:00 app[web.1]: at Module._load (node:internal/modules/cjs/loader:878:12)
2022-10-27T19:52:18.269877+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:1061:19) {
2022-10-27T19:52:18.269878+00:00 app[web.1]: code: 'MODULE_NOT_FOUND',
2022-10-27T19:52:18.269878+00:00 app[web.1]: requireStack: [
2022-10-27T19:52:18.269878+00:00 app[web.1]: '/app/node_modules/debug/src/node.js',
2022-10-27T19:52:18.269879+00:00 app[web.1]: '/app/node_modules/debug/src/index.js',
2022-10-27T19:52:18.269879+00:00 app[web.1]: '/app/node_modules/finalhandler/index.js',
2022-10-27T19:52:18.269879+00:00 app[web.1]: '/app/node_modules/express/lib/application.js',
2022-10-27T19:52:18.269880+00:00 app[web.1]: '/app/node_modules/express/lib/express.js',
2022-10-27T19:52:18.269880+00:00 app[web.1]: '/app/node_modules/express/index.js',
2022-10-27T19:52:18.269880+00:00 app[web.1]: '/app/server/server.js'
2022-10-27T19:52:18.269881+00:00 app[web.1]: ]
2022-10-27T19:52:18.269881+00:00 app[web.1]: }
2022-10-27T19:52:18.269886+00:00 app[web.1]:
2022-10-27T19:52:18.269886+00:00 app[web.1]: Node.js v18.12.0
2022-10-27T19:52:18.395749+00:00 heroku[web.1]: Process exited with status 1
2022-10-27T19:52:18.468515+00:00 heroku[web.1]: State changed from starting to crashed
2022-10-28T01:03:27.021615+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=vaulteer.herokuapp.com request_id=e8f46d28-87c5-459a-9e84-81209a3ff372 fwd="49.145.42.80" dyno= connect= service= status=503 bytes= protocol=https
2022-10-28T01:03:28.182114+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=vaulteer.herokuapp.com request_id=02c2c4df-ff96-4491-ba6d-3d330c7df316 fwd="49.145.42.80" dyno= connect= service= status=503 bytes= protocol=https
2022-10-28T01:15:16.563295+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=vaulteer.herokuapp.com request_id=487bf4d4-bf13-447b-8903-c497bba1920c fwd="49.145.42.80" dyno= connect= service= status=503 bytes= protocol=https
2022-10-28T01:15:17.834727+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=vaulteer.herokuapp.com request_id=7efbd535-ae24-452d-b72f-863889409f4f fwd="49.145.42.80" dyno= connect= service= status=503 bytes= protocol=https
Honestly, i havent tried anything that much besides npm install as this is the first time ive experienced this problem.
I had a similar error.
I used the node map command to run the file.
Even though my file was called main.js
But the node map command runs the map.js file
After I changed the command to node main everything worked.
I am new in Heroku and currently building an app with react (Node.js).
While I was able to push successfully my master branch to Heroku and Heroku confirms my app is deployed successfully, yet, the app is not deployed despite that is shows below deploy success message: "Deploy to Heroku".
Below is the error log in Heroku:
2022-02-08T00:45:18.702341+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-02-08T00:45:18.702341+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
2022-02-08T00:45:18.702341+00:00 app[web.1]: code: 'ERR_DLOPEN_FAILED'
2022-02-08T00:45:18.702342+00:00 app[web.1]: }
2022-02-08T00:45:18.924415+00:00 heroku[web.1]: Process exited with status 1
2022-02-08T00:45:19.739614+00:00 heroku[web.1]: State changed from starting to crashed
2022-02-08T00:45:31.255261+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=haksuly1movieapp.herokuapp.com request_id=05cc8ef9-baa5-4af8-8167-ab18ec9fc909 fwd="88.130.53.4" dyno= connect= service= status=503 bytes= protocol=https
2022-02-08T00:45:31.413269+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=haksuly1movieapp.herokuapp.com request_id=83016251-e4f0-4bf0-87d0-39ecb39ddd3f fwd="88.130.53.4" dyno= connect= service= status=503 bytes= protocol=https
2022-02-08T00:46:20.928808+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=haksuly1movieapp.herokuapp.com request_id=d243ef5c-56d8-4e22-b095-f3915e338c90 fwd="88.130.53.4" dyno= connect= service= status=503 bytes= protocol=https
2022-02-08T00:46:21.142923+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=haksuly1movieapp.herokuapp.com request_id=49b1447a-2058-40c8-b85f-6934e1854ebb fwd="88.130.53.4" dyno= connect= service= status=503 bytes= protocol=https
Below is the error log from CLI:
2022-02-08T00:45:12.986742+00:00 app[web.1]: ^
2022-02-08T00:45:12.986743+00:00 app[web.1]:
2022-02-08T00:45:12.986744+00:00 app[web.1]: Error: /app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: invalid ELF header
2022-02-08T00:45:12.986744+00:00 app[web.1]: at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
2022-02-08T00:45:12.986745+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-02-08T00:45:12.986745+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12)
2022-02-08T00:45:12.986746+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:1005:19)
2022-02-08T00:45:12.986746+00:00 app[web.1]: at require (node:internal/modules/cjs/helpers:102:18)
2022-02-08T00:45:12.986746+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2022-02-08T00:45:12.986746+00:00 app[web.1]: at Module._compile (node:internal/modules/cjs/loader:1101:14)
2022-02-08T00:45:12.986747+00:00 app[web.1]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
2022-02-08T00:45:12.986747+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-02-08T00:45:12.986747+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
2022-02-08T00:45:12.986748+00:00 app[web.1]: code: 'ERR_DLOPEN_FAILED'
2022-02-08T00:45:12.986748+00:00 app[web.1]: }
2022-02-08T00:45:13.178543+00:00 heroku[web.1]: Process exited with status 1
2022-02-08T00:45:13.264905+00:00 heroku[web.1]: State changed from starting to crashed
2022-02-08T00:45:13.273816+00:00 heroku[web.1]: State changed from crashed to starting
2022-02-08T00:45:15.956822+00:00 heroku[web.1]: Starting process with command `npm start`
2022-02-08T00:45:18.232060+00:00 app[web.1]:
2022-02-08T00:45:18.232080+00:00 app[web.1]: > movie_api#1.0.0 start
2022-02-08T00:45:18.232081+00:00 app[web.1]: > node index.js
2022-02-08T00:45:18.232081+00:00 app[web.1]:
2022-02-08T00:45:18.702302+00:00 app[web.1]: node:internal/modules/cjs/loader:1183
2022-02-08T00:45:18.702328+00:00 app[web.1]: return process.dlopen(module, path.toNamespacedPath(filename));
2022-02-08T00:45:18.702329+00:00 app[web.1]: ^
2022-02-08T00:45:18.702330+00:00 app[web.1]:
2022-02-08T00:45:18.702336+00:00 app[web.1]: Error: /app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: invalid ELF header
2022-02-08T00:45:18.702337+00:00 app[web.1]: at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
2022-02-08T00:45:18.702338+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-02-08T00:45:18.702338+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12)
2022-02-08T00:45:18.702338+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:1005:19)
2022-02-08T00:45:18.702339+00:00 app[web.1]: at require (node:internal/modules/cjs/helpers:102:18)
2022-02-08T00:45:18.702340+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2022-02-08T00:45:18.702340+00:00 app[web.1]: at Module._compile (node:internal/modules/cjs/loader:1101:14)
2022-02-08T00:45:18.702340+00:00 app[web.1]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
2022-02-08T00:45:18.702341+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-02-08T00:45:18.702341+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
2022-02-08T00:45:18.702341+00:00 app[web.1]: code: 'ERR_DLOPEN_FAILED'
2022-02-08T00:45:18.702342+00:00 app[web.1]: }
2022-02-08T00:45:18.924415+00:00 heroku[web.1]: Process exited with status 1
2022-02-08T00:45:19.739614+00:00 heroku[web.1]: State changed from starting to crashed
2022-02-08T00:45:31.255261+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=haksuly1movieapp.herokuapp.com request_id=05cc8ef9-baa5-4af8-8167-ab18ec9fc909 fwd="88.130.53.4" dyno= connect= service= status=503 bytes= protocol=https
2022-02-08T00:45:31.413269+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=haksuly1movieapp.herokuapp.com request_id=83016251-e4f0-4bf0-87d0-39ecb39ddd3f fwd="88.130.53.4" dyno= connect= service= status=503 bytes= protocol=https
2022-02-08T00:46:20.928808+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=haksuly1movieapp.herokuapp.com request_id=d243ef5c-56d8-4e22-b095-f3915e338c90 fwd="88.130.53.4" dyno= connect= service= status=503 bytes= protocol=https
2022-02-08T00:46:21.142923+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=haksuly1movieapp.herokuapp.com request_id=49b1447a-2058-40c8-b85f-6934e1854ebb fwd="88.130.53.4" dyno= connect= service= status=503 bytes= protocol=https
2022-02-08T01:06:56.000000+00:00 app[api]: Build started by user hakeemkayodesulyman#gmail.com
2022-02-08T01:07:18.099531+00:00 app[api]: Deploy 759fe937 by user hakeemkayodesulyman#gmail.com
2022-02-08T01:07:18.099531+00:00 app[api]: Release v17 created by user hakeemkayodesulyman#gmail.com
2022-02-08T01:07:18.394025+00:00 heroku[web.1]: State changed from crashed to starting
2022-02-08T01:07:21.000000+00:00 app[api]: Build succeeded
2022-02-08T01:07:21.034913+00:00 heroku[web.1]: Starting process with command `npm start`
2022-02-08T01:07:22.192406+00:00 app[web.1]:
2022-02-08T01:07:22.192420+00:00 app[web.1]: > movie_api#1.0.0 start
2022-02-08T01:07:22.192420+00:00 app[web.1]: > node index.js
2022-02-08T01:07:22.192420+00:00 app[web.1]:
2022-02-08T01:07:22.590438+00:00 app[web.1]: node:internal/modules/cjs/loader:1183
2022-02-08T01:07:22.590456+00:00 app[web.1]: return process.dlopen(module, path.toNamespacedPath(filename));
2022-02-08T01:07:22.590456+00:00 app[web.1]: ^
2022-02-08T01:07:22.590457+00:00 app[web.1]:
2022-02-08T01:07:22.590458+00:00 app[web.1]: Error: /app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: invalid ELF header
2022-02-08T01:07:22.590458+00:00 app[web.1]: at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
2022-02-08T01:07:22.590459+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-02-08T01:07:22.590459+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12)
2022-02-08T01:07:22.590459+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:1005:19)
2022-02-08T01:07:22.590460+00:00 app[web.1]: at require (node:internal/modules/cjs/helpers:102:18)
2022-02-08T01:07:22.590460+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2022-02-08T01:07:22.590460+00:00 app[web.1]: at Module._compile (node:internal/modules/cjs/loader:1101:14)
2022-02-08T01:07:22.590460+00:00 app[web.1]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
2022-02-08T01:07:22.590460+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-02-08T01:07:22.590461+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
2022-02-08T01:07:22.590461+00:00 app[web.1]: code: 'ERR_DLOPEN_FAILED'
2022-02-08T01:07:22.590461+00:00 app[web.1]: }
2022-02-08T01:07:22.717250+00:00 heroku[web.1]: Process exited with status 1
2022-02-08T01:07:22.786581+00:00 heroku[web.1]: State changed from starting to crashed
2022-02-08T01:07:22.825527+00:00 heroku[web.1]: State changed from crashed to starting
2022-02-08T01:07:25.399388+00:00 heroku[web.1]: Starting process with command `npm start`
2022-02-08T01:07:26.987095+00:00 app[web.1]:
2022-02-08T01:07:26.987107+00:00 app[web.1]: > movie_api#1.0.0 start
2022-02-08T01:07:26.987107+00:00 app[web.1]: > node index.js
2022-02-08T01:07:26.987108+00:00 app[web.1]:
2022-02-08T01:07:27.610704+00:00 app[web.1]: node:internal/modules/cjs/loader:1183
2022-02-08T01:07:27.610728+00:00 app[web.1]: return process.dlopen(module, path.toNamespacedPath(filename));
2022-02-08T01:07:27.610729+00:00 app[web.1]: ^
2022-02-08T01:07:27.610730+00:00 app[web.1]:
2022-02-08T01:07:27.610731+00:00 app[web.1]: Error: /app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: invalid ELF header
2022-02-08T01:07:27.610731+00:00 app[web.1]: at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
2022-02-08T01:07:27.610732+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-02-08T01:07:27.610733+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12)
2022-02-08T01:07:27.610733+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:1005:19)
2022-02-08T01:07:27.610733+00:00 app[web.1]: at require (node:internal/modules/cjs/helpers:102:18)
2022-02-08T01:07:27.610733+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2022-02-08T01:07:27.610734+00:00 app[web.1]: at Module._compile (node:internal/modules/cjs/loader:1101:14)
2022-02-08T01:07:27.610734+00:00 app[web.1]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
2022-02-08T01:07:27.610734+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-02-08T01:07:27.610735+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
2022-02-08T01:07:27.610735+00:00 app[web.1]: code: 'ERR_DLOPEN_FAILED'
2022-02-08T01:07:27.610735+00:00 app[web.1]: }
2022-02-08T01:07:27.789789+00:00 heroku[web.1]: Process exited with status 1
2022-02-08T01:07:27.876090+00:00 heroku[web.1]: State changed from starting to crashed
I have tried all tricks including many suggested here but it has not been helpful.
Of course, my package.json has this script. "start": "node index.js",
Could anyone help with a precise solution?
npm uninstall bcrypt
npm install bcryptjs
npm install bcrypt
All Good! nodejs v16.16.0
The issue was probably connected the caches in the Node_Modules. I fixed this issue by running this in the terminal:
$ git rm -r --cached .
$ git add .
$ git commit -m "fixed untracked files"
Use bcryptjs instead of bcrypt
$ npm uninstall bcrypt
$ npm install bcryptjs
Regarding the answers that involve using bcryptjs! Make sure you also change the require statement(s) to accurately reflect bcryptjs instead of bcrypt.
$ npm uninstall bcrypt
$ npm install bcryptjs
Above code is what you would need to run in the server component of your app!
Below is the code in the applicable files that require bcrypt but will now require bcryptjs
const <name> = require('bcryptjs');
hello i created an app based on a tutorial that works properly on my local. I use a sqlite in memory database (for development) and when i deploy i get the following error. Please tell me what details (i couldnt put the full log it was detected as spam) you need i am a newbie in node/hapi and heroku. THank you.
2020-03-27T13:21:21.337440+00:00 app[web.1]: /app/lib/models/index.js:7
2020-03-27T13:21:21.337489+00:00 app[web.1]: const dbSettings = Settings[Settings.env].db;
2020-03-27T13:21:21.337490+00:00 app[web.1]: ^
2020-03-27T13:21:21.337498+00:00 app[web.1]:
2020-03-27T13:21:21.337506+00:00 app[web.1]: TypeError: Cannot read property 'db' of undefined
2020-03-27T13:21:21.337507+00:00 app[web.1]: at Object. (/app/lib/models/index.js:7:43)
2020-03-27T13:21:21.337507+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1158:30)
2020-03-27T13:21:21.337514+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
2020-03-27T13:21:21.337515+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:1002:32)
2020-03-27T13:21:21.337516+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:901:14)
2020-03-27T13:21:21.337516+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:1044:19)
2020-03-27T13:21:21.337516+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:77:18)
2020-03-27T13:21:21.337516+00:00 app[web.1]: at Object. (/app/lib/controllers/home.js:3:16)
2020-03-27T13:21:21.337517+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1158:30)
2020-03-27T13:21:21.337517+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
2020-03-27T13:21:21.337517+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:1002:32)
2020-03-27T13:21:21.337517+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:901:14)
2020-03-27T13:21:21.337518+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:1044:19)
2020-03-27T13:21:21.337518+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:77:18)
2020-03-27T13:21:21.337518+00:00 app[web.1]: at Object. (/app/lib/routes.js:3:14)
2020-03-27T13:21:21.337518+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1158:30)
2020-03-27T13:21:21.337519+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
2020-03-27T13:21:21.337519+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:1002:32)
2020-03-27T13:21:21.337519+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:901:14)
2020-03-27T13:21:21.337519+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:1044:19)
2020-03-27T13:21:21.337520+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:77:18)
2020-03-27T13:21:21.337520+00:00 app[web.1]: at Object. (/app/server.js:7:16)
2020-03-27T13:21:25.387251+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=serene-scrubland-72461.herokuapp.com request_id=34632d56-e244-40de-b954-6854c2b08c7f fwd="86.250.193.144" dyno= connect= service= status=503 bytes= protocol=https
2020-03-27T13:21:25.624603+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=serene-scrubland-72461.herokuapp.com request_id=123f2cd5-5644-4b53-97d3-183248ef8a7a fwd="86.250.193.144" dyno= connect= service= status=503 bytes= protocol=https
solved by using postgres addons from heroku
I am a newbie in heroku and node.js and I would like to get to know how these work. I tried the tutorial given by heroku. Everthing is fine until this step. I pushed and tried to open in on the web, but doesn't work. Logs said it cannot find the module, meanwhile I've installed it using npm.
I tried 3 times using different new clone but nonetheless none worked. I also copied all the index.js script given on the tutorial.
index:
const cool = require('cool-ascii-faces')
const express = require('express')
const path = require('path')
const PORT = process.env.PORT || 5000
express()
.use(express.static(path.join(__dirname, 'public')))
.set('views', path.join(__dirname, 'views'))
.set('view engine', 'ejs')
.get('/', (req, res) => res.render('pages/index'))
.get('/cool', (req, res) => res.send(cool()))
.listen(PORT, () => console.log(`Listening on ${ PORT }`))
logs:
2019-05-09T09:56:08.000000+00:00 app[api]: Build succeeded
2019-05-09T09:56:08.892352+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2019-05-09T09:56:08.986034+00:00 heroku[web.1]: Process exited with status 143
2019-05-09T09:56:09.884923+00:00 heroku[web.1]: Starting process with command `node index.js`
2019-05-09T09:56:11.789509+00:00 heroku[web.1]: State changed from starting to crashed
2019-05-09T09:56:11.800910+00:00 heroku[web.1]: State changed from crashed to starting
2019-05-09T09:56:11.773890+00:00 heroku[web.1]: Process exited with status 1
2019-05-09T09:56:11.731995+00:00 app[web.1]: internal/modules/cjs/loader.js:584
2019-05-09T09:56:11.732041+00:00 app[web.1]: throw err;
2019-05-09T09:56:11.732043+00:00 app[web.1]: ^
2019-05-09T09:56:11.732044+00:00 app[web.1]:
2019-05-09T09:56:11.732045+00:00 app[web.1]: Error: Cannot find module 'cool-ascii-faces'
2019-05-09T09:56:11.732047+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
2019-05-09T09:56:11.732048+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:508:25)
2019-05-09T09:56:11.732049+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:637:17)
2019-05-09T09:56:11.732050+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:22:18)
2019-05-09T09:56:11.732052+00:00 app[web.1]: at Object.<anonymous> (/app/index.js:1:76)
2019-05-09T09:56:11.732053+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:701:30)
2019-05-09T09:56:11.732054+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
2019-05-09T09:56:11.732055+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:600:32)
2019-05-09T09:56:11.732056+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
2019-05-09T09:56:11.732058+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:531:3)
2019-05-09T09:56:14.928577+00:00 heroku[web.1]: Starting process with command `node index.js`
2019-05-09T09:56:17.311684+00:00 heroku[web.1]: State changed from starting to crashed
2019-05-09T09:56:17.291125+00:00 heroku[web.1]: Process exited with status 1
2019-05-09T09:56:17.224570+00:00 app[web.1]: internal/modules/cjs/loader.js:584
2019-05-09T09:56:17.224594+00:00 app[web.1]: throw err;
2019-05-09T09:56:17.224596+00:00 app[web.1]: ^
2019-05-09T09:56:17.224598+00:00 app[web.1]:
2019-05-09T09:56:17.224600+00:00 app[web.1]: Error: Cannot find module 'cool-ascii-faces'
2019-05-09T09:56:17.224601+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
2019-05-09T09:56:17.224603+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:508:25)
2019-05-09T09:56:17.224605+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:637:17)
2019-05-09T09:56:17.224609+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:22:18)
2019-05-09T09:56:17.224610+00:00 app[web.1]: at Object.<anonymous> (/app/index.js:1:76)
2019-05-09T09:56:17.224612+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:701:30)
2019-05-09T09:56:17.224614+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
2019-05-09T09:56:17.224615+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:600:32)
2019-05-09T09:56:17.224617+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
2019-05-09T09:56:17.224618+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:531:3)
2019-05-09T09:56:19.017142+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/cool" host=immense-oasis-20574.herokuapp.com request_id=b24f9916-5042-4b41-9034-e5421063b37f fwd="87.187.232.81" dyno= connect= service= status=503 bytes= protocol=https
2019-05-09T10:09:56.847796+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=immense-oasis-20574.herokuapp.com request_id=62b8f104-be58-49f5-9b45-82603b0cc1a9 fwd="87.187.232.81" dyno= connect= service= status=503 bytes= protocol=https
You have to run npm install --save cool-ascii-faces.
Heroku get the packages from your package.json and not from the node_modules folder. You should actually never commit it by adding it to your .gitignore file.
I am new to deploying Github projects to Heroku. So far, I have connected my app to Heroku successfully and have deployed. The project runs fine on my local machine. However, when I tried to launch the heroku website of my app, it gave me this error:
"An error occurred in the application and your page could not be
served. Please try again in a few moments.
If you are the application owner, check your logs for details."
Here is my heroku log, which I am having trouble understanding.
2015-11-10T04:33:10.538175+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=compasss.herokuapp.com request_id=af3a9061-1b8f-47fe-9e2e-eafa624f2712 fwd="138.110.234.184" dyno= connect= service= status=503 bytes=
2015-11-10T04:33:10.649481+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=compasss.herokuapp.com request_id=e8fc1b43-f629-4e38-85c9-808d731e852e fwd="138.110.234.184" dyno= connect= service= status=503 bytes=
2015-11-10T04:33:11.334843+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=compasss.herokuapp.com request_id=149ffc6c-8a57-475c-9f64-5224bcf72bfd fwd="138.110.234.184" dyno= connect= service= status=503 bytes=
2015-11-10T04:33:12.207897+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=compasss.herokuapp.com request_id=4585d320-5d3b-43a0-ab85-a84f9734e373 fwd="138.110.234.184" dyno= connect= service= status=503 bytes=
2015-11-10T04:35:18.757410+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=compasss.herokuapp.com request_id=1d59ddd7-ff62-4b01-8b3a-df450fac5ba5 fwd="138.110.234.184" dyno= connect= service= status=503 bytes=
2015-11-10T04:35:19.737947+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=compasss.herokuapp.com request_id=2f8f9bc8-8299-4da9-bdad-eed9fa537573 fwd="138.110.234.184" dyno= connect= service= status=503 bytes=
2015-11-10T04:35:19.503853+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=compasss.herokuapp.com request_id=77870378-cde5-48e2-b4d2-e93526b1e10d fwd="138.110.234.184" dyno= connect= service= status=503 bytes=
2015-11-10T04:41:09.087924+00:00 heroku[api]: Deploy 5c325e8 by myemail#gmail.com
2015-11-10T04:41:09.087924+00:00 heroku[api]: Release v6 created by myemail#gmail.com
2015-11-10T04:41:09.271289+00:00 heroku[slug-compiler]: Slug compilation started
2015-11-10T04:41:09.271300+00:00 heroku[slug-compiler]: Slug compilation finished
2015-11-10T04:41:11.469002+00:00 heroku[web.1]: State changed from crashed to starting
2015-11-10T04:41:12.469938+00:00 heroku[web.1]: Starting process with command `node app.js`
2015-11-10T04:41:14.322786+00:00 app[web.1]: module.js:339
2015-11-10T04:41:14.322794+00:00 app[web.1]: throw err;
2015-11-10T04:41:14.322795+00:00 app[web.1]: ^
2015-11-10T04:41:14.322796+00:00 app[web.1]:
2015-11-10T04:41:14.322797+00:00 app[web.1]: Error: Cannot find module 'express3-handlebars'
2015-11-10T04:41:14.322797+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:337:15)
2015-11-10T04:41:14.322798+00:00 app[web.1]: at Function.Module._load (module.js:287:25)
2015-11-10T04:41:14.322799+00:00 app[web.1]: at Module.require (module.js:366:17)
2015-11-10T04:41:14.322799+00:00 app[web.1]: at require (module.js:385:17)
2015-11-10T04:41:14.322800+00:00 app[web.1]: at Object.<anonymous> (/app/app.js:6:18)
2015-11-10T04:41:14.322800+00:00 app[web.1]: at Module._compile (module.js:425:26)
2015-11-10T04:41:14.322801+00:00 app[web.1]: at Object.Module._extensions..js (module.js:432:10)
2015-11-10T04:41:14.322802+00:00 app[web.1]: at Module.load (module.js:356:32)
2015-11-10T04:41:14.322802+00:00 app[web.1]: at Function.Module._load (module.js:311:12)
2015-11-10T04:41:14.322803+00:00 app[web.1]: at Function.Module.runMain (module.js:457:10)
2015-11-10T04:41:15.124877+00:00 heroku[web.1]: State changed from starting to crashed
2015-11-10T04:41:15.116760+00:00 heroku[web.1]: Process exited with status 1
2015-11-10T04:44:48.813133+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=compasss.herokuapp.com request_id=81fddfea-92e6-4c64-91aa-ec5d076fb8e6 fwd="138.110.234.184" dyno= connect= service= status=503 bytes=
2015-11-10T04:44:49.590449+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=compasss.herokuapp.com request_id=efa1b5fc-5a1e-4b31-acef-5a1025e8c99d fwd="138.110.234.184" dyno= connect= service= status=503 bytes=
2015-11-10T04:44:49.955648+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=compasss.herokuapp.com request_id=4af0cf53-ea53-4361-a5d2-6a3efc51a62f fwd="138.110.234.184" dyno= connect= service= status=503 bytes=
2015-11-10T04:51:46.883632+00:00 heroku[api]: Deploy b0f6afe by myemail#gmail.com
2015-11-10T04:51:46.883703+00:00 heroku[api]: Release v7 created by myemail#gmail.com
2015-11-10T04:51:46.979243+00:00 heroku[web.1]: State changed from crashed to starting
2015-11-10T04:51:47.041376+00:00 heroku[slug-compiler]: Slug compilation started
2015-11-10T04:51:47.041386+00:00 heroku[slug-compiler]: Slug compilation finished
2015-11-10T04:51:48.436794+00:00 heroku[web.1]: Starting process with command `node app.js`
2015-11-10T04:51:50.436732+00:00 app[web.1]: module.js:339
2015-11-10T04:51:50.436759+00:00 app[web.1]: at Function.Module._load (module.js:287:25)
2015-11-10T04:51:50.436761+00:00 app[web.1]: at Module._compile (module.js:425:26)
2015-11-10T04:51:50.436754+00:00 app[web.1]: throw err;
2015-11-10T04:51:50.436756+00:00 app[web.1]:
2015-11-10T04:51:50.436763+00:00 app[web.1]: at Function.Module._load (module.js:311:12)
2015-11-10T04:51:50.436755+00:00 app[web.1]: ^
2015-11-10T04:51:50.436759+00:00 app[web.1]: at Module.require (module.js:366:17)
2015-11-10T04:51:50.436757+00:00 app[web.1]: Error: Cannot find module 'express3-handlebars'
2015-11-10T04:51:50.436758+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:337:15)
2015-11-10T04:51:50.436762+00:00 app[web.1]: at Object.Module._extensions..js (module.js:432:10)
2015-11-10T04:51:50.436764+00:00 app[web.1]: at Function.Module.runMain (module.js:457:10)
2015-11-10T04:51:50.436760+00:00 app[web.1]: at require (module.js:385:17)
2015-11-10T04:51:50.436760+00:00 app[web.1]: at Object.<anonymous> (/app/app.js:6:18)
2015-11-10T04:51:50.436762+00:00 app[web.1]: at Module.load (module.js:356:32)
2015-11-10T04:51:51.157210+00:00 heroku[web.1]: Process exited with status 1
2015-11-10T04:51:52.735586+00:00 heroku[web.1]: Starting process with command `node app.js`
2015-11-10T04:51:55.545983+00:00 app[web.1]: module.js:339
2015-11-10T04:51:55.545998+00:00 app[web.1]: throw err;
2015-11-10T04:51:55.545999+00:00 app[web.1]: ^
2015-11-10T04:51:55.545999+00:00 app[web.1]:
2015-11-10T04:51:55.546001+00:00 app[web.1]: Error: Cannot find module 'express3-handlebars'
2015-11-10T04:51:55.546002+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:337:15)
2015-11-10T04:51:55.546002+00:00 app[web.1]: at Function.Module._load (module.js:287:25)
2015-11-10T04:51:55.546003+00:00 app[web.1]: at Module.require (module.js:366:17)
2015-11-10T04:51:55.546003+00:00 app[web.1]: at require (module.js:385:17)
2015-11-10T04:51:55.546004+00:00 app[web.1]: at Object.<anonymous> (/app/app.js:6:18)
2015-11-10T04:51:55.546004+00:00 app[web.1]: at Module._compile (module.js:425:26)
2015-11-10T04:51:55.546005+00:00 app[web.1]: at Object.Module._extensions..js (module.js:432:10)
2015-11-10T04:51:55.546006+00:00 app[web.1]: at Module.load (module.js:356:32)
2015-11-10T04:51:55.546007+00:00 app[web.1]: at Function.Module.runMain (module.js:457:10)
2015-11-10T04:51:55.546006+00:00 app[web.1]: at Function.Module._load (module.js:311:12)
2015-11-10T04:51:51.172084+00:00 heroku[web.1]: State changed from starting to crashed
2015-11-10T04:51:51.173050+00:00 heroku[web.1]: State changed from crashed to starting
2015-11-10T04:51:56.492216+00:00 heroku[web.1]: Process exited with status 1
2015-11-10T04:51:56.506380+00:00 heroku[web.1]: State changed from starting to crashed
2015-11-10T04:53:27.766915+00:00 heroku[api]: Deploy 15c64ba by myemail#gmail.com
2015-11-10T04:53:27.766915+00:00 heroku[api]: Release v8 created by myemail#gmail.com
2015-11-10T04:53:27.910792+00:00 heroku[slug-compiler]: Slug compilation started
2015-11-10T04:53:27.910801+00:00 heroku[slug-compiler]: Slug compilation finished
2015-11-10T04:53:27.921730+00:00 heroku[web.1]: State changed from crashed to starting
2015-11-10T04:53:29.221014+00:00 heroku[web.1]: Starting process with command `node app.js`
2015-11-10T04:53:31.264123+00:00 app[web.1]: module.js:339
2015-11-10T04:53:31.264132+00:00 app[web.1]: throw err;
2015-11-10T04:53:31.264133+00:00 app[web.1]: ^
2015-11-10T04:53:31.264134+00:00 app[web.1]:
2015-11-10T04:53:31.264135+00:00 app[web.1]: Error: Cannot find module 'express3-handlebars'
2015-11-10T04:53:31.264136+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:337:15)
2015-11-10T04:53:31.264136+00:00 app[web.1]: at Function.Module._load (module.js:287:25)
2015-11-10T04:53:31.264137+00:00 app[web.1]: at Module.require (module.js:366:17)
2015-11-10T04:53:31.264138+00:00 app[web.1]: at require (module.js:385:17)
2015-11-10T04:53:31.264138+00:00 app[web.1]: at Object.<anonymous> (/app/app.js:6:18)
2015-11-10T04:53:31.264139+00:00 app[web.1]: at Module._compile (module.js:425:26)
2015-11-10T04:53:31.264140+00:00 app[web.1]: at Object.Module._extensions..js (module.js:432:10)
2015-11-10T04:53:31.264140+00:00 app[web.1]: at Module.load (module.js:356:32)
2015-11-10T04:53:31.264141+00:00 app[web.1]: at Function.Module._load (module.js:311:12)
2015-11-10T04:53:31.264141+00:00 app[web.1]: at Function.Module.runMain (module.js:457:10)
2015-11-10T04:53:31.969583+00:00 heroku[web.1]: Process exited with status 1
2015-11-10T04:53:31.989169+00:00 heroku[web.1]: State changed from starting to crashed
2015-11-10T04:54:44.812224+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=compasss.herokuapp.com request_id=a508a64d-8a85-4d09-a610-67ef57854186 fwd="138.110.234.184" dyno= connect= service= status=503 bytes=
2015-11-10T04:54:45.733283+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=compasss.herokuapp.com request_id=1a312b38-8793-41fa-9a77-2d2e7f0c63f2 fwd="138.110.234.184" dyno= connect= service= status=503 bytes=
2015-11-10T04:54:45.461863+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=compasss.herokuapp.com request_id=47d48dc9-3e16-4b49-8b25-7b56a8b3ccad fwd="138.110.234.184" dyno= connect= service= status=503 bytes=
I'm thinking the error might be due to how I'm setting up my routes. Here is my app.js, where I specify my routes:
var express = require('express');
var app = express();
var http = require('http').Server(app);
// set up handlebars view engine
var handlebars = require('express3-handlebars')
.create({ defaultLayout:'main' });
app.engine('handlebars', handlebars.engine);
app.set('view engine', 'handlebars');
http.listen(process.env.PORT || 3000, function(){
console.log('listening on', http.address().port);
})
// Home Page
app.get('/', function(req, res){
res.render('home');
});
// About Page
app.get('/about', function(req, res){
res.render('about');
});
// 404 catch-all handler (middleware)
app.use(function(req, res){
res.status(404);
res.render('404');
});
// 500 error handler (middleware)
app.use(function(req, res){
console.error(err.stack);
res.status(500);
res.render('500');
});
app.listen(app.get('port'), function(){
console.log( 'Express started on http://localhost:' +
app.get('port') + '; press Ctrl-C to terminate.' );
});
Here is my package.json:
{
"name": "Compass",
"version": "1.0.0",
"description": "Independent Study Application",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node app.js"
},
"author": "Thao Bach",
"license": "ISC",
"dependencies": {
"express": "^4.13.3",
"express-handlebars": "^2.0.1",
"mongodb": "^2.0.46",
"monk": "^1.0.1"
},
"devDependencies": {
"archiver": "^0.15.1",
"chai": "^3.3.0",
"fs-extra": "^0.24.0",
"mocha": "^2.3.3"
}
}
Most likely you do not have npm dependency express3-handlebars mentioned in your package.json or else it is mentioned as development Dependency in your package.json file.
Also, in your app.js you are using
var handlebars = require('express3-handlebars')
.create({ defaultLayout:'main' });
you may want to change your require statement to point to express-handlebars or else include express3-handlebars as dependency