here are my logs
2018-07-19T01:40:27.548845+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2018-07-19T01:40:27.548847+00:00 app[web.1]: at Module._compile (module.js:652:30)
2018-07-19T01:40:27.548850+00:00 app[web.1]: at Module.load (module.js:565:32)
2018-07-19T01:40:27.548848+00:00 app[web.1]: at Object.Module._extensions..js (module.js:663:10)
2018-07-19T01:40:27.548851+00:00 app[web.1]: at tryModuleLoad (module.js:505:12)
2018-07-19T01:40:27.548853+00:00 app[web.1]: at Function.Module._load (module.js:497:3)
2018-07-19T01:40:27.548854+00:00 app[web.1]: at Module.require (module.js:596:17)
2018-07-19T01:40:27.548856+00:00 app[web.1]: at require (internal/module.js:11:18)
2018-07-19T01:40:27.548858+00:00 app[web.1]: at Object.<anonymous> (/app/api/routes/users.js:4:16)
2018-07-19T01:40:27.548859+00:00 app[web.1]: at Module._compile (module.js:652:30)
2018-07-19T01:40:27.591620+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-07-19T01:40:27.591624+00:00 app[web.1]: npm ERR! errno 1
2018-07-19T01:40:27.592485+00:00 app[web.1]: npm ERR! main-accounting-app@1.0.0 start: `node app.js`
2018-07-19T01:40:27.592488+00:00 app[web.1]: npm ERR! Exit status 1
2018-07-19T01:40:27.595923+00:00 app[web.1]: npm ERR! Failed at the main-accounting-app@1.0.0 start script.
2018-07-19T01:40:27.592490+00:00 app[web.1]: npm ERR!
2018-07-19T01:40:27.596528+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-07-19T01:40:27.618466+00:00 app[web.1]:
2018-07-19T01:40:27.619407+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-07-19T01:40:27.619410+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-07-19T01_40_27_602Z-debug.log
2018-07-19T01:40:27.683715+00:00 heroku[web.1]: Process exited with status 1
2018-07-19T01:40:27.707660+00:00 heroku[web.1]: State changed from starting to crashed
2018-07-19T07:16:42.016935+00:00 heroku[web.1]: State changed from crashed to starting
2018-07-19T07:16:46.448819+00:00 heroku[web.1]: Starting process with command `npm start`
2018-07-19T07:16:49.016333+00:00 app[web.1]:
2018-07-19T07:16:49.016352+00:00 app[web.1]: > main-accounting-app@1.0.0 start /app
2018-07-19T07:16:49.016354+00:00 app[web.1]: > node app.js
2018-07-19T07:16:49.016355+00:00 app[web.1]:
2018-07-19T07:16:49.816284+00:00 app[web.1]: module.js:681
2018-07-19T07:16:49.816323+00:00 app[web.1]: return process.dlopen(module, path._makeLong(filename));
2018-07-19T07:16:49.816325+00:00 app[web.1]: ^
2018-07-19T07:16:49.816326+00:00 app[web.1]:
2018-07-19T07:16:49.816328+00:00 app[web.1]: Error: /app/node_modules/bcrypt/lib/binding/bcrypt_lib.node: invalid ELF header
2018-07-19T07:16:49.816330+00:00 app[web.1]: at Object.Module._extensions..node (module.js:681:18)
2018-07-19T07:16:49.816332+00:00 app[web.1]: at Module.load (module.js:565:32)
2018-07-19T07:16:49.816333+00:00 app[web.1]: at tryModuleLoad (module.js:505:12)
2018-07-19T07:16:49.816335+00:00 app[web.1]: at Function.Module._load (module.js:497:3)
2018-07-19T07:16:49.816336+00:00 app[web.1]: at Module.require (module.js:596:17)
2018-07-19T07:16:49.816338+00:00 app[web.1]: at require (internal/module.js:11:18)
2018-07-19T07:16:49.816339+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2018-07-19T07:16:49.816341+00:00 app[web.1]: at Module._compile (module.js:652:30)
2018-07-19T07:16:49.816342+00:00 app[web.1]: at Object.Module._extensions..js (module.js:663:10)
2018-07-19T07:16:49.816344+00:00 app[web.1]: at Module.load (module.js:565:32)
2018-07-19T07:16:49.816345+00:00 app[web.1]: at tryModuleLoad (module.js:505:12)
2018-07-19T07:16:49.816347+00:00 app[web.1]: at Function.Module._load (module.js:497:3)
2018-07-19T07:16:49.816348+00:00 app[web.1]: at Module.require (module.js:596:17)
2018-07-19T07:16:49.816350+00:00 app[web.1]: at require (internal/module.js:11:18)
2018-07-19T07:16:49.816351+00:00 app[web.1]: at Object.<anonymous> (/app/api/routes/users.js:4:16)
2018-07-19T07:16:49.816353+00:00 app[web.1]: at Module._compile (module.js:652:30)
2018-07-19T07:16:49.836368+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-07-19T07:16:49.836844+00:00 app[web.1]: npm ERR! errno 1
2018-07-19T07:16:49.838607+00:00 app[web.1]: npm ERR! main-accounting-app@1.0.0 start: `node app.js`
2018-07-19T07:16:49.838827+00:00 app[web.1]: npm ERR! Exit status 1
2018-07-19T07:16:49.839121+00:00 app[web.1]: npm ERR!
2018-07-19T07:16:49.839354+00:00 app[web.1]: npm ERR! Failed at the main-accounting-app@1.0.0 start script.
2018-07-19T07:16:49.839577+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-07-19T07:16:49.847895+00:00 app[web.1]:
2018-07-19T07:16:49.848144+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-07-19T07:16:49.848330+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-07-19T07_16_49_841Z-debug.log
2018-07-19T07:16:49.905428+00:00 heroku[web.1]: Process exited with status 1
2018-07-19T07:16:49.993589+00:00 heroku[web.1]: State changed from starting to crashed
2018-07-19T13:08:57.597790+00:00 heroku[web.1]: State changed from crashed to starting
2018-07-19T13:09:01.146666+00:00 heroku[web.1]: Starting process with command `npm start`
2018-07-19T13:09:04.282556+00:00 app[web.1]:
2018-07-19T13:09:04.282604+00:00 app[web.1]: > main-accounting-app@1.0.0 start /app
2018-07-19T13:09:04.282606+00:00 app[web.1]: > node app.js
2018-07-19T13:09:04.282608+00:00 app[web.1]:
2018-07-19T13:09:05.386813+00:00 app[web.1]: module.js:681
2018-07-19T13:09:05.386865+00:00 app[web.1]: return process.dlopen(module, path._makeLong(filename));
2018-07-19T13:09:05.386867+00:00 app[web.1]: ^
2018-07-19T13:09:05.386869+00:00 app[web.1]:
2018-07-19T13:09:05.386872+00:00 app[web.1]: Error: /app/node_modules/bcrypt/lib/binding/bcrypt_lib.node: invalid ELF header
2018-07-19T13:09:05.386873+00:00 app[web.1]: at Object.Module._extensions..node (module.js:681:18)
2018-07-19T13:09:05.386875+00:00 app[web.1]: at Module.load (module.js:565:32)
2018-07-19T13:09:05.386877+00:00 app[web.1]: at tryModuleLoad (module.js:505:12)
2018-07-19T13:09:05.386878+00:00 app[web.1]: at Function.Module._load (module.js:497:3)
2018-07-19T13:09:05.386880+00:00 app[web.1]: at Module.require (module.js:596:17)
2018-07-19T13:09:05.386881+00:00 app[web.1]: at require (internal/module.js:11:18)
2018-07-19T13:09:05.386883+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2018-07-19T13:09:05.386885+00:00 app[web.1]: at Module._compile (module.js:652:30)
2018-07-19T13:09:05.386886+00:00 app[web.1]: at Object.Module._extensions..js (module.js:663:10)
2018-07-19T13:09:05.386888+00:00 app[web.1]: at Module.load (module.js:565:32)
2018-07-19T13:09:05.386889+00:00 app[web.1]: at tryModuleLoad (module.js:505:12)
2018-07-19T13:09:05.386891+00:00 app[web.1]: at Function.Module._load (module.js:497:3)
2018-07-19T13:09:05.386892+00:00 app[web.1]: at Module.require (module.js:596:17)
2018-07-19T13:09:05.386894+00:00 app[web.1]: at require (internal/module.js:11:18)
2018-07-19T13:09:05.386895+00:00 app[web.1]: at Object.<anonymous> (/app/api/routes/users.js:4:16)
2018-07-19T13:09:05.386897+00:00 app[web.1]: at Module._compile (module.js:652:30)
2018-07-19T13:09:05.397833+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-07-19T13:09:05.398435+00:00 app[web.1]: npm ERR! errno 1
2018-07-19T13:09:05.400199+00:00 app[web.1]: npm ERR! main-accounting-app@1.0.0 start: `node app.js`
2018-07-19T13:09:05.400493+00:00 app[web.1]: npm ERR! Exit status 1
2018-07-19T13:09:05.400842+00:00 app[web.1]: npm ERR!
2018-07-19T13:09:05.401114+00:00 app[web.1]: npm ERR! Failed at the main-accounting-app@1.0.0 start script.
2018-07-19T13:09:05.401381+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-07-19T13:09:05.408887+00:00 app[web.1]:
2018-07-19T13:09:05.409196+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-07-19T13:09:05.409421+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-07-19T13_09_05_403Z-debug.log
2018-07-19T13:09:05.488426+00:00 heroku[web.1]: Process exited with status 1
2018-07-19T13:09:05.510644+00:00 heroku[web.1]: State changed from starting to crashed
PS C:\Users\USER\Documents\aaa-PROJECTS\Main-accounting-app>
here is my procfile
web: node app.js
here is my appjs
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
const mongoose = require('mongoose');
const cors = require('cors');
const bodyParser = require('body-parser');
var indexRouter = require('./api/routes/index');
var usersRouter = require('./api/routes/users');
mongoose.connect('mongodb://xxx:xxx.mlab.com:39921/demobusinesshub',{
// mongodb://localhost:27017/testbusinesshub
// mongodb://xxx:xxx.mlab.com:39921/demobusinesshub
}).then(c => console.log('connected to db'))
.catch(c => console.log('connection to db error'))
var app = express();
app.use(cors());
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
// bodyparser
app.use(bodyParser.json());
app.use('/', indexRouter);
app.use('/users', usersRouter);
const port = process.env.PORT || 3000;
const host = '0.0.0.0';
app.listen(port, host, ()=>{
console.log('Server started on port '+ port);
});
module.exports = app;
here is my package json
{
"name": "main-accounting-app",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"start": "node app"
},
"author": "Sunmola Ayokunle",
"license": "ISC",
"dependencies": {
"bcrypt": "^2.0.1",
"body-parser": "^1.18.3",
"cookie-parser": "~1.4.3",
"cors": "^2.8.4",
"debug": "~2.6.9",
"express": "~4.16.0",
"http-errors": "~1.6.2",
"jsonwebtoken": "^8.3.0",
"mongoose": "^5.1.6",
"morgan": "~1.9.0"
}
}
and in my auth file in my angular service
return this.http.post('' + this.domain + 'users/register', newUser, {headers: headers}).pipe(map(res => res.json()));
where in production this.domain = '' //(an empty string)
so i dont get what is wrong, i have literially searched the web and i'm being told to check port etc and i've done all that. at this stage i am really confused and i dont know what to do . also i've ran ng build in my angular terminal and its being bunduled to the public folder of my express application. runing this with heroku local works and gives no errors. also running this with my normal local server works too