Unable to push MERN App to heroku servers - node.js

So I have this MERN app pushed to my github repo https://github.com/Banialczele/coursemanagement and now I would like to push that repo to heroku.
My problem is that when ever I try to deploy my app to heroku server it deploys to server, but when I want to visit that link I got an error. However when I try to run heroku local web in my IDE my app runs perfectly, but when I want to deploy to server something is crushing all the time. This is what stacktrace looks like:
2020-03-14T12:25:20.748376+00:00 app[web.1]: [1] Error: Cannot find module 'express'
2020-03-14T12:25:20.748376+00:00 app[web.1]: [1] Require stack:
2020-03-14T12:25:20.748376+00:00 app[web.1]: [1] - /app/server/src/index.js
2020-03-14T12:25:20.748378+00:00 app[web.1]: [1] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
2020-03-14T12:25:20.748379+00:00 app[web.1]: [1] at Function.Module._load (internal/modules/cjs/loader.js:864:27)
2020-03-14T12:25:20.748379+00:00 app[web.1]: [1] at Module.require (internal/modules/cjs/loader.js:1044:19)
2020-03-14T12:25:20.748380+00:00 app[web.1]: [1] at require (internal/modules/cjs/helpers.js:77:18)
2020-03-14T12:25:20.748380+00:00 app[web.1]: [1] at Object.<anonymous> (/app/server/src/index.js:1:17)
2020-03-14T12:25:20.748380+00:00 app[web.1]: [1] at Module._compile (internal/modules/cjs/loader.js:1158:30)
2020-03-14T12:25:20.748380+00:00 app[web.1]: [1] at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
2020-03-14T12:25:20.748381+00:00 app[web.1]: [1] at Module.load (internal/modules/cjs/loader.js:1002:32)
2020-03-14T12:25:20.748381+00:00 app[web.1]: [1] at Function.Module._load (internal/modules/cjs/loader.js:901:14)
2020-03-14T12:25:20.748381+00:00 app[web.1]: [1] at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) {
2020-03-14T12:25:20.748381+00:00 app[web.1]: [1] code: 'MODULE_NOT_FOUND',
2020-03-14T12:25:20.748382+00:00 app[web.1]: [1] requireStack: [ '/app/server/src/index.js' ]
2020-03-14T12:25:20.748382+00:00 app[web.1]: [1] }
2020-03-14T12:25:20.756503+00:00 app[web.1]: [1] npm ERR! code ELIFECYCLE
2020-03-14T12:25:20.756505+00:00 app[web.1]: [1] npm ERR! errno 1
2020-03-14T12:25:20.759707+00:00 app[web.1]: [1] npm ERR! teachercourseapp#1.0.0 server: `cd server/src && node index.js`
2020-03-14T12:25:20.760641+00:00 app[web.1]: [1] npm ERR! Exit status 1
2020-03-14T12:25:20.760642+00:00 app[web.1]: [1] npm ERR!
2020-03-14T12:25:20.760643+00:00 app[web.1]: [1] npm ERR! Failed at the teachercourseapp#1.0.0 server script.
2020-03-14T12:25:20.760644+00:00 app[web.1]: [1] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-03-14T12:25:20.769172+00:00 app[web.1]: [1]
2020-03-14T12:25:20.771168+00:00 app[web.1]: [1] npm ERR! A complete log of this run can be found in:
2020-03-14T12:25:20.771169+00:00 app[web.1]: [1] npm ERR! /app/.npm/_logs/2020-03-14T12_25_20_761Z-debug.log
2020-03-14T12:25:20.779534+00:00 app[web.1]: [1] npm run server exited with code 1
2020-03-14T12:25:21.019553+00:00 app[web.1]: [0]
2020-03-14T12:25:21.019562+00:00 app[web.1]: [0] > coursemanagement#0.1.0 start /app/client
2020-03-14T12:25:21.019563+00:00 app[web.1]: [0] > react-scripts start
2020-03-14T12:25:21.019563+00:00 app[web.1]: [0]
2020-03-14T12:25:21.024669+00:00 app[web.1]: [0] sh: 1: react-scripts: not found
2020-03-14T12:25:21.029965+00:00 app[web.1]: [0] npm ERR! code ELIFECYCLE
2020-03-14T12:25:21.029966+00:00 app[web.1]: [0] npm ERR! syscall spawn
2020-03-14T12:25:21.030363+00:00 app[web.1]: npm ERR! file sh
2020-03-14T12:25:21.030364+00:00 app[web.1]: [0] npm ERR! errno ENOENT
2020-03-14T12:25:21.031948+00:00 app[web.1]: [0] npm ERR! coursemanagement#0.1.0 start: `react-scripts start`
2020-03-14T12:25:21.031949+00:00 app[web.1]: [0] npm ERR! spawn ENOENT
2020-03-14T12:25:21.031949+00:00 app[web.1]: [0] npm ERR!
2020-03-14T12:25:21.033375+00:00 app[web.1]: npm ERR! Failed at the coursemanagement#0.1.0 start script.
2020-03-14T12:25:21.033376+00:00 app[web.1]: [0] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-03-14T12:25:21.037820+00:00 app[web.1]: [0] npm WARN Local package.json exists, but node_modules missing, did you mean to install?
2020-03-14T12:25:21.038198+00:00 app[web.1]: [0]
2020-03-14T12:25:21.038591+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-03-14T12:25:21.038592+00:00 app[web.1]: [0] npm ERR! /app/.npm/_logs/2020-03-14T12_25_21_032Z-debug.log
2020-03-14T12:25:21.047517+00:00 app[web.1]: [0] npm ERR! code ELIFECYCLE
2020-03-14T12:25:21.047518+00:00 app[web.1]: [0] npm ERR! errno 1
2020-03-14T12:25:21.048896+00:00 app[web.1]: [0] npm ERR! teachercourseapp#1.0.0 client: `cd client/src && npm start`
2020-03-14T12:25:21.048897+00:00 app[web.1]: [0] npm ERR! Exit status 1
2020-03-14T12:25:21.048897+00:00 app[web.1]: [0] npm ERR!
2020-03-14T12:25:21.049322+00:00 app[web.1]: npm ERR! Failed at the teachercourseapp#1.0.0 client script.
2020-03-14T12:25:21.049753+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-03-14T12:25:21.055102+00:00 app[web.1]: [0]
2020-03-14T12:25:21.055708+00:00 app[web.1]: [0] npm ERR! A complete log of this run can be found in:
2020-03-14T12:25:21.055709+00:00 app[web.1]: [0] npm ERR! /app/.npm/_logs/2020-03-14T12_25_21_050Z-debug.log
2020-03-14T12:25:21.060294+00:00 app[web.1]: [0] npm run client exited with code 1
2020-03-14T12:25:21.067946+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-03-14T12:25:21.068281+00:00 app[web.1]: npm ERR! errno 1
2020-03-14T12:25:21.069285+00:00 app[web.1]: npm ERR! teachercourseapp#1.0.0 start: `concurrently "npm run client" "npm run server" `
2020-03-14T12:25:21.069440+00:00 app[web.1]: npm ERR! Exit status 1
2020-03-14T12:25:21.069684+00:00 app[web.1]: npm ERR!
2020-03-14T12:25:21.069864+00:00 app[web.1]: npm ERR! Failed at the teachercourseapp#1.0.0 start script.
2020-03-14T12:25:21.070045+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-03-14T12:25:21.075605+00:00 app[web.1]:
2020-03-14T12:25:21.075900+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-03-14T12:25:21.076095+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-03-14T12_25_21_070Z-debug.log
2020-03-14T12:25:21.194915+00:00 heroku[web.1]: State changed from starting to crashed
2020-03-14T12:25:21.175761+00:00 heroku[web.1]: Process exited with status 1
2020-03-14T12:25:22.079114+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=managingcourses.herokuapp.com request_id=175c1aa8-0966-4493-a328-ed303e4b8075 fwd="188.123.215.228
" dyno= connect= service= status=503 bytes= protocol=https
2020-03-14T12:25:22.577434+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=managingcourses.herokuapp.com request_id=912f071c-c6c0-49ce-996d-33005e324fb1 fwd="188.
123.215.228" dyno= connect= service= status=503 bytes= protocol=https
It starts with cannot find express module, but I've reinstalled it with --save flag and nothing changes. Could you please help me try to figure this out? I'm stack for like 2 days with that error.

Following the comment, I post where the problem is:
Heroku is looking at the package.json located at the root of your project. You installed express in the server folder but the file at the root does not contain it.
Either you can push a subtree of your repository:
git subtree push --prefix path/to/subdirectory heroku master
Or just split up your server and client parts into two repositories.

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

Heroke deployment app crash keeps crashing

I know, I know, this may have been asked many times, but I just don't understand the error message. I'm not able to follow the error stack below. If you guys can help locating what is causing not being able launch my app will be greatly appreciated.
db connected successfully
2017-01-19T03:34:27.564317+00:00 heroku[router]: at=info method=GET path="/images/cover.jpg" host=xxxx.herokuapp.com request_id=xxx-55ed-476d-be16-78b88axxxx fwd="45.20.xxx.xxx" dyno=web.1 connect=0ms service=28ms status=200 bytes=108308
2017-01-19T03:34:27.566725+00:00 app[web.1]: GET /images/cover.jpg 200 10.252 ms - 108029
2017-01-19T03:34:29.588301+00:00 heroku[web.1]: Process exited with status 1
2017-01-19T03:34:29.597382+00:00 heroku[web.1]: State changed from up to crashed
2017-01-19T03:34:29.475407+00:00 app[web.1]: events.js:160
2017-01-19T03:34:29.475422+00:00 app[web.1]: throw er; // Unhandled 'error' event
2017-01-19T03:34:29.475423+00:00 app[web.1]: ^
2017-01-19T03:34:29.475424+00:00 app[web.1]:
2017-01-19T03:34:29.475425+00:00 app[web.1]: Error: spawn compass ENOENT
2017-01-19T03:34:29.475426+00:00 app[web.1]: at exports._errnoException (util.js:1026:11)
2017-01-19T03:34:29.475427+00:00 app[web.1]: at Process.ChildProcess._handle.onexit (internal/child_process.js:182:32)
2017-01-19T03:34:29.475428+00:00 app[web.1]: at onErrorNT (internal/child_process.js:348:16)
2017-01-19T03:34:29.475428+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:74:11)
2017-01-19T03:34:29.475429+00:00 app[web.1]: at process._tickCallback (internal/process/next_tick.js:98:9)
2017-01-19T03:34:29.488804+00:00 app[web.1]:
2017-01-19T03:34:29.496263+00:00 app[web.1]: npm ERR! Linux 3.13.0-105-generic
2017-01-19T03:34:29.496491+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2017-01-19T03:34:29.496733+00:00 app[web.1]: npm ERR! node v6.4.0
2017-01-19T03:34:29.496934+00:00 app[web.1]: npm ERR! npm v3.10.3
2017-01-19T03:34:29.497120+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2017-01-19T03:34:29.497271+00:00 app[web.1]: npm ERR! xxxxx#1.0.0 start: `node ./bin/www`
2017-01-19T03:34:29.497396+00:00 app[web.1]: npm ERR! Exit status 1
2017-01-19T03:34:29.497536+00:00 app[web.1]: npm ERR!
You don't have compass in your path hence the error
I'm not sure how it works with Heroku but on a normal machine, you can simply install it
$ gem update --system
$ gem install compass
You can take a look at this answer and heroku buildpack multi.

Heroku + Node.js (express) - Application Error

I'm writing a basic Node.js HTTP request&response application following a step-by-step tutorial.
After deploying to Heroku if I visit the URL I get an "Application Error".
It has already happened the same. I waited some time, deleted the Heroku app, pushed the Heroku app back and it was working fine again.
Then it stopped again.
If I try GET and POST queries (via Postman) I get a "503 Service Unavailable" error.
I attach the Heroku Log that tells me to open a node issue but locally (localhost:3000) is working fine.
The error is H10 "App Crashed"
Maybe someone knows what the issue is.
I attach my Node.js code:
var express = require('express');
var bodyParser = require('body-Parser');
var _ = require('underscore');
var app = express();
var PORT = process.env.PORT || 3000;
var todos = [];
var todoNextId = 1;
app.use(bodyParser.json());
//GET /[root]
app.get('/', function (req, res) {
res.send('Todo API Root');
});
//GET /todos
app.get('/todos', function (req, res) {
res.json(todos);
});
//GET /todos/:id
app.get('/todos/:id', function (req, res) {
var todoId = parseInt(req.params.id);
var matchedToDo = _.findWhere(todos, {id: todoId});
if (matchedToDo) {
res.json(matchedToDo);
} else {
res.status(404).send();
}
});
//POST /todos
app.post('/todos', function (req, res) {
var body = _.pick(req.body, 'description', 'completed');
if (!_.isBoolean(body.completed) || !_.isString(body.description) || body.description.trim().length === 0) {
return res.status(400).send();
}
body.description = body.description.trim();
body.id = todoNextId++;
todos.push(body);
res.json(body);
});
app.listen(PORT, function (){
console.log('Express listening on port ' + PORT);
});
Thanks for helping.
2016-05-02T17:08:52.094535+00:00 heroku[api]: Enable Logplex by xxx#gmail.com 2016-05-02T17:08:52.094582+00:00 heroku[api]: Release v2 created by xxx#gmail.com
2016-05-02T17:10:19.718255+00:00 heroku[api]: Scale to web=1 by xxx#gmail.com
2016-05-02T17:10:19.719361+00:00 heroku[api]: Release v3 created by xxx#gmail.com
2016-05-02T17:10:19.719361+00:00 heroku[api]: Deploy 7c303de by xxx#gmail.com
2016-05-02T17:10:20.663812+00:00 heroku[slug-compiler]: Slug compilation started
2016-05-02T17:10:20.663829+00:00 heroku[slug-compiler]: Slug compilation finished
2016-05-02T17:10:22.387983+00:00 heroku[web.1]: Starting process with command `npm start`
2016-05-02T17:10:24.378611+00:00 app[web.1]: > todo-api#1.0.0 start /app
2016-05-02T17:10:24.378615+00:00 app[web.1]: > node server.js
2016-05-02T17:10:24.378616+00:00 app[web.1]:
2016-05-02T17:10:24.378601+00:00 app[web.1]:
2016-05-02T17:10:24.539535+00:00 app[web.1]: ^
2016-05-02T17:10:24.539505+00:00 app[web.1]: module.js:327
2016-05-02T17:10:24.539535+00:00 app[web.1]:
2016-05-02T17:10:24.539533+00:00 app[web.1]: throw err;
2016-05-02T17:10:24.539538+00:00 app[web.1]: at Module.require (module.js:353:17)
2016-05-02T17:10:24.539539+00:00 app[web.1]: at require (internal/module.js:12:17)
2016-05-02T17:10:24.539537+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:325:15)
2016-05-02T17:10:24.539538+00:00 app[web.1]: at Function.Module._load (module.js:276:25)
2016-05-02T17:10:24.539539+00:00 app[web.1]: at Object.<anonymous> (/app/server.js:2:18)
2016-05-02T17:10:24.539541+00:00 app[web.1]: at Object.Module._extensions..js (module.js:416:10)
2016-05-02T17:10:24.539543+00:00 app[web.1]: at Function.Module.runMain (module.js:441:10)
2016-05-02T17:10:24.539541+00:00 app[web.1]: at Module.load (module.js:343:32)
2016-05-02T17:10:24.539540+00:00 app[web.1]: at Module._compile (module.js:409:26)
2016-05-02T17:10:24.539536+00:00 app[web.1]: Error: Cannot find module 'body-Parser'
2016-05-02T17:10:24.552923+00:00 app[web.1]: npm ERR! Linux 3.13.0-79-generic
2016-05-02T17:10:24.553580+00:00 app[web.1]: npm ERR! node v4.4.3
2016-05-02T17:10:24.546698+00:00 app[web.1]:
2016-05-02T17:10:24.554229+00:00 app[web.1]: npm ERR! npm v2.15.1
2016-05-02T17:10:24.555005+00:00 app[web.1]: npm ERR! Exit status 1
2016-05-02T17:10:24.539542+00:00 app[web.1]: at Function.Module._load (module.js:300:12)
2016-05-02T17:10:24.554626+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2016-05-02T17:10:24.555172+00:00 app[web.1]: npm ERR!
2016-05-02T17:10:24.555617+00:00 app[web.1]: npm ERR! not with npm itself.
2016-05-02T17:10:24.555698+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2016-05-02T17:10:24.555885+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2016-05-02T17:10:24.555495+00:00 app[web.1]: npm ERR! This is most likely a problem with the todo-api package,
2016-05-02T17:10:24.554849+00:00 app[web.1]: npm ERR! todo-api#1.0.0 start: `node server.js`
2016-05-02T17:10:24.553350+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-05-02T17:10:24.556081+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:
2016-05-02T17:10:24.555346+00:00 app[web.1]: npm ERR! Failed at the todo-api#1.0.0 start script 'node server.js'.
2016-05-02T17:10:24.556309+00:00 app[web.1]: npm ERR! npm owner ls todo-api
2016-05-02T17:10:24.555786+00:00 app[web.1]: npm ERR! node server.js
2016-05-02T17:10:24.555982+00:00 app[web.1]: npm ERR! npm bugs todo-api
2016-05-02T17:10:24.556157+00:00 app[web.1]: npm ERR!
2016-05-02T17:10:24.559818+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-05-02T17:10:24.559924+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-05-02T17:10:24.556417+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2016-05-02T17:10:24.559659+00:00 app[web.1]:
2016-05-02T17:10:25.340763+00:00 heroku[web.1]: State changed from starting to crashed
2016-05-02T17:10:25.341871+00:00 heroku[web.1]: State changed from crashed to starting
2016-05-02T17:10:25.335969+00:00 heroku[web.1]: Process exited with status 1
2016-05-02T17:10:26.442330+00:00 heroku[web.1]: Starting process with command `npm start`
2016-05-02T17:10:29.267867+00:00 app[web.1]:
2016-05-02T17:10:29.267893+00:00 app[web.1]: > todo-api#1.0.0 start /app
2016-05-02T17:10:29.267895+00:00 app[web.1]:
2016-05-02T17:10:29.267894+00:00 app[web.1]: > node server.js
2016-05-02T17:10:29.703937+00:00 app[web.1]: module.js:327
2016-05-02T17:10:29.703975+00:00 app[web.1]: throw err;
2016-05-02T17:10:29.703978+00:00 app[web.1]: ^
2016-05-02T17:10:29.703978+00:00 app[web.1]:
2016-05-02T17:10:29.703985+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:325:15)
2016-05-02T17:10:29.703988+00:00 app[web.1]: at Module._compile (module.js:409:26)
2016-05-02T17:10:29.703989+00:00 app[web.1]: at Module.load (module.js:343:32)
2016-05-02T17:10:29.703990+00:00 app[web.1]: at Function.Module._load (module.js:300:12)
2016-05-02T17:10:29.721879+00:00 app[web.1]:
2016-05-02T17:10:29.733721+00:00 app[web.1]: npm ERR! Linux 3.13.0-79-generic
2016-05-02T17:10:29.703990+00:00 app[web.1]: at Function.Module.runMain (module.js:441:10)
2016-05-02T17:10:29.734824+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-05-02T17:10:29.703987+00:00 app[web.1]: at require (internal/module.js:12:17)
2016-05-02T17:10:29.703984+00:00 app[web.1]: Error: Cannot find module 'body-Parser'
2016-05-02T17:10:29.703988+00:00 app[web.1]: at Object.<anonymous> (/app/server.js:2:18)
2016-05-02T17:10:29.703986+00:00 app[web.1]: at Module.require (module.js:353:17)
2016-05-02T17:10:29.703989+00:00 app[web.1]: at Object.Module._extensions..js (module.js:416:10)
2016-05-02T17:10:29.703986+00:00 app[web.1]: at Function.Module._load (module.js:276:25)
2016-05-02T17:10:29.737258+00:00 app[web.1]: npm ERR! npm v2.15.1
2016-05-02T17:10:29.737687+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2016-05-02T17:10:29.735275+00:00 app[web.1]: npm ERR! node v4.4.3
2016-05-02T17:10:29.738035+00:00 app[web.1]: npm ERR! todo-api#1.0.0 start: `node server.js`
2016-05-02T17:10:29.738349+00:00 app[web.1]: npm ERR! Exit status 1
2016-05-02T17:10:29.738718+00:00 app[web.1]: npm ERR!
2016-05-02T17:10:29.739200+00:00 app[web.1]: npm ERR! Failed at the todo-api#1.0.0 start script 'node server.js'.
2016-05-02T17:10:29.740147+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2016-05-02T17:10:29.739540+00:00 app[web.1]: npm ERR! This is most likely a problem with the todo-api package,
2016-05-02T17:10:29.739862+00:00 app[web.1]: npm ERR! not with npm itself.
2016-05-02T17:10:29.740460+00:00 app[web.1]: npm ERR! node server.js
2016-05-02T17:10:29.740772+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2016-05-02T17:10:29.741082+00:00 app[web.1]: npm ERR! npm bugs todo-api
2016-05-02T17:10:29.741644+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:
2016-05-02T17:10:29.741966+00:00 app[web.1]: npm ERR!
2016-05-02T17:10:29.742244+00:00 app[web.1]: npm ERR! npm owner ls todo-api
2016-05-02T17:10:29.742560+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2016-05-02T17:10:29.747872+00:00 app[web.1]:
2016-05-02T17:10:29.748529+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-05-02T17:10:29.748823+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-05-02T17:10:30.824809+00:00 heroku[web.1]: Process exited with status 1
2016-05-02T17:10:30.842383+00:00 heroku[web.1]: State changed from starting to crashed
2016-05-02T17:10:34.224806+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=matteo-todo-api.herokuapp.com request_id=f4914bf6-ae6a-4390-a598-ba1e2aa6d598 fwd="2.233.72.96" dyno= connect= service= status=503 bytes=
2016-05-02T17:10:35.375423+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=matteo-todo-api.herokuapp.com request_id=69fe5fe5-9945-4a77-8ca9-564389b58aa9 fwd="2.233.72.96" dyno= connect= service= status=503 bytes=
you have wrong dependency. body-Parser should be body-parser. small "p" not capital "P".

why is my heroku app crashing?

It's my first time trying to deploy an app on heroku and I am getting an application error, code H10 and H13.
This is what I see in my log:
2016-03-13T00:12:52.715324+00:00 app[web.1]: Error: connect ECONNREFUSED 127.0.0
.1:27017
2016-03-13T00:12:52.715325+00:00 app[web.1]: at Object.exports._errnoExcepti
on (util.js:890:11)
2016-03-13T00:12:52.715325+00:00 app[web.1]: at exports._exceptionWithHostPo
rt (util.js:913:20)
2016-03-13T00:12:52.715326+00:00 app[web.1]: at TCPConnectWrap.afterConnect
[as oncomplete] (net.js:1057:14)
2016-03-13T00:12:52.723973+00:00 app[web.1]:
2016-03-13T00:12:52.731620+00:00 app[web.1]: npm ERR! Linux 3.13.0-77-generic
2016-03-13T00:12:52.732000+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bi
n/node" "/app/.heroku/node/bin/npm" "start"
2016-03-13T00:12:52.732236+00:00 app[web.1]: npm ERR! node v5.8.0
2016-03-13T00:12:52.732975+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2016-03-13T00:12:52.732648+00:00 app[web.1]: npm ERR! npm v3.7.3
2016-03-13T00:12:52.733150+00:00 app[web.1]: npm ERR! clementinejs-fcc#1.0.1 sta
rt: `node server.js`
2016-03-13T00:12:52.733317+00:00 app[web.1]: npm ERR! Exit status 1
2016-03-13T00:12:52.733490+00:00 app[web.1]: npm ERR!
2016-03-13T00:12:52.733660+00:00 app[web.1]: npm ERR! Failed at the clementinejs
-fcc#1.0.1 start script 'node server.js'.
2016-03-13T00:12:52.733828+00:00 app[web.1]: npm ERR! Make sure you have the lat
est version of node.js and npm installed.
2016-03-13T00:12:52.733992+00:00 app[web.1]: npm ERR! If you do, this is most li
kely a problem with the clementinejs-fcc package,
2016-03-13T00:12:52.734149+00:00 app[web.1]: npm ERR! not with npm itself.
2016-03-13T00:12:52.734297+00:00 app[web.1]: npm ERR! Tell the author that this
fails on your system:
2016-03-13T00:12:52.734449+00:00 app[web.1]: npm ERR! node server.js
2016-03-13T00:12:52.734593+00:00 app[web.1]: npm ERR! You can get information on
how to open an issue for this project with:
2016-03-13T00:12:52.734754+00:00 app[web.1]: npm ERR! npm bugs clementinejs-
fcc
2016-03-13T00:12:52.734901+00:00 app[web.1]: npm ERR! Or if that isn't available
, you can get their info via:
2016-03-13T00:12:52.735055+00:00 app[web.1]: npm ERR! npm owner ls clementin
ejs-fcc
2016-03-13T00:12:52.735207+00:00 app[web.1]: npm ERR! There is likely additional
logging output above.
2016-03-13T00:12:52.739195+00:00 app[web.1]:
2016-03-13T00:12:52.739538+00:00 app[web.1]: npm ERR! Please include the followi
ng file with any support request:
2016-03-13T00:12:52.739681+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-03-13T00:12:52.704158+00:00 heroku[router]: at=error code=H13 desc="Connect
ion closed without response" method=GET path="/" host=meek-fcc-voting.herokuapp.
com request_id=9479851e-9188-48c2-a73f-f5e27f36e002 fwd="151.229.234.60" dyno=we
b.1 connect=0ms service=39ms status=503 bytes=0
2016-03-13T00:12:53.331859+00:00 heroku[web.1]: State changed from crashed to st
arting
2016-03-13T00:12:53.330847+00:00 heroku[web.1]: State changed from up to crashed
2016-03-13T00:12:53.346439+00:00 heroku[web.1]: Process exited with status 1
2016-03-13T00:12:54.744232+00:00 heroku[web.1]: Starting process with command `n
pm start`
2016-03-13T00:12:57.384566+00:00 app[web.1]:
2016-03-13T00:12:57.384587+00:00 app[web.1]: > clementinejs-fcc#1.0.1 start /app
2016-03-13T00:12:57.384588+00:00 app[web.1]: > node server.js
2016-03-13T00:12:57.384589+00:00 app[web.1]:
2016-03-13T00:12:57.870106+00:00 app[web.1]: { [Error: ENOENT: no such file or d
irectory, open '.env'] errno: -2, code: 'ENOENT', syscall: 'open', path: '.env'
}
2016-03-13T00:12:57.898861+00:00 app[web.1]: Node.js listening on port 36707...
2016-03-13T00:12:58.404112+00:00 heroku[web.1]: State changed from starting to u
p
2016-03-13T00:13:02.175651+00:00 heroku[router]: at=info method=GET path="/favic
on.ico" host=meek-fcc-voting.herokuapp.com request_id=feb309ee-11e8-438c-bcdd-18
60b331cfa8 fwd="151.229.234.60" dyno=web.1 connect=5000ms service=35ms status=30
2 bytes=212
2016-03-13T00:13:02.315106+00:00 app[web.1]:
2016-03-13T00:13:02.315160+00:00 app[web.1]: /app/node_modules/mongodb/lib/serve
r.js:242
2016-03-13T00:13:02.315165+00:00 app[web.1]: process.nextTick(function()
{ throw err; })
2016-03-13T00:13:02.315166+00:00 app[web.1]:
^
2016-03-13T00:13:02.315191+00:00 app[web.1]: Error: connect ECONNREFUSED 127.0.0
.1:27017
2016-03-13T00:13:02.315193+00:00 app[web.1]: at Object.exports._errnoExcepti
on (util.js:890:11)
2016-03-13T00:13:02.315193+00:00 app[web.1]: at exports._exceptionWithHostPo
rt (util.js:913:20)
2016-03-13T00:13:02.315204+00:00 app[web.1]: at TCPConnectWrap.afterConnect
[as oncomplete] (net.js:1057:14)
2016-03-13T00:13:02.326288+00:00 app[web.1]:
2016-03-13T00:13:02.336078+00:00 app[web.1]: npm ERR! Linux 3.13.0-79-generic
2016-03-13T00:13:02.336527+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bi
n/node" "/app/.heroku/node/bin/npm" "start"
2016-03-13T00:13:02.336879+00:00 app[web.1]: npm ERR! node v5.8.0
2016-03-13T00:13:02.337616+00:00 app[web.1]: npm ERR! npm v3.7.3
2016-03-13T00:13:02.338000+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2016-03-13T00:13:02.338212+00:00 app[web.1]: npm ERR! clementinejs-fcc#1.0.1 sta
rt: `node server.js`
2016-03-13T00:13:02.338428+00:00 app[web.1]: npm ERR! Exit status 1
2016-03-13T00:13:02.338701+00:00 app[web.1]: npm ERR!
2016-03-13T00:13:02.338916+00:00 app[web.1]: npm ERR! Failed at the clementinejs
-fcc#1.0.1 start script 'node server.js'.
2016-03-13T00:13:02.339076+00:00 app[web.1]: npm ERR! Make sure you have the lat
est version of node.js and npm installed.
2016-03-13T00:13:02.339232+00:00 app[web.1]: npm ERR! If you do, this is most li
kely a problem with the clementinejs-fcc package,
2016-03-13T00:13:02.339647+00:00 app[web.1]: npm ERR! not with npm itself.
2016-03-13T00:13:02.339873+00:00 app[web.1]: npm ERR! Tell the author that this
fails on your system:
2016-03-13T00:13:02.340099+00:00 app[web.1]: npm ERR! node server.js
2016-03-13T00:13:02.340319+00:00 app[web.1]: npm ERR! You can get information on
how to open an issue for this project with:
2016-03-13T00:13:02.340932+00:00 app[web.1]: npm ERR! npm bugs clementinejs-
fcc
2016-03-13T00:13:02.341092+00:00 app[web.1]: npm ERR! Or if that isn't available
, you can get their info via:
2016-03-13T00:13:02.344061+00:00 app[web.1]: npm ERR! npm owner ls clementin
ejs-fcc
2016-03-13T00:13:02.344238+00:00 app[web.1]: npm ERR! There is likely additional
logging output above.
2016-03-13T00:13:02.349176+00:00 app[web.1]:
2016-03-13T00:13:02.349587+00:00 app[web.1]: npm ERR! Please include the followi
ng file with any support request:
2016-03-13T00:13:02.349872+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-03-13T00:13:02.335731+00:00 heroku[router]: at=error code=H13 desc="Connect
ion closed without response" method=GET path="/" host=meek-fcc-voting.herokuapp.
com request_id=e27992b9-29a9-49f7-ad05-c8b5fb610c3e fwd="151.229.234.60" dyno=we
b.1 connect=1ms service=43ms status=503 bytes=0
2016-03-13T00:13:03.171457+00:00 heroku[web.1]: Process exited with status 1
2016-03-13T00:13:03.188703+00:00 heroku[web.1]: State changed from up to crashed
2016-03-13T00:14:24.503648+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=meek-fcc-voting.herokuapp.com request_id=84c9f8a2
-2c33-4bcb-9a73-2a438b50700a fwd="151.229.234.60" dyno= connect= service= status
=503 bytes=
2016-03-13T00:14:24.879521+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/favicon.ico" host=meek-fcc-voting.herokuapp.com request_
id=7d863bd0-4287-477f-b815-9528c9ee16ac fwd="151.229.234.60" dyno= connect= serv
ice= status=503 bytes=
It mention an npm debug log, but I have no idea where to find it. It's not in the app directory of the project.
I've tried to to heroku restart with no luck. If you have any idea what I'm missing I'd very much appreciate any help.
edit:
my config vars are
APP_URL=https://meek-fcc-voting.herokuapp.com/
MONGO_URI=mongodb://localhost:27017/
You need to setup your environment variables on Heroku. You can do it via the command line, or on the Settings Page. You can also use Heroku AddOns to get a MongoDB setup for you, which automatically adds the environment variables for connecting to it.

Node.js application on Heroku: failed with exit status 8 - application-name package?

2014-08-18T06:12:54.374054+00:00 app[web.1]: npm ERR! node app.js
2014-08-18T06:12:54.374153+00:00 app[web.1]: npm ERR! You can get their info via:
2014-08-18T06:12:53.681620+00:00 app[web.1]:
2014-08-18T06:12:53.681638+00:00 app[web.1]: > application-name#0.0.1 start /app
2014-08-18T06:12:53.681641+00:00 app[web.1]: > node app.js
2014-08-18T06:12:53.681642+00:00 app[web.1]:
2014-08-18T09:08:41.257725+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2014-08-18T09:08:41.258006+00:00 app[web.1]: npm ERR! npm owner ls application-name
2014-08-18T09:08:41.257553+00:00 app[web.1]: npm ERR! This is most likely a problem with the application-name package,
2014-08-18T09:08:41.200012+00:00 app[web.1]:
2014-08-18T09:08:41.256092+00:00 app[web.1]: npm ERR! Failed at the application-name#0.0.1 start script.
2014-08-18T09:08:41.328006+00:00 app[web.1]: npm ERR! not ok code 0
2014-08-18T09:08:41.257897+00:00 app[web.1]: npm ERR! You can get their info via:
2014-08-18T09:08:41.255669+00:00 app[web.1]: npm ERR! application-name#0.0.1 start: `node app.js`
2014-08-18T09:08:41.256012+00:00 app[web.1]: npm ERR!
2014-08-18T09:08:41.255860+00:00 app[web.1]: npm ERR! Exit status 8
2014-08-18T09:08:41.260452+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2014-08-18T09:08:41.257637+00:00 app[web.1]: npm ERR! not with npm itself.
2014-08-18T09:08:41.305747+00:00 app[web.1]: npm ERR! command "/app/vendor/node/bin/node" "/app/vendor/node/bin/npm" "start"
2014-08-18T09:08:41.257819+00:00 app[web.1]: npm ERR! node app.js
2014-08-18T1
5:48:38.818790+00:00 app[web.1]: Error: Most middleware (like json) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.
2014-08-18T15:48:38.818796+00:00 app[web.1]: at Function.Object.defineProperty.get (/app/node_modules/express/lib/express.js:89:13)
2014-08-18T15:48:38.818798+00:00 app[web.1]: at Object.<anonymous> (/app/app.js:37:17)
2014-08-18T15:48:38.818800+00:00 app[web.1]: at Module._compile (module.js:456:26)
2014-08-18T15:48:38.818802+00:00 app[web.1]: at Object.Module._extensions..js (module.js:474:10)
2014-08-18T15:48:38.818803+00:00 app[web.1]: at Module.load (module.js:356:32)
2014-08-18T15:48:38.818804+00:00 app[web.1]: at Function.Module._load (module.js:312:12)
2014-08-18T15:48:38.818806+00:00 app[web.1]: at Function.Module.runMain (module.js:497:10)
2014-08-18T15:48:38.818808+00:00 app[web.1]: at startup (node.js:119:16)
2014-08-18T15:48:38.818809+00:00 app[web.1]: at node.js:906:3
2014-08-18T15:48:38.852005+00:00 app[web.1]:
2014-08-18T15:48:38.963950+00:00 app[web.1]: npm ERR! Exit status 8
2014-08-18T15:48:38.964092+00:00 app[web.1]: npm ERR!
2014-08-18T15:48:38.964243+00:00 app[web.1]: npm ERR! Failed at the application-name#0.0.1 start script.
2014-08-18T15:48:38.964845+00:00 app[web.1]: npm ERR! This is most likely a problem with the application-name package,
2014-08-18T15:48:38.964941+00:00 app[web.1]: npm ERR! not with npm itself.
2014-08-18T15:48:38.965068+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2014-08-18T15:48:38.972537+00:00 app[web.1]: npm ERR! node app.js
2014-08-18T15:48:38.972644+00:00 app[web.1]: npm ERR! You can get their info via:
2014-08-18T15:48:38.972791+00:00 app[web.1]: npm ERR! npm owner ls application-name
2014-08-18T15:48:38.972864+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2014-08-18T15:48:39.003054+00:00 app[web.1]: npm ERR! System Linux 3.8.11-ec2
2014-08-18T15:48:39.003239+00:00 app[web.1]: npm ERR! command "/app/vendor/node/bin/node" "/app/vendor/node/bin/npm" "start"
2014-08-18T15:48:39.003377+00:00 app[web.1]: npm ERR! cwd /app
2014-08-18T15:48:39.034280+00:00 app[web.1]: npm ERR! node -v v0.10.30
2014-08-18T15:48:39.034505+00:00 app[web.1]: npm ERR! npm -v 1.4.21
2014-08-18T15:48:39.034627+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2014-08-18T15:48:39.053234+00:00 app[web.1]: npm ERR!
2014-08-18T15:48:39.053356+00:00 app[web.1]: npm ERR! Additional logging details can be found in:
2014-08-18T15:48:39.053445+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2014-08-18T15:48:39.053666+00:00 app[web.1]: npm ERR! not ok code 0
2014-08-18T15:48:34.297578+00:00 app[web.1]:
2014-08-18T15:48:34.297596+00:00 app[web.1]: > application-name#0.0.1 start /app
2014-08-18T15:48:34.297598+00:00 app[web.1]: > node app.js
2014-08-18T15:48:34.297599+00:00 app[web.1]:
2014-08-18T15:48:38.807843+00:00 app[web.1]:
2014-08-18T15:48:38.963600+00:00 app[web.1]: npm ERR! application-name#0.0.1 start: `node app.js`
2014-08-19T01:18:03.335113+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/robots.txt" host=www.supercuber.com request_id=2a27f766-9eba-4b64-a2eb-be9d666cbc6f fwd="208.115.111.73" dyno= connect= service= status=503 bytes=
2014-08-19T06:27:09.423387+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=supercuber.com request_id=cc9ecb87-a01f-4d75-97c9-83327bc0ea12 fwd="188.40.249.84" dyno= connect= service= status=503 bytes=
2014-08-19T07:29:59.457621+00:00 heroku[web.1]: State changed from crashed to starting
2014-08-19T07:30:05.636929+00:00 app[web.1]:
2014-08-19T07:30:05.636950+00:00 app[web.1]:
2014-08-19T07:30:05.636947+00:00 app[web.1]: > application-name#0.0.1 start /app
2014-08-19T07:30:06.272653+00:00 app[web.1]: npm ERR! This is most likely a problem with the application-name package,
2014-08-19T07:30:06.274102+00:00 app[web.1]: npm ERR! node -v v0.10.30
2014-08-19T07:30:06.272136+00:00 app[web.1]: npm ERR! Failed at the application-name#0.0.1 start script.
2014-08-19T07:30:06.274218+00:00 app[web.1]: npm ERR! npm -v 1.4.21
2014-08-19T07:30:06.251287+00:00 app[web.1]:
2014-08-19T07:30:06.273691+00:00 app[web.1]: npm ERR! System Linux 3.8.11-ec2
2014-08-19T07:30:06.275894+00:00 app[web.1]: npm ERR!
2014-08-19T07:30:06.273411+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2014-08-19T07:30:06.276020+00:00 app[web.1]: npm ERR! Additional logging details can be found in:
2014-08-19T07:30:06.272036+00:00 app[web.1]: npm ERR!
2014-08-19T07:30:06.273990+00:00 app[web.1]: npm ERR! cwd /app
2014-08-19T07:30:05.636949+00:00 app[web.1]: > node app.js
2014-08-19T07:30:06.273008+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2014-08-19T07:30:06.273285+00:00 app[web.1]: npm ERR! npm owner ls application-name
2014-08-19T07:30:06.276125+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2014-08-19T07:30:06.273186+00:00 app[web.1]: npm ERR! You can get their info via:
2014-08-19T07:30:06.274337+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2014-08-19T07:30:06.271697+00:00 app[web.1]: npm ERR! application-name#0.0.1 start: `node app.js`
2014-08-19T07:30:06.272746+00:00 app[web.1]: npm ERR! not with npm itself.
2014-08-19T07:30:06.273099+00:00 app[web.1]: npm ERR! node app.js
2014-08-19T07:30:06.271900+00:00 app[web.1]: npm ERR! Exit status 8
2014-08-19T07:30:06.273861+00:00 app[web.1]: npm ERR! command "/app/vendor/node/bin/node" "/app/vendor/node/bin/npm" "start"
2014-08-19T07:30:07.487403+00:00 heroku[web.1]: State changed from starting to crashed
2014-08-19T13:13:46.311103+00:00 heroku[web.1]: Process exited with status 1
2014-08-19T13:13:43.465194+00:00 heroku[web.1]: Starting process with command `npm start`
2014-08-20T01:13:05.625215+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/BingSiteAuth.xml" host=www.supercuber.com request_id=60a05958-5b68-45b3-896d-4ffda351783e fwd="131.253.38.67" dyno= connect= service= status=503 bytes=
2014-08-20T01:13:05.480594+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.supercuber.com request_id=4ff53541-8a8d-43b6-a39c-db40924c9eac fwd="131.253.38.67" dyno= connect= service= status=503 bytes=
2014-08-20T02:43:17.133291+00:00 app[web.1]: > node app.js
2014-08-20T02:43:17.133270+00:00 app[web.1]:
2014-08-20T02:43:17.133292+00:00 app[web.1]:
2014-08-20T02:43:17.133289+00:00 app[web.1]: > application-name#0.0.1 start /app
2014-08-20T02:43:17.732000+00:00 app[web.1]: npm ERR!
2014-08-20T02:43:17.732121+00:00 app[web.1]: npm ERR! Failed at the application-name#0.0.1 start script.
2014-08-20T02:43:17.710159+00:00 app[web.1]:
2014-08-20T02:43:17.731539+00:00 app[web.1]: npm ERR! application-name#0.0.1 start: `node app.js`
2014-08-20T02:43:17.731795+00:00 app[web.1]: npm ERR! Exit status 8
2014-08-20T02:43:17.733311+00:00 app[web.1]: npm ERR! This is most likely a problem with the application-name package,
2014-08-20T03:10:55.501614+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.supercuber.com request_id=7ed9a3bd-755c-4d7b-bc23-1a3fa2152919 fwd="98.182.28.116" dyno= connect= service= status=503 bytes=
This is what gets output in my application logs that the error code tells me to check. My research online and here on stack overflow has shown that this error seems to appear for a large variety of use cases, and Im not sure why its appearing now? My application runs fine locally. In fact it used to run on heroku, except when I just made new changes and tried to push them to heroku this happens when I try and start the app.
Edit: here is whats in my app.js currently:
var bodyParser = require('body-parser');
var methodOverride = require('method-override');
var cookieParser = require('cookie-parser');
app.use(bodyParser());
app.use(methodOverride());
app.use(cookieParser());
npm is telling you what's wrong:
2014-08-18T15:48:38.818790+00:00 app[web.1]: Error: Most middleware (like json) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.
2014-08-18T15:48:38.818796+00:00 app[web.1]: at Function.Object.defineProperty.get (/app/node_modules/express/lib/express.js:89:13)
2014-08-18T15:48:38.818798+00:00 app[web.1]: at Object.<anonymous> (/app/app.js:37:17)
2014-08-18T15:48:38.818800+00:00 app[web.1]: at Module._compile (module.js:456:26)
2014-08-18T15:48:38.818802+00:00 app[web.1]: at Object.Module._extensions..js (module.js:474:10)
2014-08-18T15:48:38.818803+00:00 app[web.1]: at Module.load (module.js:356:32)
2014-08-18T15:48:38.818804+00:00 app[web.1]: at Function.Module._load (module.js:312:12)
2014-08-18T15:48:38.818806+00:00 app[web.1]: at Function.Module.runMain (module.js:497:10)
2014-08-18T15:48:38.818808+00:00 app[web.1]: at startup (node.js:119:16)
2014-08-18T15:48:38.818809+00:00 app[web.1]: at node.js:906:3
If you're using express 4.x.x, you must require the middleware separately.
For example, if you are using express.bodyParser(), you will need to replace it by performing the following steps:
Run npm install body-parser --save
Add this require near the top of your page with your require statements: var bodyParser = require('body-parser');
Find in your app:
app.use(express.bodyParser());
app.use(express.urlencoded());
app.use(express.json());
Replace ALL with this ONE line: app.use(bodyParser());
You must then complete these steps for all the other middleware your application uses and is listed on connect's migration guide.

Resources