Basically package.json stores the dependencies of you application. Everything under "dependencies" is updated when you do npm update
.
"bson": "*"
means that it will update to latest version of module bson
.
When you do npm install xyz
you are basically installing xyz
without telling package.json. Next time you do npm update
npm will update everything under dependencies
but not xyz
Here are the commands that will help you :
npm install xyz
This will install xyz
without telling package.json
.
npm install --save xyz
This will install xyz
and also update package.json
, so that when next time you do npm update
it will update xyz
as well.
npm install
This will install everything under dependencies
in package.json
.
npm update
This will update everything under dependencies
in package.json
.