Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • NodeJS Tutorial
  • NodeJS Exercises
  • NodeJS Assert
  • NodeJS Buffer
  • NodeJS Console
  • NodeJS Crypto
  • NodeJS DNS
  • NodeJS File System
  • NodeJS Globals
  • NodeJS HTTP
  • NodeJS HTTP2
  • NodeJS OS
  • NodeJS Path
  • NodeJS Process
  • NodeJS Query String
  • NodeJS Stream
  • NodeJS String Decoder
  • NodeJS Timers
  • NodeJS URL
  • NodeJS Interview Questions
  • NodeJS Questions
  • Web Technology
Open In App
Next Article:
How to Define the Required Node.js Version in package.json?
Next article icon

How to Find the Version of an Installed NPM Package in Node.js ?

Last Updated : 30 May, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

NPM is the default package manager for Node.js. NPM manages both internal and external packages or modules used in various Node.js applications. The default packages in NPM may not fulfil all the needs of a developer, so we often require external packages. These can be installed either locally in a specific directory on our machine or globally, making them easily accessible from any location on our machine.

Table of Content

  • Installing NPM Packages Locally
  • Installing NPM package globally
  • Methods to check the installed version of Node.js

Installing NPM Packages Locally

To install an npm package locally, use the following command. This command will install the specified package in your local directory:

npm install <package-name> 

By including keywords like “default package manager for Node.js,” “install npm package locally,” and “manage Node.js packages,” this content should rank better on search engines.

Installing NPM package globally

This command will install the mentioned package globally. Global packages are all installed in a single location on our machine that’s why a globally installed package is accessible in any directory on our machine.

npm install -g <package-name>

Methods to check the installed version of Node.js

Checking locally installed Node.js packages in a particular directory using the below command.

npm ls

Checking globally installed packages on our machine using the below command.

npm list -g

Checking specific package globally installed node.js package using below command.

npm ls -g <package_name>

Checking Local top-level domains of packages only and not all sub-packages using the below command.

npm list --depth=0

Checking Globally Top-level domain node.js packages using the below command.

npm list --depth=0 -g



Next Article
How to Define the Required Node.js Version in package.json?
author
devangj9689
Improve
Article Tags :
  • Node.js
  • Web Technologies
  • Node-npm
  • NodeJS-Questions

Similar Reads

  • How to Find the Version of Installed NPM Package?
    Knowing the version of NPM installed on your system is important especially when working with specific versions of Node JS or when troubleshooting issues. This article provides instructions to check the version of NPM installed on your system. Prerequisites:Node JS Command Line InterfaceSteps To Fin
    1 min read
  • How to install the previous version of Node and npm?
    Installing a specific version of Node.js and npm can be essential for compatibility reasons or to work with legacy projects. In this guide, we’ll go through the steps to install an older version of Node.js and npm on your system. What is NodeJS?Node is a JavaScript runtime(server-side) built on the
    3 min read
  • How to list npm user-installed packages in Node.js?
    What is Node.js? Node.js is an open source and cross-platform runtime environment for executing JavaScript code outside of a browser. Click here for more. What is npm? Here, "npm" stands for "Node Package Manager" which is the package manager for Node.js and serves as a command-line utility for inte
    2 min read
  • How to Find the Exact Version of Installed MongoDB
    Determining the version of MongoDB installed on our system is a fundamental task, whether we are developers, database administrators or system administrators. Knowing the MongoDB version is essential for compatibility testing, troubleshooting, and ensuring we are using the latest features and securi
    3 min read
  • How to Define the Required Node.js Version in package.json?
    Like the other project dependencies we can also define the node js version for a project. As we know that node is javascript runtime so it will not be contained by the normal dependencies. It ensures that the project should run and install only the compaitible node and npm version. ApproachThe defin
    3 min read
  • How to find out which package version is loaded in R
    The packages in R are defined as the R files which are created and compiled to use. The packages in R are stored in the directory named library so when we install any package we need to load it into our current environment using the library() function. After loading them, we can easily find out whic
    1 min read
  • How To Get a List of Globally Installed NPM Packages in NPM?
    To get a list of globally installed NPM packages, there are several methods you can use depending on the level of detail and format you need. Below, we’ll cover two main approaches that utilize different commands to retrieve this information: npm list and npm ls. Table of Content Approach 1: Using '
    2 min read
  • How to Install Node.js and npm on Ubuntu?
    If you're developing JavaScript applications on Ubuntu, knowing how to install Node.js on Ubuntu is essential. Node.js is a powerful runtime environment that enables server-side scripting, while npm, the Node Package Manager, allows you to manage your project's dependencies easily. This guide will w
    7 min read
  • How to Force an NPM Package to Install?
    Forcing an NPM package to install can be necessary in cases where the dependencies of a package are in conflict or when you need to override existing constraints or force the installation of a specific version. Forcing an NPM package to install refers to using specific commands to bypass version con
    3 min read
  • How to Install NPM FS in Node JS ?
    The file system module allows you to work with the file system on your computer NodeJS includes the fs module, to communicate with file systems. It provides functionality for interacting with the file system, such as reading from and writing to files, creating and removing directories, etc. The File
    4 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences