npm users
Step 1: Use the following command to install the npm-check-updates package.
npm install -g npm-check-updates
Step 2: Use the the npm-check-updates or ncu command to check the list of possible updates.
ncu
Step 3: Use the u flag along with the ncu command to upgrade the version in the package.json file. This only changes the package.json file not install it.
ncu -u
Step 4: Install the required changes using the install command of npm.
npm install
How to override nested NPM dependency versions?
In projects the packages download and used using npm are called dependency and each dependencies can have their own nested dependencies that also gets downloaded. These nested dependency creates conflicts due to the presence of multiple version of the same dependency. This will lead to issues like compatibility, security vulnerabilities, and unexpected behavior.
To solve that we got multiple ways such as overrides property in package.json file, npm-force-resolutions, npm dedupe, npm-check-updates or yarn-upgrade-all.
Table of Content
- Manual override in package.json
- Utilizing npm’s npm-force-resolutions
- Using npm dedupe(deduplicate)
- Automation with npm-check-updates or yarn-upgrade-all
- npm users
- yarn users
- Testing and documentation for changes
- Best practices for management