NPM update command

This command updates all listed packages to the latest version (as determined by the version number in package.json) according to the Semver semantic version control module.

Here’s a simple example:

"react": "^" 15.6.1."react-dom": "~ 15.6.1".Copy the code

^: b allows left-most non-zero digits to be changed without modifying [Major, minor, patch] (matches the version numbers of updates Y, Z greater than X, Y, Z)

~: matches the version number of newer Z that is greater than X.Y.Z

So after NPM update, the react package will be updated to the latest version of 15.x.x, while the React -dom package will be updated to the latest version of 15.6.x.

Also, if package.json adds fields for packages, NPM Update will install those packages as well. If a field is deleted, the update command does not delete the corresponding package.