Remove NPM - npm uninstall
Last Updated :
31 May, 2024
To remove npm (Node Package Manager) from your macOS system, you can't use npm uninstall since npm itself doesn't support uninstalling itself. Instead, you need to remove it manually along with Node.js.
What is NPM?
NPM is a package manager for the JavaScript programming language maintained by Microsoft's npm, Inc. npm is the default package manager for the JavaScript runtime environment Node.js and is included as a recommended feature in the Node.js installer.
What is NPM remove?
npm remove is a command-line interface (CLI) command provided by npm to uninstall packages from your Node.js project. Before removing, let's learn how to install packages using npm.
Installing a package using npm
To install a package using npm (Node Package Manager), you can follow these steps.
1. Open your Terminal or Command Prompt: Navigate to the directory of your Node.js project or create a new directory where you want to install the package.
2. Use the npm install command:
npm install <package_name>
or
npm i <package_name>
Replace <package_name> with the name of the package you want to install.
Example: In this example we will install bycrypt package
npm i bcrypt
or
npm install bycrypt
installing bycrypt package using npmUninstalling a Package using npm
Use the npm uninstall command to remove any installed package:
npm uninstall <package_name>
Replace <package_name> with the name of the package you want to remove.
Example: In this example we will install bycrypt package
npm uninstall bycrypt
uninstalling bcryptRemove npm
npm install
macOS and Linux:
You can uninstall npm using the following command in the terminal:
sudo npm uninstall npm -g
This command removes npm globally from your system.
Windows:
npm uninstall npm -g
This command should be executed in a command prompt or PowerShell with administrator privileges.

Note: After executing the appropriate command for your operating system, npm should be successfully removed from your system. You can verify its removal by checking if npm commands no longer work in your terminal or command prompt.
Remove a Dev Dependency
To remove a dev dependency, you need to attach the "-D" or "--save-dev" flag to the npm uninstall and then add package name after it.
npm uninstall -D <package_name>
or
npm uninstall --save-dev <package-name>
Example: In this example we will first install then uninstall nodemon dev dependency
Install:
npm uninstall -D nodemon
uninstall nodemonUpdated package.json file.
after installationUninstall:
npm uninstall -D nodemon
uninstall nodemon
Similar Reads
Remove NPM - npm uninstall
To remove npm (Node Package Manager) from your macOS system, you can't use npm uninstall since npm itself doesn't support uninstalling itself. Instead, you need to remove it manually along with Node.js. Table of Content What is NPM?What is NPM remove?Installing a package using npmUninstalling a Pack
2 min read
How to uninstall PyCharm?
Python is one of the most popular languages referred to by many developers and programmers. Python provides different features which enhance the productivity of application development. To code Python applications, we prefer various IDE (Integrated Development Kit) like VSCode, Spyder, Jupyter, etc.
4 min read
Remove NPM Package
NPM, which stands for Node Package Manager, is the default package manager of Node.js. Developed by Isaac Z. Schlueter, NPM is written in JavaScript and was initially released on the 12th of January, 2010. Removing npm packages is a common task in Node.js development, whether you're cleaning up depe
2 min read
pnpm vs npm
In JavaScript, package managers are crucial in managing project dependencies efficiently. Two of the most popular package managers are npm (Node Package Manager) and pnpm (Performant npm). While both serve the same fundamental purpose of installing and managing packages they differ significantly in
4 min read
How to uninstall packages from Linux?
In this article, we will learn to uninstall the different types of packages from Linux. Let's understand the uninstalling process through some examples: Example 1: Uninstall a package using apt-get In this example, we will remove GIMP, a graphics software that was installed with the help of apt-get.
2 min read
How To Reinstall Packages With NPM ?
Reinstalling packages with npm is a common task in Node.js development when you need to refresh or update dependencies for your project. This process ensures that you have the latest versions of packages and resolves any issues related to package versions or corrupted installations. This article wil
3 min read
How To Uninstall Specific Version In Numpy
NumPy is a fundamental library in Python programming. In the development of projects, versioning allows development teams to keep track of changes they make to the project code. The changes could be functions, features, bug fixes, and more. So that is managing library versions becomes crucial. With
2 min read
How to Uninstall an Instance of SQL Server?
SQL Server is a Relational Database Management system that was developed and marketed by Microsoft. In this article, we will look into how to uninstall an instance of SQL Server setup: Prerequisites:To uninstall SQL Server, you need to have local administrator permissions.Back up your data. You coul
2 min read
NPM Register
The NPM Registry serves as a central repository for JavaScript packages, enabling developers to publish, discover, and install packages for use in their projects. This article delves into the npm Registry, providing a detailed guide on registering and managing packages. Table of Content Understandin
3 min read
How to Uninstall and Update Brew in MacOS?
Despite being a useful tool, individuals Install Mac Brew to make Mac Terminal more interactive. Occasionally, there is a need to Update Brew Mac to get the latest upgrade. However, if you are tired of the Mac Homebrew Package and want to get rid of it, then there is a simple way to Uninstall Brew P
3 min read