by Sai gowtham

How to show the latest version of an npm package

In this tutorial, we are going to learn about how to see the latest (remote) version of an npm package in the command line.

If we run an npm install package command, it will install the latest available version of an npm package, but after some time the package we installed is outdated and we need to see the latest version.

To see the latest version of an npm package before installing, we can use the following command:

npm view express version

This above command prints the latest remote version of an express package.

4.17.1

or you can also use the npm show command:

npm show express version

If you want to see the current and latest versions of all npm packages that are present inside your package.json file, you can use:

npm outdated

Output:

Package   Current  Wanted  Latest  Location
date-fns   2.15.0  2.16.1  2.16.1  node-app

Top Udemy Courses

JavaScript - The Complete Guide 2020 (Beginner + Advanced)
JavaScript - The Complete Guide 2020 (Beginner + Advanced)
45,614 students enrolled
52 hours of video content
View Course
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
284,472 students enrolled
40 hours of video content
View Course
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
130,921 students enrolled
21 hours of video content
View Course