Introduction
How to find the version of an installed npm package?

How to find the version of an installed npm package?

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.

Author

Tamas Piros

Developer Evangelist, experienced Technical Trainer and Google Developer Expert in Web Technologies. Active conference speaker, passionate about the latest & greatest advancements in web technologies.

View Comments
Next Post

constructor vs ngOnInit in Angular

Previous Post

How to read environment variables in Node.js?