How to check the version of an installed npm package (2024)

In this tutorial, we are going to learn about how to check the version of a installed npm package and its dependencies.

Installed version of all packages

To check the installed version of all npm packages in your project, you can use the npm listcommand.

npm list

Output:

├─┬ express@4.17.1│ ├─┬ accepts@1.3.7│ │ ├─┬ mime-types@2.1.26│ │ │ └── mime-db@1.43.0│ │ └── negotiator@0.6.2│ ├── array-flatten@1.1.1│ ├─┬ body-parser@1.19.0│ │ ├── bytes@3.1.0│ │ ├── content-type@1.0.4 deduped│ │ ├── debug@2.6.9 deduped│ │ ├── depd@1.1.2 deduped│ │ ├─┬ http-errors@1.7.2│ │ │ ├── depd@1.1.2 deduped│ │ │ ├── inherits@2.0.3│ │ │ ├── setprototypeof@1.1.1 deduped│ │ │ ├── statuses@1.5.0 deduped│ │ │ └── toidentifier@1.0.0│ │ ├─┬ iconv-lite@0.4.24│ │ │ └── safer-buffer@2.1.2│ │ ├── on-finished@2.3.0 deduped│ │ ├── qs@6.7.0 deduped

Note: The npm list command doesn’t only show the installed version of packages, but also their dependencies (version).

For globally installed packages, you can use the npm list -g command.

Installed version of a particular package

To check the installed version of a particular package, you can use the npm list command by specifying a package name.

Example:

npm list express

Output:

node-project@1.0.0 /Users/saigowtham/Desktop/node-project└── express@4.17.1

If you want to check the latest version of a package available in npm repository, you can usethe npm view package-name version command.

npm view express version

Output:

4.17.1
How to check the version of an installed npm package (2024)
Top Articles
Latest Posts
Article information

Author: Kelle Weber

Last Updated:

Views: 5804

Rating: 4.2 / 5 (73 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Kelle Weber

Birthday: 2000-08-05

Address: 6796 Juan Square, Markfort, MN 58988

Phone: +8215934114615

Job: Hospitality Director

Hobby: tabletop games, Foreign language learning, Leather crafting, Horseback riding, Swimming, Knapping, Handball

Introduction: My name is Kelle Weber, I am a magnificent, enchanting, fair, joyous, light, determined, joyous person who loves writing and wants to share my knowledge and understanding with you.