Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mongoose - deprecated [email protected]: Please upgrade to 2.2.19 or higher?

Why do I keep getting this warning message below when I try to install mongoose?

npm WARN deprecated [email protected]: Please upgrade to 2.2.19 or higher

json:

{
  "name": "dummy-app",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "start": "node ./bin/www"
  },
  "dependencies": {
    "body-parser": "~1.15.1",
    "cookie-parser": "~1.4.3",
    "debug": "~2.2.0",
    "express": "~4.13.4",
    "pug": "~2.0.0-beta3",
    "morgan": "~1.7.0",
    "serve-favicon": "~2.3.0",
    "mongoose": "^4.7.6"
  }
}

How can I fix that?

like image 316
Run Avatar asked Jan 04 '17 10:01

Run


People also ask

Do I need to install MongoDB to use Mongoose?

First of all you should have installed MongoDB and be able to run it before you install mongoose.

Can I use MongoDB and Mongoose together?

Connecting to MongoDBjs file and use Mongoose to connect to MongoDB. You could connect to a local MongoDB instance, but for this article we are going to use a free MongoDB Atlas cluster. If you don't already have an account, it's easy to sign up for a free MongoDB Atlas cluster here.

What is Mongoose in NPM?

Mongoose is an Object Data Modeling (ODM) library for MongoDB and Node. js. It manages relationships between data, provides schema validation, and is used to translate between objects in code and the representation of those objects in MongoDB.


1 Answers

The npm package mongodb is a dependency of mongoose: it is automatically installed by npm when you install mongoose.

mongoose v4.7.6 depends on mongodb 2.2.16 (see its package.json file), but there is a newer bugfix release available (2.2.19) which is why you see the warning.

As mongodb is a dependency of mongoose, you will have to wait for a mongoose maintainer to update the dependency: this is not an issue you have to fix in your code.

As a matter of fact, this issue is already tracked in mongoose's Github here.

like image 163
Paul Mougel Avatar answered Oct 07 '22 13:10

Paul Mougel