📫 Business - jawadrana2015@gmail.com
To uninstall npm packages from your Node.js project, you can use the npm uninstall command followed by the package name. Here's how you can do it:
Uninstalling a Package:
To uninstall a package that was previously installed in your project, run the following command in your project's root directory:
sh
Copy code
npm uninstall package-name
Replace package-name with the name of the npm package you want to uninstall. For example, to uninstall the Express framework:
sh
Copy code
npm uninstall express
Uninstalling a Package and Removing it from Dependencies:
By default, when you uninstall a package using npm uninstall, npm removes it from your project's node_modules directory but keeps it listed in your package.json file. This allows you to easily reinstall the package later with its specified version.
If you want to uninstall a package and remove it from your package.json dependencies, use the --save flag:
sh
Copy code
npm uninstall package-name --save
For example, to uninstall the Express framework and remove it from dependencies:
sh
Copy code
npm uninstall express --save
Uninstalling a Global Package:
If you installed a package globally using the -g flag, you can uninstall it globally using the npm uninstall -g command:
sh
Copy code
npm uninstall -g package-name
For example, to uninstall the globally installed TypeScript compiler:
sh
Copy code
npm uninstall -g typescript
After running these commands, npm will remove the specified packages from your project or system. If you used the --save flag, npm will also update your package.json file to reflect the removal of the package from dependencies.
#nodejs #javascript #coding #node #backend #nodejstutorial #nodejsdevelopment #tutorial #tutorials #programming #nodeprogramming #npm
0:00 Introduction
0:32 Uninstall Dependencies
0:51 Uninstall Dev Dependencies
Ещё видео!