I have been trying to deploy a nodejs app under appname 'picbookapp' on heroku which has a mongo database.For mongodb I have used mlabs and I have added MONGO_URI to the config vars in my heroku app.I have also added the Procfile file.But for some reasons I am getting errors.Since I am new to app deployment any kind of help would be highly appreciated.Here are the few error logs start: not found code ELIFECYCLE, errrno ENOENT,file sh, syscall spawn, spawn ENOENT Here is the packag.json file--
{
"name": "gridfsandmulter",
"version": "1.0.0",
"private": true,
"description": "",
"main": "server.js",
"scripts": {
"start": "node server.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Harshit",
"license": "ISC",
"dependencies": {
"body-parser": "^1.17.2",
"bootstrap": "^3.3.7",
"connect-flash": "^0.1.1",
"cookie-parser": "^1.4.3",
"ejs": "^2.5.7",
"express": "^4.15.3",
"express-session": "^1.15.4",
"gridfs-stream": "^1.1.1",
"hbs": "^4.0.1",
"mongod": "^2.0.0",
"mongodb": "^2.2.30",
"mongoose": "^4.11.4",
"multer": "^1.3.0",
"passport": "^0.3.2",
"passport-local": "^1.0.0"
},
"engines": {
"node": "4.1.1",
"npm": "5.0.3"
}
}
Here is the database.js
/**
* Created by harshitbisht96 on 30/7/17.
*/
var mongodb=require('mongodb');
var MongoClient=mongodb.MongoClient;
var url=process.env.MONGOLAB_URI||'mongodb://localhost:27017/imageDatabase';
function getDb(){
return MongoClient.connect(url).then(function (db) {
// console.log(MongoClient.connect(url));
return db;
})
}
module.exports=getDb();