How to find the version of an installed npm package?

04 April 2018 | By Tamas Piros | Node.js, Quick Fix

In this article we are reviewing three ways to get the version numbers of local or global npm packages installed.

When working with Node.js applications, we tend to install a vast amount of packages as dependencies and on top of this we can also have packages installed globally on our system.

The question is, how can we find which version of what package(s) we have installed either locally or globally.

There's a simple npm command that can return us the packages installed and we can use it in three ways:

  • to see the versions of globally intstalled packages we can execute npm list -g
  • to see all the package versions for the current project we can execute npm list
  • to see a specific package version for the current project we can execute npm list [package-name]

Either way, we'll get the appropriate package information returned.