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:
Node.js vs Browser - Top Differences That Every Developer Should Know
Next article icon

15 npm Commands that Every Node.js Developer Should Know

Last Updated : 03 Jun, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

NPM stands for Node Package Manager and it is the package manager for the Node JavaScript platform. It put modules in place so that node can find them, and manages dependency conflicts intelligently. Most commonly, it is used to publish, discover, install, and develop node programs.

Some Important npm commands every developer should know are:

  • NPM Install Command: Installs a package in the package.json file in the local node_modules folder.
    npm install

    Example:

    Image shows the use of “npm install” that install package.json and package-lock.json

  • NPM Uninstall Command: Remove a package from the package.json file and removes the module from the local node_modules folder.
    npm uninstall 

    Example:

    Image shows a package ‘lodash’ which is an npm package being un-installed using npm uninstall command

  • NPM Update Command: This command updates the specified package. If no package is specified then it updates all the packages in the specified location.
    npm update 

    Example:

    the original lodash version 4.17.20 -> updated to 4.17.21 using npm update command

  • NPM Global Update Command: This command will apply the update action to each globally installed package.
    npm update -g

    Example:

    npm update -g updates all of the packages if it’s available.

  • NPM Deprecate Command: This command will deprecate the npm registry for a package, providing a deprecation warning to all who attempt to install it.
    npm deprecate
  • NPM Outdated Command: Checks the registry if any (or specified) package is outdated. It prints a list of all packages which are outdated.
    npm outdated

    Example:

    lodash package as indicated in the terminal is outdated that can be updated

  • NPM Doctor Command: Checks our environment so that our npm installation has what it needs to manage our JavaScript packages.
    npm doctor

    Example:

  • NPM Initialize Command Creates a package.json file in our directory. It basically asks some questions and finally creates a package.json file in the current project directory.
    npm init

    image shows the steps involved in npm init command.

  • NPM Start Command Runs a command that is defined in the start property in the scripts. If not defined it will run the node server.js command.
    npm start
  • NPM Build Command: It is used to build a package.
    npm build

    Example:

    Shows that there is a major update is available and can be updated using the command given after the changelog.

  • NPM List Command: Lists all the packages as well as their dependencies installed.
    npm ls

    Example:

    npm ls lists all of the npm packages installed in the package.json file.

  • NPM Version Command: Bumps a package version.
    npm version

    Example:

    Lists out all packages version installed or used in the project.

  • NPM Search Command: Searches the npm registry for packages matching the search terms.
    npm search

    shows the description of the package lodash and all commits and author who made the changes.

  • NPM Help Command: Searches npm help documentation for a specified topic. It is used whenever the user needs help to get some reference.
    npm help

    Example:5d3dda7b67b6415d8af8e6e383d4613d-copy-2

  • NPM Owner Command: Manages ownership of published packages. It is used to manage package owners.
    npm owner


Next Article
Node.js vs Browser - Top Differences That Every Developer Should Know
author
mihir0699
Improve
Article Tags :
  • JavaScript
  • Node.js
  • Web Technologies
  • NodeJS-Questions

Similar Reads

  • 7 JavaScript Concepts That Every Web Developer Should Know
    JavaScript is Everywhere. Millions of web pages are built on JavaScript and it’s not going anywhere at least for now. On one side HTML and CSS give styling to the web pages but on the other side, it's the magic of JavaScript that makes your web page alive. Today this language is not just limited to
    10 min read
  • Node.js vs Browser - Top Differences That Every Developer Should Know
    Node.js and Web browsers are two different but interrelated technologies in web development. JavaScript is executed in both the environment, node.js, and browser but for different use cases. Since JavaScript is the common Programming language in both, it is a huge advantage for developers to code bo
    6 min read
  • 12 JavaScript Code Snippets That Every Developer Must Know
    JavaScript is by far the most popular language when it comes to web development. It is being used on both the client side and the server side. To improve coding efficiency, every developer should know essential JavaScript code snippets to make their development fast and easy. 1. Sorting an ArraySort
    4 min read
  • Top 10 JavaScript Fundamentals That Every Developer Should Know
    Javascript is an object-oriented language that is lightweight and used for web development, web applications, game development, etc. It enables dynamic interactivity on static web pages, which cannot be done with HTML, and CSS only. Javascript is so vast that even mid-level professionals find it dif
    8 min read
  • Top 10 Node Js Developer Skills to Have in 2025
    In today’s world, Node JS is used everywhere. Companies like LinkedIn, PayPal, and Netflix utilize Node JS for their web services. Slack uses Node JS for its backend to handle real-time messaging. It is used for developing RESTful APIs due to its non-blocking I/O model. Uber and eBay have microservi
    8 min read
  • 5 Essential Tools Every MERN Stack Developer Should use
    To increase productivity, efficiency, and development experience, it is very important to have the right set of tools. In this post, we will explore the 5 most important essential tools that everyone should use if you are a MERN developer. In full-stack web development, the MERN stack is one of the
    3 min read
  • The Pros and Cons of Node.JS in Web Development
    Node.js is a platform that allows developers to build highly scalable applications using JavaScript. It has become the most popular language for developing real-time apps, especially in the enterprise space where it can handle thousands of simultaneous connections while maintaining low latency and h
    11 min read
  • Top 10 JavaScript Concepts for Node.js Developers
    In 2024, JavaScript remains the most important part of web development, with its significance in Node.js development reaching new heights. As Node.js evolves, developers need to stay updated on the latest JavaScript concepts and principles for creating efficient, scalable, and secure web application
    11 min read
  • Why to Use Node.js For Backend Development?
    JavaScript is the universal language for building web applications. It is used in frontend (client-side) and backend (server-side) development as well. But the truth that the beauty of the front-end relies on the back-end can't be denied. This is when NodeJS comes into the picture. Node.js is the be
    7 min read
  • Node.js Basics: Back-End Development in MERN Stack
    Node.js is an open-source and cross-platform JavaScript runtime environment. It’s a powerful tool suitable for a wide range of projects. Node.js stands out as a game-changer. Imagine using the power of JavaScript not only in your browser but also on the server side. Table of Content What is MERN sta
    7 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