Npm is a smart package manager and it will install the latest and compatible with the project tag version as default[1][2]. This command when use with the parameter –save will add the dependence into the package.json file. It is valuable said that the prefix character (^)[4] is added as default too which means for the npm that is for installing a compatible version when you will run the command `npm install`.
Also, you can use the command `$npm update`[3] for automatically update all dependencies for the latest compatible.
Know how works npm and its commands help you avoid issues and a lot of pain. Also, I’d like to suggest avoid fixed versions directly into the file and always as possible use `$npm update`[3] to update the dependences.
[1] – https://docs.npmjs.com/cli/install
[2] – https://docs.npmjs.com/misc/config