Removing Globally Installed Packages
The npm uninstall command can also be used to remove a package from the global environment. The -g option allows this to take place. In the following command we remove the mongoose package from the global environment:
npm uninstall -g <package-name>
Example:
npm uninstall -g mongoose
Output:
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 dependencies, troubleshooting issues, or streamlining your project’s footprint. In this guide, we’ll walk through the various methods to uninstall npm packages from your project.
Table of Content
- Removing Package using npm
- Removing Packages from package.json
- Removing Multiple Packages
- Removing Globally Installed Packages
- Uninstall Specific Version Package
- Uninstalling all Unused Packages
- Conclusion
Contact Us