Heroke deployment app crash keeps crashing - node.js

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.

Related

Heroku deployment with node.js and postgresql api not working

I have been recently been working on a node.js api with a postgresql database that stores books.
When you go to the route /books it gives me the heroku application error page (here is the api https://node-api-with-books.herokuapp.com/books) and I followed this tutorial to make it https://www.taniarascia.com/node-express-postgresql-heroku/. It is driving me crazy and here is the error it gives when I do:
heroku logs --tail
2021-03-15T04:04:21.094893+00:00 app[web.1]: /app/index.js:12
2021-03-15T04:04:21.094902+00:00 app[web.1]: throw err;
2021-03-15T04:04:21.094903+00:00 app[web.1]: ^
2021-03-15T04:04:21.094904+00:00 app[web.1]:
2021-03-15T04:04:21.094904+00:00 app[web.1]: Error: self signed certificate
2021-03-15T04:04:21.094905+00:00 app[web.1]: at TLSSocket.onConnectSecure (node:_tls_wrap:1498:34)
2021-03-15T04:04:21.094906+00:00 app[web.1]: at TLSSocket.emit (node:events:327:20)
2021-03-15T04:04:21.094906+00:00 app[web.1]: at TLSSocket._finishInit (node:_tls_wrap:933:8)
2021-03-15T04:04:21.094907+00:00 app[web.1]: at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:707:12) {
2021-03-15T04:04:21.094907+00:00 app[web.1]: code: 'DEPTH_ZERO_SELF_SIGNED_CERT'
2021-03-15T04:04:21.094907+00:00 app[web.1]: }
2021-03-15T04:04:21.099759+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/books" host=node-api-with-books.herokuapp.com request_id=5ec4a052-1aed-4401-916d-1699f1fe9d3d fwd="66.7.125.54" dyno=web.1 connect=0ms service=50ms status=503 bytes=0 protocol=https
2021-03-15T04:04:21.100313+00:00 app[web.1]: npm notice
2021-03-15T04:04:21.100365+00:00 app[web.1]: npm notice New minor version of npm available! 7.0.8 -> 7.6.3
2021-03-15T04:04:21.100444+00:00 app[web.1]: npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.6.3>
2021-03-15T04:04:21.100541+00:00 app[web.1]: npm notice Run `npm install -g npm#7.6.3` to update!
2021-03-15T04:04:21.100619+00:00 app[web.1]: npm notice
2021-03-15T04:04:21.104741+00:00 app[web.1]: npm ERR! code 1
2021-03-15T04:04:21.104926+00:00 app[web.1]: npm ERR! path /app
2021-03-15T04:04:21.108208+00:00 app[web.1]: npm ERR! command failed
2021-03-15T04:04:21.108390+00:00 app[web.1]: npm ERR! command sh -c node index.js
2021-03-15T04:04:21.353877+00:00 app[web.1]:
2021-03-15T04:04:21.354099+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-03-15T04:04:21.354257+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-03-15T04_04_21_109Z-debug.log
2021-03-15T04:04:21.413929+00:00 heroku[web.1]: Process exited with status 1
2021-03-15T04:04:21.490613+00:00 heroku[web.1]: State changed from up to crashed
2021-03-15T04:04:21.495328+00:00 heroku[web.1]: State changed from crashed to starting
2021-03-15T04:04:24.629509+00:00 heroku[web.1]: Starting process with command `npm start`
2021-03-15T04:04:27.698683+00:00 app[web.1]:
2021-03-15T04:04:27.698698+00:00 app[web.1]: > working-rest-api#1.0.0 start
2021-03-15T04:04:27.698698+00:00 app[web.1]: > node index.js
2021-03-15T04:04:27.698698+00:00 app[web.1]:
2021-03-15T04:04:28.035756+00:00 app[web.1]: Server listening
2021-03-15T04:04:28.553149+00:00 heroku[web.1]: State changed from starting to up
2021-03-15T04:04:29.332623+00:00 app[web.1]: /app/index.js:12
2021-03-15T04:04:29.332639+00:00 app[web.1]: throw err;
2021-03-15T04:04:29.332640+00:00 app[web.1]: ^
2021-03-15T04:04:29.332641+00:00 app[web.1]:
2021-03-15T04:04:29.332641+00:00 app[web.1]: Error: self signed certificate
2021-03-15T04:04:29.332642+00:00 app[web.1]: at TLSSocket.onConnectSecure (node:_tls_wrap:1498:34)
2021-03-15T04:04:29.332643+00:00 app[web.1]: at TLSSocket.emit (node:events:327:20)
2021-03-15T04:04:29.332643+00:00 app[web.1]: at TLSSocket._finishInit (node:_tls_wrap:933:8)
2021-03-15T04:04:29.332643+00:00 app[web.1]: at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:707:12) {
2021-03-15T04:04:29.332644+00:00 app[web.1]: code: 'DEPTH_ZERO_SELF_SIGNED_CERT'
2021-03-15T04:04:29.332644+00:00 app[web.1]: }
2021-03-15T04:04:29.340112+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/books" host=node-api-with-books.herokuapp.com request_id=8af9f82c-42c9-4399-9de3-ed80f7dee15a fwd="66.7.125.54" dyno=web.1 connect=1ms service=74ms status=503 bytes=0 protocol=https
2021-03-15T04:04:29.343368+00:00 app[web.1]: npm notice
2021-03-15T04:04:29.343566+00:00 app[web.1]: npm notice New minor version of npm available! 7.0.8 -> 7.6.3
2021-03-15T04:04:29.343688+00:00 app[web.1]: npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.6.3>
2021-03-15T04:04:29.343859+00:00 app[web.1]: npm notice Run `npm install -g npm#7.6.3` to update!
2021-03-15T04:04:29.344058+00:00 app[web.1]: npm notice
2021-03-15T04:04:29.348863+00:00 app[web.1]: npm ERR! code 1
2021-03-15T04:04:29.349087+00:00 app[web.1]: npm ERR! path /app
2021-03-15T04:04:29.352585+00:00 app[web.1]: npm ERR! command failed
2021-03-15T04:04:29.352766+00:00 app[web.1]: npm ERR! command sh -c node index.js
2021-03-15T04:04:29.364318+00:00 app[web.1]:
2021-03-15T04:04:29.364464+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-03-15T04:04:29.364515+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-03-15T04_04_29_354Z-debug.log
2021-03-15T04:04:29.443525+00:00 heroku[web.1]: Process exited with status 1
2021-03-15T04:04:29.510747+00:00 heroku[web.1]: State changed from up to crashed
I can add you on heroku if you have a idea
Here is my code on github https://github.com/PugmanD/gticlicker-api-and-book-api/tree/main
Any help is appreciated
After trying with the uploaded repo. I've confirmed the error lies at the following place
config.js
const pool = new Pool({
connectionString: isProduction ? process.env.DATABASE_URL : connectionString,
ssl: isProduction, // The problem is this setting
});
Update your config.js to following
const pool = new Pool({
connectionString: isProduction ? process.env.DATABASE_URL : connectionString,
ssl: {
rejectUnauthorized: false,
},
});
node-postgres did show how to setup the SSL in their documentation
https://node-postgres.com/features/ssl
The problem why u faced this is most likely that the node-postgres couldn't find your SSL cert, hence the error.
This is the heroku link that I've make it working, I will remove the project in a few days. Feel free to try it.
https://test-postgresl.herokuapp.com/books

Unable to push MERN App to heroku servers

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.

Heroku - Mongoose App keep getting same error: MongoError: failed to connect to server [process.env.MONGOLAB_URI:*****] on first connect

Here is the heroku logs. I've gotten this failed to connect error about 7 tries in a row now and the application won't run. What gives? I am trying to deploy this backend API app to heroku.
I have also installed all my packages including mongoose-unique-validator.
2016-10-04T22:38:20.978272+00:00 heroku[web.1]: Starting process with
command `npm start`
2016-10-04T22:38:24.273558+00:00 app[web.1]:
2016-10-04T22:38:24.273583+00:00 app[web.1]: > roomie_api#1.0.0 start /app
2016-10-04T22:38:24.273584+00:00 app[web.1]: > node index.js
2016-10-04T22:38:24.273585+00:00 app[web.1]:
2016-10-04T22:38:25.332290+00:00 app[web.1]:
2016-10-04T22:38:25.332301+00:00 app[web.1]: /app/node_modules/mongodb/lib/server.js:261
2016-10-04T22:38:25.332303+00:00 app[web.1]: process.nextTick(function() { throw err; })
2016-10-04T22:38:25.332303+00:00 app[web.1]: ^
2016-10-04T22:38:25.334773+00:00 app[web.1]: MongoError: failed to connect to server [process.env.MONGOLAB_URI:*****] on first connect
2016-10-04T22:38:25.334775+00:00 app[web.1]: at null.<anonymous> (/app/node_modules/mongodb-core/lib/topologies/server.js:313:35)
2016-10-04T22:38:25.334776+00:00 app[web.1]: at emitOne (events.js:90:13)
2016-10-04T22:38:25.334777+00:00 app[web.1]: at emit (events.js:182:7)
2016-10-04T22:38:25.334777+00:00 app[web.1]: at null.<anonymous> (/app/node_modules/mongodb-core/lib/connection/pool.js:260:12)
2016-10-04T22:38:25.334778+00:00 app[web.1]: at g (events.js:273:16)
2016-10-04T22:38:25.334779+00:00 app[web.1]: at emitTwo (events.js:100:13)
2016-10-04T22:38:25.334779+00:00 app[web.1]: at emit (events.js:185:7)
2016-10-04T22:38:25.334780+00:00 app[web.1]: at Socket.<anonymous> (/app/node_modules/mongodb-core/lib/connection/connection.js:162:49)
2016-10-04T22:38:25.334780+00:00 app[web.1]: at Socket.g (events.js:273:16)
2016-10-04T22:38:25.334781+00:00 app[web.1]: at emitOne (events.js:90:13)
2016-10-04T22:38:25.334781+00:00 app[web.1]: at Socket.emit (events.js:182:7)
2016-10-04T22:38:25.334782+00:00 app[web.1]: at connectErrorNT (net.js:1010:8)
2016-10-04T22:38:25.334783+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:74:11)
2016-10-04T22:38:25.334784+00:00 app[web.1]: at process._tickCallback (internal/process/next_tick.js:98:9)
2016-10-04T22:38:25.357010+00:00 app[web.1]:
2016-10-04T22:38:25.374557+00:00 app[web.1]: npm ERR! Linux 3.13.0-95-generic
2016-10-04T22:38:25.377519+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-10-04T22:38:25.377837+00:00 app[web.1]: npm ERR! node v5.11.1
2016-10-04T22:38:25.378727+00:00 app[web.1]: npm ERR! npm v3.8.6
2016-10-04T22:38:25.378996+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2016-10-04T22:38:25.379139+00:00 app[web.1]: npm ERR! roomie_api#1.0.0 start: `node index.js`
2016-10-04T22:38:25.379318+00:00 app[web.1]: npm ERR! Exit status 1
2016-10-04T22:38:25.379514+00:00 app[web.1]: npm ERR!
2016-10-04T22:38:25.379699+00:00 app[web.1]: npm ERR! Failed at the roomie_api#1.0.0 start script 'node index.js'.
2016-10-04T22:38:25.379885+00:00 app[web.1]: npm ERR! Make sure you have the latest version of node.js and npm installed.
2016-10-04T22:38:25.380406+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2016-10-04T22:38:25.380060+00:00 app[web.1]: npm ERR! If you do, this is most likely a problem with the roomie_api package,
2016-10-04T22:38:25.380227+00:00 app[web.1]: npm ERR! not with npm itself.
2016-10-04T22:38:25.380596+00:00 app[web.1]: npm ERR! node index.js
2016-10-04T22:38:25.380769+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2016-10-04T22:38:25.380946+00:00 app[web.1]: npm ERR! npm bugs roomie_api
2016-10-04T22:38:25.381111+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:
2016-10-04T22:38:25.381291+00:00 app[web.1]: npm ERR! npm owner ls roomie_api
2016-10-04T22:38:25.381460+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2016-10-04T22:38:25.393677+00:00 app[web.1]:
2016-10-04T22:38:25.393683+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-10-04T22:38:25.393684+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-10-04T22:38:25.528779+00:00 heroku[web.1]: State changed from starting to crashed
2016-10-04T22:38:25.518263+00:00 heroku[web.1]: Process exited with status 1
2016-10-04T22:43:00.087160+00:00 heroku[api]: Deploy 504f79b by ************
2016-10-04T22:43:00.087217+00:00 heroku[api]: Release v9 created by ****************
2016-10-04T22:43:00.262314+00:00 heroku[slug-compiler]: Slug compilation started
2016-10-04T22:43:00.262323+00:00 heroku[slug-compiler]: Slug compilation finished
2016-10-04T22:43:00.509478+00:00 heroku[web.1]: State changed from crashed to starting
2016-10-04T22:43:01.920370+00:00 heroku[web.1]: Starting process with command `npm start`
2016-10-04T22:43:03.921615+00:00 app[web.1]:
2016-10-04T22:43:03.921629+00:00 app[web.1]: > roomie_api#1.0.0 start /app
2016-10-04T22:43:03.921630+00:00 app[web.1]: > nodemon index.js
2016-10-04T22:43:03.921631+00:00 app[web.1]:
2016-10-04T22:43:04.226979+00:00 app[web.1]: [nodemon] 1.10.2
2016-10-04T22:43:04.230852+00:00 app[web.1]: [nodemon] to restart at any time, enter `rs`
2016-10-04T22:43:04.230854+00:00 app[web.1]: [nodemon] watching: *.*
2016-10-04T22:43:04.230855+00:00 app[web.1]: [nodemon] starting `node index.js`
2016-10-04T22:43:04.800845+00:00 app[web.1]:
2016-10-04T22:43:04.800856+00:00 app[web.1]: /app/node_modules/mongodb/lib/server.js:261
2016-10-04T22:43:04.800857+00:00 app[web.1]: process.nextTick(function() { throw err; })
2016-10-04T22:43:04.800858+00:00 app[web.1]: ^
2016-10-04T22:43:04.801623+00:00 app[web.1]: MongoError: failed to connect to server [localhost:27017] on first connect
2016-10-04T22:43:04.801625+00:00 app[web.1]: at null.<anonymous> (/app/node_modules/mongodb-core/lib/topologies/server.js:313:35)
2016-10-04T22:43:04.801626+00:00 app[web.1]: at emitOne (events.js:90:13)
2016-10-04T22:43:04.801627+00:00 app[web.1]: at emit (events.js:182:7)
2016-10-04T22:43:04.801628+00:00 app[web.1]: at null.<anonymous> (/app/node_modules/mongodb-core/lib/connection/pool.js:260:12)
2016-10-04T22:43:04.801628+00:00 app[web.1]: at g (events.js:273:16)
2016-10-04T22:43:04.801629+00:00 app[web.1]: at emitTwo (events.js:100:13)
2016-10-04T22:43:04.801629+00:00 app[web.1]: at emit (events.js:185:7)
2016-10-04T22:43:04.801644+00:00 app[web.1]: at Socket.<anonymous> (/app/node_modules/mongodb-core/lib/connection/connection.js:162:49)
2016-10-04T22:43:04.801645+00:00 app[web.1]: at Socket.g (events.js:273:16)
2016-10-04T22:43:04.801645+00:00 app[web.1]: at emitOne (events.js:90:13)
2016-10-04T22:43:04.801646+00:00 app[web.1]: at Socket.emit (events.js:182:7)
2016-10-04T22:43:04.801646+00:00 app[web.1]: at emitErrorNT (net.js:1265:8)
2016-10-04T22:43:04.801647+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:74:11)
2016-10-04T22:43:04.801648+00:00 app[web.1]: at process._tickCallback (internal/process/next_tick.js:98:9)
2016-10-04T22:43:04.806979+00:00 app[web.1]: [nodemon] app crashed - waiting for file changes before starting...
Here is my setup in node index.js:
var express = require("express");
var app = express();
var mongoose = require("mongoose");
var port = process.env.PORT || 7000;
var bodyParser = require("body-parser");
var cors = require("cors");
var expressJWT = require("express-jwt");
var uri = process.env.MONGOLAB_URI || process.env.MONGOHQ_URL || 'mongodb://localhost/roomietrack'
var db = mongoose.connect(uri);
var User = require("./models/user.model");
var Request = require("./models/request.model");
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}))
app.use(cors());
Your last error (based on timestamp) is
MongoError: failed to connect to server [localhost:27017]
which tries to connect to localhost after your latest deploy 504f79b, so I will assume that process.env.MONGOLAB_URI:***** might be a previous error on your code that got fixed.
Are you sure you added mongolab addon?
Also, are you sure you have MONGOLAB_URI environment setting properly setup?
Yo can check it on heroku dashboard going to your app "settings" page or by using the cli
$ heroku config --app your_heroku_app_name_here
You will have to start the server seperately in another terminal.
By running the command "mongod" in the command prompt, you can do this

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.

Resources