I am running a React/NodeJS project on Heroku. My first time installing a project on Heroku. The deployment ran fine, but then I get the following error:
> ProductInventoryApp#1.0.0 start /app
2020-01-12T04:55:41.635051+00:00 app[web.1]: > node ./backend/app.js
2020-01-12T04:55:41.635053+00:00 app[web.1]:
2020-01-12T04:55:42.404864+00:00 app[web.1]: internal/modules/cjs/loader.js:800
2020-01-12T04:55:42.404909+00:00 app[web.1]: throw err;
2020-01-12T04:55:42.404911+00:00 app[web.1]: ^
2020-01-12T04:55:42.404913+00:00 app[web.1]:
2020-01-12T04:55:42.404916+00:00 app[web.1]: Error: Cannot find module 'CORS'
2020-01-12T04:55:42.404918+00:00 app[web.1]: Require stack:
2020-01-12T04:55:42.404921+00:00 app[web.1]: - /app/backend/app.js
2020-01-12T04:55:42.404923+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
2020-01-12T04:55:42.404925+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:690:27)
2020-01-12T04:55:42.404927+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:852:19)
2020-01-12T04:55:42.404929+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:74:18)
2020-01-12T04:55:42.404931+00:00 app[web.1]: at Object.<anonymous> (/app/backend/app.js:5:12)
2020-01-12T04:55:42.404933+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:959:30)
2020-01-12T04:55:42.404935+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
2020-01-12T04:55:42.404937+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:815:32)
2020-01-12T04:55:42.404939+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:727:14)
2020-01-12T04:55:42.404941+00:00 app[web.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
2020-01-12T04:55:42.404943+00:00 app[web.1]: at internal/main/run_main_module.js:17:11 {
2020-01-12T04:55:42.404945+00:00 app[web.1]: code: 'MODULE_NOT_FOUND',
2020-01-12T04:55:42.404946+00:00 app[web.1]: requireStack: [ '/app/backend/app.js' ]
2020-01-12T04:55:42.404948+00:00 app[web.1]: }
2020-01-12T04:55:42.427634+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-01-12T04:55:42.428331+00:00 app[web.1]: npm ERR! errno 1
2020-01-12T04:55:42.430180+00:00 app[web.1]: npm ERR! ProductInventoryApp#1.0.0 start: `node ./backend/app.js`
2020-01-12T04:55:42.430622+00:00 app[web.1]: npm ERR! Exit status 1
The cors has been included in my dependencies. So not sure where the problem lies.
package.json for nodeJS
{
"name": "ProductInventoryApp",
"version": "1.0.0",
"description": "",
"engines": {
"node": "12.13.1"
},
"main": "./backend/app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node ./backend/app.js",
"client-install": "npm install --prefix client",
"server": "nodemon ./backend/app.js",
"client": "npm start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\""
},
"author": "",
"license": "ISC",
"dependencies": {
"body-parser": "^1.19.0",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"express-validator": "^6.3.0",
"mongodb": "^3.4.0",
"mongoose": "^5.8.0",
"uuid": "^3.3.3"
},
"devDependencies": {
"concurrently": "^4.0.1",
"cors": "^2.8.5"
}
}
You need move cors package from devDependencies into dependencies. This is because heroku runs your node app in production mode, devDependencies are not installed in production mode.
Related
After running npm run dev, I get the following errors:
> sistema#1.0.0 dev
> nodemon index.js --exec babel-node
[nodemon] 1.18.9
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `babel-node index.js`
(node:20560) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
C:\Users\elvis\Documents\Proyecto Express\sistema\index.js:1
import express from 'express'; //const express=require('express');
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:984:16)
at Module._compile (internal/modules/cjs/loader.js:1032:27)
at Module._compile (C:\Users\elvis\AppData\Roaming\npm\node_modules\#babel\node\node_modules\pirates\lib\index.js:136:24)
at Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Object.newLoader [as .js] (C:\Users\elvis\AppData\Roaming\npm\node_modules\#babel\node\node_modules\pirates\lib\index.js:141:7)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at Object.<anonymous> (C:\Users\elvis\AppData\Roaming\npm\node_modules\#babel\node\lib\_babel-node.js:176:21)
at Module._compile (internal/modules/cjs/loader.js:1068:30)
[nodemon] app crashed - waiting for file changes before starting...
I have tried all the possible solutions:
Adding type module in the package.json file.
Updating babel
Using npx
This is my package.json file:
{
"name": "sistema",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node index.js",
"dev": "nodemon index.js --exec babel-node"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-preset-stage-3": "^6.24.1",
"bcryptjs": "^2.4.3",
"cors": "^2.8.5",
"express": "^4.16.4",
"express-promise-router": "^3.0.3",
"jsonwebtoken": "^8.5.0",
"mongoose": "^5.4.10",
"morgan": "^1.9.1"
},
"devDependencies": {
"nodemon": "^1.18.9"
}
}
And this is my .babelrc file:
{
"presets": [
//"env" ,
//"stage-3"
]
}
Is someone able to provide me some help or suggestions?
Thank you,
I solved this issue by installing babel with npm install babel-cli babel-core --save-dev
When I tried to deploy my app to heroku, I kept getting this error in the log
2022-05-20T14:49:35.602605+00:00 app[web.1]: > node server.js
2022-05-20T14:49:35.602605+00:00 app[web.1]:
2022-05-20T14:49:35.719423+00:00 app[web.1]: node:internal/modules/cjs/loader:936
2022-05-20T14:49:35.719424+00:00 app[web.1]: throw err;
2022-05-20T14:49:35.719425+00:00 app[web.1]: ^
2022-05-20T14:49:35.719428+00:00 app[web.1]:
2022-05-20T14:49:35.719428+00:00 app[web.1]: Error: Cannot find module 'csv-parse'
2022-05-20T14:49:35.719428+00:00 app[web.1]: Require stack:
2022-05-20T14:49:35.719429+00:00 app[web.1]: - /app/server.js
2022-05-20T14:49:35.719430+00:00 app[web.1]: at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
2022-05-20T14:49:35.719431+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:778:27)
2022-05-20T14:49:35.719431+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:1005:19)
2022-05-20T14:49:35.719431+00:00 app[web.1]: at require (node:internal/modules/cjs/helpers:102:18)
2022-05-20T14:49:35.719432+00:00 app[web.1]: at Object.<anonymous> (/app/server.js:6:15)
2022-05-20T14:49:35.719432+00:00 app[web.1]: at Module._compile (node:internal/modules/cjs/loader:1105:14)
2022-05-20T14:49:35.719432+00:00 app[web.1]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
2022-05-20T15:08:40.259973+00:00 app[web.1]: Error: Cannot find module 'express'
2022-05-20T15:08:40.259974+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:536:15)
2022-05-20T15:08:40.259974+00:00 app[web.1]: at Function.Module._load (module.js:466:25)
2022-05-20T15:08:40.259974+00:00 app[web.1]: at Module.require (module.js:579:17)
2022-05-20T15:08:40.259974+00:00 app[web.1]: at require (internal/module.js:11:18)
2022-05-20T15:08:40.259975+00:00 app[web.1]: at Object.<anonymous> (/app/server.js:5:17)
2022-05-20T15:08:40.259975+00:00 app[web.1]: at Module._compile (module.js:635:30)
2022-05-20T15:08:40.259975+00:00 app[web.1]: at Object.Module._extensions..js (module.js:646:10)
2022-05-20T15:08:40.259975+00:00 app[web.1]: at Module.load (module.js:554:32)
2022-05-20T15:08:40.259976+00:00 app[web.1]: at tryModuleLoad (module.js:497:12)
I am pretty sure the node.js application can successfully run locally and I have installed all the necessary packages in dependencies inside package.json. Not sure how to fix it....
Here is my package.json
{
"name": "Netflix User Study Framework",
"version": "1.0.0",
"description": "Encode username into prolific id",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"engines": {
"node": "8.9.3"
},
"repository": {
"type": "git",
"url": "git+https://github.com/amyhua/basic-website-template-node.git"
},
"author": "YOUR NAME GOES HERE",
"bugs": {
"url": "https://github.com/amyhua/basic-website-template-node/issues"
},
"homepage": "https://github.com/amyhua/basic-website-template-node#readme",
"dependencies": {
"aws-sdk": "^2.1139.0",
"csv-parser": "^3.0.0",
"csv-stringify": "^6.0.5",
"express": "^4.14.0",
"generate-unique-id": "^2.0.1",
"http": "0.0.0",
"multer": "^1.4.4",
"nodemon": "^1.11.0",
"os": "^0.1.2"
}
}
Also, I set up a .env file with PORT # on 3000.
when I give npm start comand its show
internal/modules/cjs/loader.js:883
throw err:
Error: Cannot finde module'webpack-cli/bin/config-yargs'
plz help me to solve this problem
use os : windows 10
node version is v14.16.1
> chapter15.1#1.0.0 start
> webpack-dev-server
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module 'webpack-cli/bin/config-yargs'
Require stack:
- C:\Users\user\Desktop\JS full Course\chapter15.1\node_modules\webpack-dev-server\bin\webpack-dev-server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (C:\Users\user\Desktop\JS full Course\chapter15.1\node_modules\webpack-dev-server\bin\webpack-dev-server.js:65:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\user\\Desktop\\JS full Course\\chapter15.1\\node_modules\\webpack-dev-server\\bin\\webpack-dev-server.js'
]
}
webpack version 5.37.1
webpack-cli version 4.7.0
webpack-dev-server version 3.11.2
Package.json file is
{
"name": "chapter15.1",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"#babel/cli": "^7.14.3",
"#babel/core": "^7.14.3",
"#babel/node": "^7.14.2",
"#babel/polyfill": "^7.12.1",
"#babel/preset-env": "^7.14.2",
"#babel/register": "^7.13.16",
"babel-loader": "^8.2.2",
"babel-register": "^6.26.0",
"html-webpack-plugin": "^5.3.1",
"webpack": "^5.37.1",
"webpack-cli": "^4.7.0",
"webpack-dev-server": "^3.11.2"
}
}
In the Package.json file add a serve script like below and remove the start script. See the documentation.
{
"scripts": {
"serve": "webpack serve"
},
Then Run this command in your terminal.
npm run serve
My package.json:
{
"name": "api-auth",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www",
"start-dev": "nodemon ./bin/www",
"build": "npm install --only=dev"
},
"engines": {
"node": "v12.6.0",
"npm": "6.9.0"
},
"dependencies": {
"bcrypt": "^3.0.6",
"body-parser": "~1.18.2",
"connect-mongo": "^2.0.1",
"connect-multiparty": "^2.2.0",
"cookie-parser": "~1.4.3",
"cors": "^2.8.5",
"debug": "~2.6.9",
"dotenv": "^6.1.0",
"express": "^4.16.4",
"express-session": "^1.15.6",
"mongoose": "^5.3.0",
"morgan": "~1.9.0",
"node-gyp": "^3.8.0",
"serve-favicon": "~2.4.5",
"socket.io": "^2.3.0",
"nodemon": "^1.18.6"
},
"devDependencies": {}
}
Heroku output, it build okay but then it shows this:
2020-11-30T17:32:23.000000+00:00 app[api]: Build succeeded
2020-11-30T17:32:25.385955+00:00 heroku[web.1]: Starting process with command `npm start`
2020-11-30T17:32:27.462352+00:00 app[web.1]:
2020-11-30T17:32:27.462366+00:00 app[web.1]: > api-auth#0.0.0 start /app
2020-11-30T17:32:27.462366+00:00 app[web.1]: > node ./bin/www
2020-11-30T17:32:27.462366+00:00 app[web.1]:
2020-11-30T17:32:27.998108+00:00 app[web.1]: internal/modules/cjs/loader.js:628
2020-11-30T17:32:27.998157+00:00 app[web.1]: throw err;
2020-11-30T17:32:27.998157+00:00 app[web.1]: ^
2020-11-30T17:32:27.998158+00:00 app[web.1]:
2020-11-30T17:32:27.998159+00:00 app[web.1]: Error: Cannot find module '../models/User'
2020-11-30T17:32:27.998160+00:00 app[web.1]: Require stack:
2020-11-30T17:32:27.998161+00:00 app[web.1]: - /app/routes/auth.js
2020-11-30T17:32:27.998161+00:00 app[web.1]: - /app/app.js
2020-11-30T17:32:27.998161+00:00 app[web.1]: - /app/bin/www
2020-11-30T17:32:27.998163+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
2020-11-30T17:32:27.998163+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:527:27)
2020-11-30T17:32:27.998164+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:683:19)
2020-11-30T17:32:27.998165+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:16:16)
2020-11-30T17:32:27.998165+00:00 app[web.1]: at Object.<anonymous> (/app/routes/auth.js:9:14)
2020-11-30T17:32:27.998166+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30)
2020-11-30T17:32:27.998166+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
2020-11-30T17:32:27.998167+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:643:32)
2020-11-30T17:32:27.998167+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:556:12)
2020-11-30T17:32:27.998167+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:683:19)
2020-11-30T17:32:27.998168+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:16:16)
2020-11-30T17:32:27.998168+00:00 app[web.1]: at Object.<anonymous> (/app/app.js:14:14)
2020-11-30T17:32:27.998169+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:776:30)
2020-11-30T17:32:27.998169+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
2020-11-30T17:32:27.998169+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:643:32)
2020-11-30T17:32:27.998170+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:556:12) {
2020-11-30T17:32:27.998170+00:00 app[web.1]: code: 'MODULE_NOT_FOUND',
2020-11-30T17:32:27.998171+00:00 app[web.1]: requireStack: [ '/app/routes/auth.js', '/app/app.js', '/app/bin/www' ]
2020-11-30T17:32:27.998171+00:00 app[web.1]: }
2020-11-30T17:32:28.008736+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-11-30T17:32:28.008952+00:00 app[web.1]: npm ERR! errno 1
2020-11-30T17:32:28.009802+00:00 app[web.1]: npm ERR! api-auth#0.0.0 start: `node ./bin/www`
2020-11-30T17:32:28.009951+00:00 app[web.1]: npm ERR! Exit status 1
2020-11-30T17:32:28.010125+00:00 app[web.1]: npm ERR!
2020-11-30T17:32:28.010259+00:00 app[web.1]: npm ERR! Failed at the api-auth#0.0.0 start script.
2020-11-30T17:32:28.010391+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-11-30T17:32:28.014982+00:00 app[web.1]:
2020-11-30T17:32:28.015107+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-11-30T17:32:28.015194+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-11-30T17_32_28_011Z-debug.log
2020-11-30T17:32:28.065317+00:00 heroku[web.1]: Process exited with status 1
2020-11-30T17:32:28.091892+00:00 heroku[web.1]: State changed from starting to crashed
I read this heroku's official page too https://devcenter.heroku.com/articles/troubleshooting-node-deploys but for me is not working: I read that I have to put all the dependencies inside dependencies, and not in devDependencies, so I did that but nothing happens, the error still there.
I tried to delete node_modules and npm i later and is still making the same mistake.
I read too about using a heroku CLI but didnt work for me. I am using github because is easier for me.
Any help please? Thanks.
It was a Windows's problem. Windows doesnt differenciate between upper and lower case like Linux. So when I tried to upload my code, it breaks. I write everything in lower case and it works.
I have followed the instructions but it stil doesnt work. My repository is this:
https://github.com/diegoarcega/learning_react
Procfile
web: node index.js
index.js
var cool = require('cool-ascii-faces');
var express = require('express');
var path = require('path');
var app = express();
var DIST_DIR = path.resolve(__dirname + '/../dist');
app.set('port', (process.env.PORT || 5000));
app.use('/assets/', express.static(DIST_DIR + '/assets'));
app.get('/', function(req, res) {
res.send('hello');
});
app.get('/cool', function(request, response) {
response.send(cool());
});
app.listen(app.get('port'), function() {
console.log('Listening port ' + app.get('port'))
});
package.json
{
"name": "learning_react",
"version": "0.0.1",
"description": "practising react",
"main": "index.js",
"scripts": {
"kill": "fuser -k 30000/tcp",
"start": "node index.js",
"serve": "node index.js",
"dev": "NODE_ENV=development babel-node server/server.js",
"test": "echo \"Error: no test specified\" && exit 1",
"clean": "rimraf dist/ ",
"copy": "copyfiles -f src/index.html src/favicon.ico dist",
"prod": "npm run clean && webpack --config webpack.config.dist.js -p && npm run copy",
"dist": "NODE_ENV=production babel-node server/server.js ",
"deploy": "surge --project ./dist --domain diegoarcega-react.surge.sh"
},
"repository": {
"type": "git",
"url": "https://github.com/diegoarcega/learning_react"
},
"keywords": [
"REACT"
],
"engines": {
"node": "4.4.5",
"npm": "3.9.6"
},
"author": "Diego Arcega",
"license": "BSD-2-Clause",
"bugs": {
"url": "https://github.com/diegoarcega/learning_react/issues"
},
"dependencies": {
"axios": "^0.12.0",
"babel-polyfill": "^6.9.1",
"cool-ascii-faces": "^1.3.4",
"firebase": "^3.0.5",
"material-ui": "^0.15.1",
"muicss": "^0.6.5",
"q": "^1.4.1",
"react": "~15.1.0",
"react-dom": "~15.1.0",
"react-redux": "~4.4.5",
"react-router": "~2.4.1",
"react-tap-event-plugin": "^1.0.0",
"redux": "~3.5.2",
"redux-thunk": "^2.1.0"
},
"devDependencies": {
"babel-cli": "^6.10.1",
"babel-core": "~6.9.1",
"babel-loader": "~6.2.4",
"babel-plugin-transform-es2015-function-name": "^6.9.0",
"babel-plugin-transform-es2015-literals": "^6.8.0",
"babel-plugin-transform-es2015-template-literals": "^6.8.0",
"babel-plugin-transform-runtime": "^6.9.0",
"babel-preset-es2015": "~6.9.0",
"babel-preset-react": "~6.5.0",
"babel-preset-react-hmre": "^1.1.1",
"babel-preset-react-optimize": "^1.0.1",
"copyfiles": "^1.0.0",
"css-loader": "^0.23.1",
"express": "~4.13.4",
"file-loader": "^0.8.5",
"object-assign": "^4.1.0",
"react-css-modules": "^3.7.6",
"react-tap-event-plugin": "^1.0.0",
"react-thunk": "^1.0.0",
"style-loader": "^0.13.1",
"url-loader": "^0.5.7",
"webpack": "~1.13.1",
"webpack-dev-middleware": "^1.6.1",
"webpack-dev-server": "^1.14.1",
"webpack-hot-middleware": "^2.10.0"
}
}
I am just trying to make it work first. The error log is this:
2016-07-06T17:00:56.197239+00:00 heroku[web.1]: State changed from crashed to starting
2016-07-06T17:01:00.211013+00:00 heroku[web.1]: Starting process with command `node index.js`
2016-07-06T17:01:01.580923+00:00 app[web.1]: module.js:327
2016-07-06T17:00:54.456548+00:00 heroku[api]: Deploy 23f2e63 by diegoarcega#gmail.com
2016-07-06T17:01:01.580940+00:00 app[web.1]: at Object.<anonymous> (/app/index.js:2:15)
2016-07-06T17:01:01.580940+00:00 app[web.1]: at Module._compile (module.js:409:26)
2016-07-06T17:01:02.228107+00:00 heroku[web.1]: State changed from starting to crashed
2016-07-06T17:01:02.212126+00:00 heroku[web.1]: Process exited with status 1
2016-07-06T17:01:01.580941+00:00 app[web.1]: at Function.Module._load (module.js:300:12)
2016-07-06T17:01:01.580942+00:00 app[web.1]: at Function.Module.runMain (module.js:441:10)
2016-07-06T17:01:01.580939+00:00 app[web.1]: at Function.Module._load (module.js:276:25)
2016-07-06T17:01:01.580939+00:00 app[web.1]: at Module.require (module.js:353:17)
2016-07-06T17:01:01.580940+00:00 app[web.1]: at require (internal/module.js:12:17)
2016-07-06T17:01:01.580940+00:00 app[web.1]: at Object.<anonymous> (/app/index.js:2:15)
2016-07-06T17:01:01.580940+00:00 app[web.1]: at Module._compile (module.js:409:26)
2016-07-06T17:01:01.580941+00:00 app[web.1]: at Object.Module._extensions..js (module.js:416:10)
2016-07-06T17:01:02.228107+00:00 heroku[web.1]: State changed from starting to crashed
2016-07-06T17:01:02.212126+00:00 heroku[web.1]: Process exited with status 1
2016-07-06T17:02:12.435185+00:00 heroku[slug-compiler]: Slug compilation started
2016-07-06T17:02:12.435194+00:00 heroku[slug-compiler]: Slug compilation finished
2016-07-06T17:02:12.782559+00:00 heroku[web.1]: State changed from crashed to starting
2016-07-06T17:02:17.345331+00:00 heroku[web.1]: Starting process with command `node index.js`
2016-07-06T17:02:19.470185+00:00 app[web.1]: module.js:327
2016-07-06T17:02:19.470199+00:00 app[web.1]: throw err;
2016-07-06T17:02:19.470211+00:00 app[web.1]: Error: Cannot find module 'express'
2016-07-06T17:02:19.470212+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:325:15)
2016-07-06T17:02:19.470217+00:00 app[web.1]: at Function.Module._load (module.js:300:12)
2016-07-06T17:02:19.470217+00:00 app[web.1]: at Function.Module.runMain (module.js:441:10)
2016-07-06T17:02:20.579075+00:00 heroku[web.1]: Process exited with status 1
2016-07-06T17:02:20.600663+00:00 heroku[web.1]: State changed from starting to crashed
2016-07-06T17:02:12.174712+00:00 heroku[api]: Deploy 23f2e63 by diegoarcega#gmail.com
figured it out, never forget to install express in dependencies instead of devDependencies ;)