Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Find the version of an installed npm package

How to discover the version of an installed node.js/npm package?

This prints the form of npm itself:
npm -v <package-name>

This prints a cryptic mistake:
npm version <package-name>

This prints the package form on the registry (for example the most recent version accessible):
npm view <package-name> version

How do I get the installed version?
by

3 Answers

akshay1995
npm view <package> version* - returns the latest available version on the package.

*npm list --depth=0* - returns versions of all installed modules without dependencies.

*npm list
- returns versions of all modules and dependencies.

And lastly to get node version: node -v
kshitijrana14
npm list for local packages or npm list -g for globally installed packages.

You can find the version of a specific package by passing its name as an argument. For example, npm list grunt will result in:

projectName@projectVersion /path/to/project/folder
??? grunt@0.4.1

Alternatively, you can just run npm list without passing a package name as an argument to see the versions of all your packages:

??? cli-color@0.1.6
? ??? es5-ext@0.7.1
??? coffee-script@1.3.3
??? less@1.3.0
??? sentry@0.1.2
? ??? file@0.2.1
? ??? underscore@1.3.3
??? uglify-js@1.2.6
sandhya6gczb
Here is the command to print the current version of npm

npm -v <package-name>

For example

npm view redux version

Login / Signup to Answer the Question.