How can I avoid installing unstable releases of mongoose with npm?
After running npm update
, I get the following warning in my node app:
# !!! MONGOOSE WARNING !!! # # This is an UNSTABLE release of Mongoose. # Unstable releases are available for preview/testing only. # DO NOT run this in production.
In my package.json file I have the following entry:
"mongoose": "^3.8.8"
Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment. Mongoose supports both promises and callbacks. The official documentation website is mongoosejs.com. Mongoose 5.0.0 was released on January 17, 2018.
If a dependency can be used, but you would like npm to proceed if it cannot be found or fails to install, then you may put it in the optionalDependencies object. This is a map of package name to version or url, just like the dependencies object. The difference is that build failures do not cause installation to fail.
It is now recommended that you install any binaries as local devDependencies wherever possible. If you set "private": true in your package.json, then npm will refuse to publish it. This is a way to prevent accidental publication of private repositories.
If you plan to publish your package, the most important things in your package.json are the name and version fields as they will be required. The name and version together form an identifier that is assumed to be completely unique.
Mongoose is not following standard npm practices and so their unstable builds get recognized as stable by npm. Basically they released 3.9 as an unstable version, this is what causes the warning.
My advise is that you don't trust them anymore to follow such conventions and just lock the version in your package.json:
"mongoose": "3.8"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With