Removing Packages from package.json
When you uninstall a package using npm uninstall, npm automatically removes the package from your package.json file’s dependencies or devDependencies section. If you want to remove a package from your project’s dependencies without uninstalling it, you can use the –save or –save-dev flag:
npm uninstall --save <package-name> # Removes from dependencies
npm uninstall --save-dev <package-name> # Removes from devDependencies
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