How to easily find all updates for a project's packages using Yarn and NPM
Ensuring a project's dependencies are update can prevent issues with bugs and security problems that have been addressed in newer updates. However, how can you quickly and practically determine which packages have available updates, considering a project can easily have hundreds of dependencies?
For Yarn
A simple and effective way to discover all updates for your Node project using Yarn 1 is the command yarn upgrade-interactive --latest
, which generates an interactive list of all project dependencies with available updates.
For Yarn 3 you need to install the plugin "interactive-tools" using the comand yarn plugin import interactive-tools
then use the command yarn upgrade-interactive
.
For NPM
In NPM, we use the npm outdated
command, which serves a similar purpose.
With that, it will be possible to obtain the complete list of dependencies that have available updates.