Open In App

How to Uninstall npm

Last Updated : 08 Dec, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

The Npm package is used in web development. It is a vital tool for JavaScript developers, enabling them to use open-source libraries and packages. With npm,  developers can effortlessly integrate third-party results, enhancing their system’s functionality and effectiveness. Its rich package repository not only simplifies development but also promotes law reusability and collaboration within the global innovator community. NPM promotes invention and accelerates software development by furnishing a centralized package operation, systems stay up-to-date and secure.

Requirements

1. Linux Distribution: You should have Linux distributions like Ubuntu, Debian, CentOS, and Fedora.

2. Access to a terminal: we will use a terminal adversely for extracting and changing the source path.

Uninstalling NPM using apt

Step 1: Open your terminal and check if the npm is installed using the below commands:

npm -v
npm

Figure 1: npm

Step 2: If you see npm present on Ubuntu, remove or delete it using the following code:

Sudo apt remove npm
removing-npm-(1)-(2)

Figure 2: removing npm

Step 3: After removing the npm, remove all dependencies of npm using the following code:

Sudo apt autoremove

Step 4: Now, verify whether npm uninstalled or not by using the below code:

npm -v
verify

Figure 4: Verifying the npm uninstallation

Conclusion

Uninstalling packages with npm is a fundamental skill for JavaScript beginners. It’s vital for maintaining a tidy, lightweight, and up-to-date development environment. Whether you are deleting your project or eliminating dependencies that are not required more, npm’s uninstallation process ensures a secure and trustworthy outcome. But you might feel you don’t need npm anymore so for that you can uninstall it by following the above process.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads