Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does run mongoskin only with mongodb version 1.4 and older?

I'm trying to understand nodejs, express and mongodb I'm running mongodb v 2.0.6 and latest nodejs and express and trying to connect express application with mongodb through mongoskin. the problem is:

npm ERR! peerinvalid The package mongodb does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants mongodb@~1.4

Does it mean that mongoskin can work only with mongodb v 1.4? This version is to old as for me (current is 3)

like image 511
Marat Avatar asked Apr 22 '15 17:04

Marat


People also ask

Do I need MongoDB to run mongoose?

Mongoose requires a connection to a MongoDB database. You can require() and connect to a locally hosted database with mongoose. connect() , as shown below. You can get the default Connection object with mongoose.

What is the latest MongoDB version?

8 - Aug 4, 2021. MongoDB version 4.4.

Is MongoDB better than Nodejs?

MongoDB is a widely used NoSQL database. The ability to store data in several formats makes MongoDB a beneficial tool for managing large amounts of data. On the other hand, Nodejs is a well-known runtime environment that assists in executing JavaScript code outside the browser.

Can I use MongoDB and Mongoose together?

yes you should, its a good practice. Mongoose requires a connection to a MongoDB database. You can use require() and connect to a locally hosted database with mongoose.


1 Answers

It's expecting version 1.4 of the MongoDB driver, not the database.

You should remove the 2.0.6 version of the driver, as mongoskin doesn't work with that yet (issue), and install the 1.4 version instead:

$ npm uninstall mongodb
$ npm install mongodb@~1.4 [--save]
$ npm install mongoskin [--save]

(however, I'm not sure if the 1.4 driver works properly with 3.x databases)

like image 103
robertklep Avatar answered Oct 26 '22 04:10

robertklep