Answered
How do I get a full list of all the outdated NPM packages installed to my JavaScript application?
By outdated, I mean that there is a newer version of the NPM package to install and use in my application. So it would only be packages that I'm not using the latest version of in my application.
Thanks for the help in advance!
You can use the npm outdated
command.
It will output something that looks like this:
Package Current Wanted Latest Location Depended by
axios 0.22.0 0.22.0 0.27.2 node_modules/axios website
next 12.1.5 12.1.6 12.1.6 node_modules/next website
showdown 1.9.1 1.9.1 2.1.0 node_modules/showdown website
showdown-highlight 2.1.8 2.1.8 3.0.0 node_modules/showdown-highlight website
This output includes NPM dependencies in your project that are outdated and have a new version to install and use.
The npm-check-updates package may work for you.
Install it globally on your machine:
npm install -g npm-check-updates
Then run the ncu
command inside your application:
ncu
This will list all the new dependencies you can update in your project.
And you can update them with this command;
ncu -u