Best documentation about updating package versions:
https://jssecrets.com/npm-how-to-update-package/
npm update
updates the specified package to the latest version, as defined by the version range in the package’s package.json and package-lock.json files.
The version will often be locked to prevent from updating to a major version using the ^
caret symbol.
"dependencies": {
"lodash": "^4.17.15"
}
To override this run npm update lodash@latest
The following will show what packages need to be updated and will update the packages, but not upgrade to a major version if ^
prevents it.
npm outdated
npm update
npm-check-updates
Install ncu
package globally:
npm install -g npm-check-updates
Check for updates by running ncu
.
Run ncu -u
to upgrade package.json.
Finally, run npm install
to update packages that are installed.