How to check the npm version installed on your computer (2024)

by Nathan Sebhastian

Posted on May 26, 2022

Reading time: 2 minutes

How to check the npm version installed on your computer (1)

Once you installed Node.js on your computer, you can check the version of npm that was bundled with it.

The command to check your npm version is npm -v or npm --version. Type it in your terminal and you should see the following output:

The output above means npm has been installed successfully on your computer.

Next, let’s see how you find the version of an installed npm package.

Find the version of an installed npm package

The version of npm packages installed on your computer can be found by running the npm list command.

First, navigate to the root directory of your project, then run the npm list command.

You should see the output below in your terminal:

$ npm list[emailprotected] /Users/nsebhastian/Desktop/DEV/n-app├── [emailprotected]├── [emailprotected]├── [emailprotected]├── [emailprotected]├── [emailprotected]└── [emailprotected]

The output above shows the packages installed in the node_modules/ folder.

If you’re using an older npm version, then you might see the list of all modules installed, including the dependencies of your top-level modules.

For example, here’s the output when I run npm list using npm v6:

$ npm list[emailprotected] /Users/nsebhastian/Desktop/DEV/n-app├─┬ [emailprotected]│ ├── [emailprotected]│ └── [emailprotected]├─┬ [emailprotected]│ ├─┬ [emailprotected]│ │ ├─┬ [emailprotected]│ │ │ └── [emailprotected]│ │ └── [emailprotected]│ ├── [emailprotected]# ...

The output above also shows the dependency packages installed for your modules, such as object-assign and vary installed as dependencies of the cors package.

To make npm show only the top-level modules, add the --depth=0 option to the npm list command:

$ npm list --depth=0[emailprotected] /Users/nsebhastian/Desktop/DEV/n-app├── [emailprotected]├── [emailprotected]├── [emailprotected]├── [emailprotected]├── [emailprotected]└── [emailprotected]

In the latest npm version, --depth=0 is the default option automatically added to the command, so you don’t need to add it anymore.

Check the version of globally installed npm packages

To check the version of globally installed npm packages, run the npm list command with the -g or --global option added.

Here’s an example:

$ npm list -g/Users/nsebhastian/node/lib├── [emailprotected]└── [emailprotected]

For older npm versions, you might want to add --depth=0 option to show only top-level modules:

npm list -g --depth=0/Users/nsebhastian/node/lib├── [emailprotected]└── [emailprotected]

And that’s how you check the versions of globally installed npm packages.

How to check the npm version installed on your computer (2024)

FAQs

How to check the npm version installed on your computer? ›

Method 1: Using the “npm list” command. One way to check the version of an installed npm package is by using the “npm list” command. This command displays a tree-like structure of all installed packages and their dependencies.

How to check npm installed version? ›

Method 1: Using the “npm list” command. One way to check the version of an installed npm package is by using the “npm list” command. This command displays a tree-like structure of all installed packages and their dependencies.

How to check all npm installed? ›

The short answer
  1. To list globally installed packages with npm, you can use the npm ls command combined with the -g flag (short for global):
  2. Alternatively, to list locally installed packages present in the node_modules folder of a project, you can navigate to your project and run the npm ls command (without the -g flag):
Feb 1, 2024

How to check where npm is installed in Windows? ›

The location of globally installed packages depends on your operating system and npm configuration: Windows: Packages are installed in %APPDATA%\npm\node_modules . macOS and Linux: Packages are typically installed in /usr/local/lib/node_modules or a user-specific directory like ~/.

How to check npm i node module version? ›

Methods to check the installed version of Node. js
  1. npm ls. Checking globally installed packages on our machine using the below command.
  2. npm list -g. Checking specific package globally installed node. ...
  3. npm ls -g <package_name> ...
  4. npm list --depth=0.
May 30, 2024

How do I select a version of npm install? ›

For npm install specific version, use npm install [package-name]@[version-number]. Use npm view [package-name] version to know the specific latest version of a package available on the npm registry. Use npm list [package-name] to know the specific latest version of an installed package.

What is in the npm version? ›

npm uses the tilde (~) and caret (^) to designate which patch and minor versions to use respectively. If you see ^1.0. 2 it means to install version 1.0. 2 or the latest minor or patch version such as 1.1.

What is the command for npm install? ›

npm Install Globally

Install a package on your system globally. Use the following command to install a package on your system globally: npm install <package_name> --global.

How do I check my npm configuration? ›

Run npm config ls -l to see a set of configuration parameters that are internal to npm, and are defaults if nothing else is specified.

How to check npm commands? ›

$ npm-check -gu # Update globally installed modules by picking which ones to upgrade.
  1. -u, --update. Show an interactive UI for choosing which modules to update. ...
  2. -y, --update-all. ...
  3. -g, --global. ...
  4. -s, --skip-unused. ...
  5. -p, --production. ...
  6. -d, --dev-only. ...
  7. -i, --ignore. ...
  8. -E, --save-exact.
Jul 16, 2022

How to check node version? ›

To check your version of Node. js, open Terminal (or another CLI of your choice), and type the command node -v . Press Enter.

How to check npm version in VS Code? ›

Run npm --version from a terminal or command prompt to quickly check that npm is installed and available. npm is installed with the Node. js runtime, which is available for download from Nodejs.org. Install the current LTS (Long Term Support) version and the npm executable will be added by default to your system path.

How to check npm packages installed? ›

To list npm user-installed packages, you can use the npm list command in the terminal. By default, this command will show a tree-like structure of all installed packages for the current project. If you want to see a list of globally installed packages (user-installed), you can add the -g flag.

How do I know if npm React is installed? ›

Navigate into the package. json file and open it in the VS code or other source code editor: Inside the dependencies section, you can check the React version that is currently installed or running on your system.

Top Articles
RV Mail Forwarding $19 a Month
Option Pricing Models
Poe T4 Aisling
Foxy Roxxie Coomer
Kmart near me - Perth, WA
Po Box 7250 Sioux Falls Sd
Bj 사슴이 분수
My E Chart Elliot
Mrh Forum
Boomerang Media Group: Quality Media Solutions
Math Playground Protractor
Blairsville Online Yard Sale
How to Type German letters ä, ö, ü and the ß on your Keyboard
Puretalkusa.com/Amac
Strange World Showtimes Near Cmx Downtown At The Gardens 16
Walgreens On Nacogdoches And O'connor
Crusader Kings 3 Workshop
What Time Chase Close Saturday
U/Apprenhensive_You8924
Youravon Comcom
My.tcctrack
Craftology East Peoria Il
Parent Resources - Padua Franciscan High School
Zalog Forum
Pay Boot Barn Credit Card
A Man Called Otto Showtimes Near Cinemark University Mall
Preggophili
12657 Uline Way Kenosha Wi
Wbap Iheart
Weather Underground Durham
Tracking every 2024 Trade Deadline deal
Craigslist Boerne Tx
Kleinerer: in Sinntal | markt.de
The Posturepedic Difference | Sealy New Zealand
Angel del Villar Net Worth | Wife
Syracuse Jr High Home Page
Boondock Eddie's Menu
Babbychula
Texters Wish You Were Here
Lake Dunson Robertson Funeral Home Lagrange Georgia Obituary
Kips Sunshine Kwik Lube
Stanford Medicine scientists pinpoint COVID-19 virus’s entry and exit ports inside our noses
Blasphemous Painting Puzzle
2700 Yen To Usd
Ashoke K Maitra. Adviser to CMD&#39;s. Received Lifetime Achievement Award in HRD on LinkedIn: #hr #hrd #coaching #mentoring #career #jobs #mba #mbafreshers #sales…
Cygenoth
The Conners Season 5 Wiki
Torrid Rn Number Lookup
Brother Bear Tattoo Ideas
Gear Bicycle Sales Butler Pa
라이키 유출
What Responsibilities Are Listed In Duties 2 3 And 4
Latest Posts
Article information

Author: Lilliana Bartoletti

Last Updated:

Views: 6022

Rating: 4.2 / 5 (73 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Lilliana Bartoletti

Birthday: 1999-11-18

Address: 58866 Tricia Spurs, North Melvinberg, HI 91346-3774

Phone: +50616620367928

Job: Real-Estate Liaison

Hobby: Graffiti, Astronomy, Handball, Magic, Origami, Fashion, Foreign language learning

Introduction: My name is Lilliana Bartoletti, I am a adventurous, pleasant, shiny, beautiful, handsome, zealous, tasty person who loves writing and wants to share my knowledge and understanding with you.