Find the installed version of an npm package
To see the version of all installed npm packages, including their dependencies:
BASH❯ npm list/Users/joe/dev/node/cowsay└─┬ firstname.lastname@example.org├── email@example.com├─┬ firstname.lastname@example.org│ ├── email@example.com│ └── firstname.lastname@example.org├─┬ email@example.com│ ├── firstname.lastname@example.org│ └─┬ email@example.com│ └── firstname.lastname@example.org└── email@example.com
You can also just open the
package-lock.json file, but this involves some visual scanning.
npm list -g is the same, but for globally installed packages.
To get only your top-level packages (basically, the ones you told npm to install and you listed in the
npm list --depth=0:
BASH❯ npm list --depth=0/Users/joe/dev/node/cowsay└── firstname.lastname@example.org
You can get the version of a specific package by specifying its name:
BASH❯ npm list cowsay/Users/joe/dev/node/cowsay└── email@example.com
This also works for dependencies of packages you installed:
BASH❯ npm list minimist/Users/joe/dev/node/cowsay└─┬ firstname.lastname@example.org└─┬ email@example.com└── firstname.lastname@example.org
If you want to see what's the latest available version of the package on the npm repository, run
npm view [package_name] version:
BASH❯ npm view cowsay version1.3.1