I was trying to install mongojs by this command: npm install mongojs
but there are coming so many errors .
https://www.youtube.com/watch?v=763oFTm4pnU
So,i restarted my pc and tried installing again but same errors are coming . but i still tried to retrieve data from mongodb through server because there are somethings that are still installed after so many errors. i have written this code in my server.js file-
var express= require('express');
var app=express();
var mongojs = require('mongojs');
var db = mongojs('contactlist',['contactlist']);
app.use(express.static(__dirname + "/public"));
app.get('/contactlist',function (req,res) {
console.log("i receive a get request");
db.contactlist.find(function (err,docs){
console.log(docs);
console.log("in daatbase");
res.json(docs);
});
});
app.listen(3000);
console.log("Server running on port 3000");
I have recorded the errors ..please come up with solutions.
please watch thsi video which contains all my errors..
https://www.youtube.com/watch?v=763oFTm4pnU
In this video there are errors that are coming while installing MongoJs.
Thank You.