This is the heroku logs
2017-12-13T16:08:29.000000+00:00 app[api]: Build succeeded
2017-12-13T16:08:46.328161+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-12-13T16:08:46.498068+00:00 heroku[web.1]: Process exited with status 143
2017-12-13T16:08:53.490378+00:00 app[web.1]: module.js:538
2017-12-13T16:08:53.490391+00:00 app[web.1]: throw err;
2017-12-13T16:08:53.490391+00:00 app[web.1]: ^
2017-12-13T16:08:53.490392+00:00 app[web.1]:
2017-12-13T16:08:53.490392+00:00 app[web.1]: Error: Cannot find module './decimal128'
2017-12-13T16:08:53.490393+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:536:15)
2017-12-13T16:08:53.490394+00:00 app[web.1]: at Function.Module._load (module.js:466:25)
2017-12-13T16:08:53.490394+00:00 app[web.1]: at Module.require (module.js:579:17)
2017-12-13T16:08:53.490395+00:00 app[web.1]: at require (internal/module.js:11:18)
2017-12-13T16:08:53.490395+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/mongoose/lib/drivers/node-mongodb-native/index.js:6:22)
2017-12-13T16:08:53.490396+00:00 app[web.1]: at Module._compile (module.js:635:30)
2017-12-13T16:08:53.490396+00:00 app[web.1]: at Object.Module._extensions..js (module.js:646:10)
2017-12-13T16:08:53.490397+00:00 app[web.1]: at Module.load (module.js:554:32)
2017-12-13T16:08:53.490397+00:00 app[web.1]: at tryModuleLoad (module.js:497:12)
2017-12-13T16:08:53.490398+00:00 app[web.1]: at Function.Module._load (module.js:489:3)
2017-12-13T16:08:53.582814+00:00 heroku[web.1]: State changed from starting to crashed
2017-12-13T16:08:53.555998+00:00 heroku[web.1]: Process exited with status 1
2017-12-13T16:08:51.503070+00:00 heroku[web.1]: Starting process with command `node app.js`
2017-12-13T16:10:20.313936+00:00 heroku[web.1]: State changed from crashed to starting
2017-12-13T16:10:23.590155+00:00 heroku[web.1]: Starting process with command `node app.js`
2017-12-13T16:10:26.548414+00:00 heroku[web.1]: Process exited with status 1
2017-12-13T16:10:26.463026+00:00 app[web.1]: module.js:538
2017-12-13T16:10:26.463042+00:00 app[web.1]: throw err;
2017-12-13T16:10:26.463042+00:00 app[web.1]: ^
2017-12-13T16:10:26.463043+00:00 app[web.1]:
2017-12-13T16:10:26.463044+00:00 app[web.1]: Error: Cannot find module './decimal128'
2017-12-13T16:10:26.463045+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:536:15)
2017-12-13T16:10:26.463045+00:00 app[web.1]: at Function.Module._load (module.js:466:25)
2017-12-13T16:10:26.463046+00:00 app[web.1]: at Module.require (module.js:579:17)
2017-12-13T16:10:26.463046+00:00 app[web.1]: at require (internal/module.js:11:18)
2017-12-13T16:10:26.463047+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/mongoose/lib/drivers/node-mongodb-native/index.js:6:22)
2017-12-13T16:10:26.463048+00:00 app[web.1]: at Module._compile (module.js:635:30)
2017-12-13T16:10:26.463048+00:00 app[web.1]: at Object.Module._extensions..js (module.js:646:10)
2017-12-13T16:10:26.463049+00:00 app[web.1]: at Module.load (module.js:554:32)
2017-12-13T16:10:26.463050+00:00 app[web.1]: at tryModuleLoad (module.js:497:12)
2017-12-13T16:10:26.463050+00:00 app[web.1]: at Function.Module._load (module.js:489:3)
2017-12-13T16:10:26.576992+00:00 heroku[web.1]: State changed from starting to crashed
Via trial and error and using the heroku rollback it seems that the problem isn't in my app.js file but in the node_modules. However I can't seem to find a fix. I've tried reinstalling the node_modules.
It works locally but not when I deploy it on Heroku.
also suddenly I have a package-lock.json file. perhaps thats is a clue?
It's complaining about the decimal128 module, I would double check the relative path to the module from the file that is requiring it. Looks like right now it's looking for it in the same folder as the file "/decimal128".
I fixed it myself by going through everything updating everything and downgrading mongodb to "mongodb": "2.2.33"
Related
While I was able to push successfully my master branch to Heroku and Heroku confirms my app is deployed successfully, yet, the app is not deployed despite that is shows below deploy success message: "Deploy to Heroku".
This is the whole console when log the error.
PS C:\Users\Tanuj Sharma\OneDrive\Desktop\music player\api> heroku logs --tail
» Warning: heroku update available from 7.53.0 to 7.60.2.
2022-07-10T12:46:10.179518+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-07-10T12:46:10.179519+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12)
2022-07-10T12:46:10.179519+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:1005:19)
2022-07-10T12:46:10.179519+00:00 app[web.1]: at require (node:internal/modules/cjs/helpers:102:18)
2022-07-10T12:46:10.179520+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2022-07-10T12:46:10.179520+00:00 app[web.1]: at Module._compile (node:internal/modules/cjs/loader:1101:14)
2022-07-10T12:46:10.179520+00:00 app[web.1]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
2022-07-10T12:46:10.179521+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-07-10T12:46:10.179521+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
2022-07-10T12:46:10.179522+00:00 app[web.1]: code: 'ERR_DLOPEN_FAILED'
2022-07-10T12:46:10.179522+00:00 app[web.1]: }
2022-07-10T12:46:10.184303+00:00 app[web.1]: [nodemon] app crashed - waiting for file changes before starting...
2022-07-10T12:47:08.644146+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2022-07-10T12:47:08.719109+00:00 heroku[web.1]: Stopping process with SIGKILL
2022-07-10T12:47:08.735365+00:00 app[web.1]: Error waiting for process to terminate: No child processes
2022-07-10T12:47:08.854995+00:00 heroku[web.1]: Process exited with status 22
2022-07-10T12:47:08.950963+00:00 heroku[web.1]: State changed from starting to crashed
2022-07-10T12:47:08.962559+00:00 heroku[web.1]: State changed from crashed to starting
2022-07-10T12:47:11.102802+00:00 heroku[web.1]: Starting process with command `npm start`
2022-07-10T12:47:12.335764+00:00 app[web.1]:
2022-07-10T12:47:12.335778+00:00 app[web.1]: > api#1.0.0 start
2022-07-10T12:47:12.335779+00:00 app[web.1]: > nodemon index.js
2022-07-10T12:47:12.335779+00:00 app[web.1]:
2022-07-10T12:47:12.483351+00:00 app[web.1]: [nodemon] 2.0.18
2022-07-10T12:47:12.484023+00:00 app[web.1]: [nodemon] to restart at any time, enter `rs`
2022-07-10T12:47:12.484330+00:00 app[web.1]: [nodemon] watching path(s): *.*
2022-07-10T12:47:12.484372+00:00 app[web.1]: [nodemon] watching extensions: js,mjs,json
2022-07-10T12:47:12.484714+00:00 app[web.1]: [nodemon] starting `node index.js`
2022-07-10T12:47:13.021881+00:00 app[web.1]: node:internal/modules/cjs/loader:1183
2022-07-10T12:47:13.021888+00:00 app[web.1]: return process.dlopen(module, path.toNamespacedPath(filename));
2022-07-10T12:47:13.021889+00:00 app[web.1]: ^
2022-07-10T12:47:13.021890+00:00 app[web.1]:
2022-07-10T12:47:13.021895+00:00 app[web.1]: Error: /app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: invalid ELF header
2022-07-10T12:47:13.021895+00:00 app[web.1]: at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
2022-07-10T12:47:13.021896+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-07-10T12:47:13.021897+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12)
2022-07-10T12:47:13.021897+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:1005:19)
2022-07-10T12:47:13.021898+00:00 app[web.1]: at require (node:internal/modules/cjs/helpers:102:18)
2022-07-10T12:47:13.021898+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2022-07-10T12:47:13.021899+00:00 app[web.1]: at Module._compile (node:internal/modules/cjs/loader:1101:14)
2022-07-10T12:47:13.021899+00:00 app[web.1]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
2022-07-10T12:47:13.021899+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-07-10T12:47:13.021900+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
2022-07-10T12:47:13.021900+00:00 app[web.1]: code: 'ERR_DLOPEN_FAILED'
2022-07-10T12:47:13.021900+00:00 app[web.1]: }
2022-07-10T12:47:13.027964+00:00 app[web.1]: [nodemon] app crashed - waiting for file changes before starting...
2022-07-10T12:48:11.687111+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2022-07-10T12:48:11.799328+00:00 heroku[web.1]: Stopping process with SIGKILL
2022-07-10T12:48:11.974808+00:00 heroku[web.1]: Process exited with status 137
2022-07-10T12:48:12.167238+00:00 heroku[web.1]: State changed from starting to crashed
2022-07-10T12:50:43.000000+00:00 app[api]: Build started by user tanujsharma56673#gmail.com
2022-07-10T12:50:57.758295+00:00 app[api]: Deploy 9d643887 by user tanujsharma56673#gmail.com
2022-07-10T12:50:57.758295+00:00 app[api]: Release v15 created by user tanujsharma56673#gmail.com
2022-07-10T12:50:58.000000+00:00 app[api]: Build succeeded
2022-07-10T12:50:58.295588+00:00 heroku[web.1]: State changed from crashed to starting
2022-07-10T12:51:02.465502+00:00 heroku[web.1]: Starting process with command `node index.js`
2022-07-10T12:51:03.881751+00:00 app[web.1]: node:internal/modules/cjs/loader:1183
2022-07-10T12:51:03.881784+00:00 app[web.1]: return process.dlopen(module, path.toNamespacedPath(filename));
2022-07-10T12:51:03.881785+00:00 app[web.1]: ^
2022-07-10T12:51:03.881785+00:00 app[web.1]:
2022-07-10T12:51:03.881786+00:00 app[web.1]: Error: /app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: invalid ELF header
2022-07-10T12:51:03.881786+00:00 app[web.1]: at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
2022-07-10T12:51:03.881786+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-07-10T12:51:03.881787+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12)
2022-07-10T12:51:03.881787+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:1005:19)
2022-07-10T12:51:03.881787+00:00 app[web.1]: at require (node:internal/modules/cjs/helpers:102:18)
2022-07-10T12:51:03.881787+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2022-07-10T12:51:03.881788+00:00 app[web.1]: at Module._compile (node:internal/modules/cjs/loader:1101:14)
2022-07-10T12:51:03.881788+00:00 app[web.1]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
2022-07-10T12:51:03.881789+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-07-10T12:51:03.881789+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
2022-07-10T12:51:03.881789+00:00 app[web.1]: code: 'ERR_DLOPEN_FAILED'
2022-07-10T12:54:36.265720+00:00 app[web.1]:
2022-07-10T12:54:36.265720+00:00 app[web.1]: Error: /app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: invalid ELF header
2022-07-10T12:54:36.265721+00:00 app[web.1]: at Object.Module._extensions..node (node:internal/modules/cjs/loader:1189:18)
2022-07-10T12:54:36.265721+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-07-10T12:54:36.265721+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12)
2022-07-10T12:54:36.265721+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:1005:19)
2022-07-10T12:54:36.265722+00:00 app[web.1]: at require (node:internal/modules/cjs/helpers:102:18)
2022-07-10T12:54:36.265722+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2022-07-10T12:54:36.265722+00:00 app[web.1]: at Module._compile (node:internal/modules/cjs/loader:1105:14)
2022-07-10T12:54:36.265722+00:00 app[web.1]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
2022-07-10T12:54:36.265723+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-07-10T12:54:36.265723+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
2022-07-10T12:54:36.265723+00:00 app[web.1]: code: 'ERR_DLOPEN_FAILED'
2022-07-10T12:54:36.265724+00:00 app[web.1]: }
2022-07-10T12:54:36.415417+00:00 heroku[web.1]: Process exited with status 1
2022-07-10T12:54:37.316117+00:00 heroku[web.1]: State changed from starting to crashed
This is my index.js
This is Procfile file
package.json file
{
"name": "api",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon index.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"bcrypt": "^5.0.1",
"cors": "^2.8.5",
"dotenv": "^16.0.1",
"express": "^4.18.1",
"express-async-errors": "^3.1.1",
"joi": "^17.6.0",
"joi-password-complexity": "^5.1.0",
"jsonwebtoken": "^8.5.1",
"mongoose": "^6.4.0",
"nodemon": "^2.0.18"
}
}
Could anyone help with a precise solution?
Build log when i push to heroku
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/nodejs
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_VERBOSE=false
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 16.x...
remote: Downloading and installing node 16.16.0...
remote: Using default npm version: 8.11.0
Any help would be great
I'm trying to deploy my sapper/svelte app to heroku but getting 'Error: Cannot find module 'polka'' this error. Interesting thing is that, it was perfectly fine and working. My package.json is correct and I am not checking my modules into git either. I tried disabling caching but it is no good. Anyone have any ideas?
2020-09-16T16:04:44.083385+00:00 app[web.1]: Error: Cannot find module 'polka'
2020-09-16T16:04:44.083386+00:00 app[web.1]: Require stack:
2020-09-16T16:04:44.083386+00:00 app[web.1]: - /app/__sapper__/build/server/server.js
2020-09-16T16:04:44.083386+00:00 app[web.1]: - /app/__sapper__/build/index.js
2020-09-16T16:04:44.083387+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
2020-09-16T16:04:44.083392+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:841:27)
2020-09-16T16:04:44.083392+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:1025:19)
2020-09-16T16:04:44.083393+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:72:18)
2020-09-16T16:04:44.083393+00:00 app[web.1]: at Object.<anonymous> (/app/__sapper__/build/server/server.js:4:13)
2020-09-16T16:04:44.083394+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1137:30)
2020-09-16T16:04:44.083394+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
2020-09-16T16:04:44.083394+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:985:32)
2020-09-16T16:04:44.083395+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:878:14)
2020-09-16T16:04:44.083395+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:1025:19) {
2020-09-16T16:04:44.083396+00:00 app[web.1]: code: 'MODULE_NOT_FOUND',
2020-09-16T16:04:44.083396+00:00 app[web.1]: requireStack: [
2020-09-16T16:04:44.083397+00:00 app[web.1]: '/app/__sapper__/build/server/server.js',
2020-09-16T16:04:44.083397+00:00 app[web.1]: '/app/__sapper__/build/index.js'
2020-09-16T16:04:44.083397+00:00 app[web.1]: ]
2020-09-16T16:04:44.083398+00:00 app[web.1]: }
It turns out polka's version on my package.json was set to 'next'. So I changed it to it latest stable version and deleted package.lock.json file and ran 'npm install' to create a new lock file and then pushed it to heroku. Works perfectly fine.
I'm using nodebootstrap to start a new nodejs project (http://nodebootstrap.io/) and it's running fine locally. But when I tried to deploy it to heroku, it showed me the follow errors:
2016-08-21T05:14:51.789857+00:00 heroku[web.1]: State changed from crashed to starting
2016-08-21T05:14:54.116827+00:00 heroku[web.1]: Starting process with command `node server.js`
2016-08-21T05:14:56.026808+00:00 app[web.1]: 21 Aug 05:14:56 - NOTICE [node_modules/nodebootstrap-server/app.js:57] Express server instance listening on port 31254
2016-08-21T05:14:56.104762+00:00 app[web.1]: module.js:341
2016-08-21T05:14:56.104766+00:00 app[web.1]: throw err;
2016-08-21T05:14:56.104769+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:339:15)
2016-08-21T05:14:56.104773+00:00 app[web.1]: at Function.Module._load (module.js:290:25)
2016-08-21T05:14:56.104775+00:00 app[web.1]: at require (internal/module.js:20:19)
2016-08-21T05:14:56.104775+00:00 app[web.1]: at Object.<anonymous> (/app/lib/api/index.js:2:9)
2016-08-21T05:14:56.104776+00:00 app[web.1]: at Module._compile (module.js:413:34)
2016-08-21T05:14:56.104777+00:00 app[web.1]: at Module.load (module.js:357:32)
2016-08-21T05:14:56.104777+00:00 app[web.1]: at Function.Module._load (module.js:314:12)
2016-08-21T05:14:56.158230+00:00 heroku[web.1]: State changed from starting to crashed
2016-08-21T05:14:56.148890+00:00 heroku[web.1]: Process exited with status 1
Anybody has any idea how to fix this?
Problem solved - I have some unresolved dependency issue that I didn't found when running locally in dev mode
I have successfully deployed some simple nodeJS applications using the Heroku platform.
Now I want to deploy a full application using:
1) a MongoDB database hosted at MongoLab;
2) AngularJS+Bootstrap for the front-end component;
Is this possible to deploy to Heroku?
If so, what changes do I need to apply to the git repo and the Procfile to make it work?
Right now, my github repo looks like this:
Is this the correct structure?
I'm aware of the need to listen on: process.env.PORT instead of a fixed one and I'm also aware of building the package.json automatically using npm init.
For some reason, I can't deploy and I get this error log:
2015-10-01T08:07:01.099635+00:00 heroku[web.1]: Starting process with command `node server.js`
2015-10-01T08:07:03.847353+00:00 app[web.1]: module.js:338
2015-10-01T08:07:03.847392+00:00 app[web.1]: at Module._compile (module.js:434:26)
2015-10-01T08:07:03.847378+00:00 app[web.1]: throw err;
2015-10-01T08:07:03.847394+00:00 app[web.1]: at Module.load (module.js:355:32)
2015-10-01T08:07:03.847380+00:00 app[web.1]: ^
2015-10-01T08:07:03.847393+00:00 app[web.1]: at Object.Module._extensions..js (module.js:452:10)
2015-10-01T08:07:03.847381+00:00 app[web.1]:
2015-10-01T08:07:03.847396+00:00 app[web.1]: at Function.Module._load (module.js:310:12)
2015-10-01T08:07:03.847383+00:00 app[web.1]: Error: Cannot find module 'xmlbuilder'
2015-10-01T08:07:03.847397+00:00 app[web.1]: at Module.require (module.js:365:17)
2015-10-01T08:07:03.847385+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:336:15)
2015-10-01T08:07:03.847386+00:00 app[web.1]: at Function.Module._load (module.js:286:25)
2015-10-01T08:07:03.847387+00:00 app[web.1]: at Module.require (module.js:365:17)
2015-10-01T08:07:03.847389+00:00 app[web.1]: at require (module.js:384:17)
2015-10-01T08:07:03.847390+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/nodemailer/node_modules/aws-sdk/lib/xml/builder.js:2:15)
2015-10-01T08:07:03.847398+00:00 app[web.1]: at require (module.js:384:17)
2015-10-01T08:07:03.847400+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/nodemailer/node_modules/aws-sdk/lib/core.js:42:14)
2015-10-01T08:07:03.847401+00:00 app[web.1]: at Module._compile (module.js:434:26)
2015-10-01T08:07:03.847402+00:00 app[web.1]: at Object.Module._extensions..js (module.js:452:10)
2015-10-01T08:07:03.847403+00:00 app[web.1]: at Module.load (module.js:355:32)
2015-10-01T08:07:03.847405+00:00 app[web.1]: at Function.Module._load (module.js:310:12)
2015-10-01T08:07:04.829102+00:00 heroku[web.1]: State changed from starting to crashed
2015-10-01T08:07:04.815963+00:00 heroku[web.1]: Process exited with status 1
2015-10-01T08:07:23.430743+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=testeapp8.herokuapp.com request_id=185f6386-0265-494c-8e54-0cc5eec303e5 fwd="81.11.174.99" dyno= connect= service= status=503 bytes=
2015-10-01T08:15:48.636079+00:00 heroku[web.1]: State changed from crashed to starting
2015-10-01T08:15:52.227188+00:00 heroku[web.1]: Starting process with command `node server.js`
2015-10-01T08:15:55.940813+00:00 app[web.1]: module.js:338
2015-10-01T08:15:55.940832+00:00 app[web.1]: throw err;
2015-10-01T08:15:55.940834+00:00 app[web.1]: ^
2015-10-01T08:15:55.940835+00:00 app[web.1]:
2015-10-01T08:15:55.940837+00:00 app[web.1]: Error: Cannot find module 'xmlbuilder'
2015-10-01T08:15:55.940839+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:336:15)
2015-10-01T08:15:55.940840+00:00 app[web.1]: at Function.Module._load (module.js:286:25)
2015-10-01T08:15:55.940841+00:00 app[web.1]: at Module.require (module.js:365:17)
2015-10-01T08:15:55.940843+00:00 app[web.1]: at require (module.js:384:17)
2015-10-01T08:15:55.940844+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/nodemailer/node_modules/aws-sdk/lib/xml/builder.js:2:15)
2015-10-01T08:15:55.940845+00:00 app[web.1]: at Module._compile (module.js:434:26)
2015-10-01T08:15:55.940847+00:00 app[web.1]: at Object.Module._extensions..js (module.js:452:10)
2015-10-01T08:15:55.940848+00:00 app[web.1]: at Module.load (module.js:355:32)
2015-10-01T08:15:55.940849+00:00 app[web.1]: at Function.Module._load (module.js:310:12)
2015-10-01T08:15:55.940850+00:00 app[web.1]: at Module.require (module.js:365:17)
2015-10-01T08:15:55.940852+00:00 app[web.1]: at require (module.js:384:17)
2015-10-01T08:15:55.940853+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/nodemailer/node_modules/aws-sdk/lib/core.js:42:14)
2015-10-01T08:15:55.940854+00:00 app[web.1]: at Module._compile (module.js:434:26)
2015-10-01T08:15:55.940857+00:00 app[web.1]: at Module.load (module.js:355:32)
2015-10-01T08:15:55.940858+00:00 app[web.1]: at Function.Module._load (module.js:310:12)
2015-10-01T08:15:55.940856+00:00 app[web.1]: at Object.Module._extensions..js (module.js:452:10)
2015-10-01T08:15:56.867807+00:00 heroku[web.1]: State changed from starting to crashed
2015-10-01T08:15:56.847462+00:00 heroku[web.1]: Process exited with status 1
I'm trying to upgrade my Node.js Express app to a newer driver for Mongodb. My package.json has "mongodb": "^2.0.40". It runs fine on my machine, and I'm able to deploy to Heroku fine (as in, no warning/errors). However, the app crashes upon use, with this error:
2015-09-14T13:03:52.225525+00:00 heroku[web.1]: Starting process with command `node app.js`
2015-09-14T13:03:52.271972+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2015-09-14T13:03:54.315461+00:00 heroku[web.1]: Process exited with status 143
2015-09-14T13:03:54.701499+00:00 app[web.1]: module.js:338
2015-09-14T13:03:54.701522+00:00 app[web.1]: throw err;
2015-09-14T13:03:54.701523+00:00 app[web.1]: ^
2015-09-14T13:03:54.701525+00:00 app[web.1]: Error: Cannot find module 'mongodb-core'
2015-09-14T13:03:54.701526+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:336:15)
2015-09-14T13:03:54.701527+00:00 app[web.1]: at Function.Module._load (module.js:278:25)
2015-09-14T13:03:54.701529+00:00 app[web.1]: at require (module.js:384:17)
2015-09-14T13:03:54.701528+00:00 app[web.1]: at Module.require (module.js:365:17)
2015-09-14T13:03:54.701531+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/mongodb/index.js:2:12)
2015-09-14T13:03:54.701532+00:00 app[web.1]: at Module._compile (module.js:460:26)
2015-09-14T13:03:54.701533+00:00 app[web.1]: at Object.Module._extensions..js (module.js:478:10)
2015-09-14T13:03:54.701534+00:00 app[web.1]: at Module.load (module.js:355:32)
2015-09-14T13:03:54.701535+00:00 app[web.1]: at Function.Module._load (module.js:310:12)
2015-09-14T13:03:54.701536+00:00 app[web.1]: at Module.require (module.js:365:17)
2015-09-14T13:03:55.561071+00:00 heroku[web.1]: State changed from starting to crashed
2015-09-14T13:03:55.548974+00:00 heroku[web.1]: Process exited with status 1
I've tried various versions of mongodb driver, to no avail.
if you use mongodb-core, you should specify it in package.json like here:
"dependencies": {
"express": "~4.9.x"
, "pg": "~4.4.x"
, "mongodb": "2.0.14"
, "mongodb-core": "~1.0"
},
after pushing it to git, check the log:
remote: -----> Build succeeded!
remote: ├── express#4.9.8
remote: ├── mongodb#2.0.14
remote: ├── mongodb-core#1.0.5
remote: └── pg#4.4.1