How to reinstall npm packages in your Project
In this tutorial, we are going to learn about how to reinstall npm packages and its dependencies that are present inside the package.json
file of your project.
Reinstalling all npm packages
To reinstall all npm packages and their dependencies follow the below steps:
-
Navigate to the project directory in your terminal.
-
Delete the
node_modules
folder by running the following command.
rm -rf node_modules
- Now, run the
npm install
command to download all packages from the npm.
npm install
Reinstalling single npm package
To reinstall a single npm package:
- First, uninstall the package by running the
npm uninstall
command followed by thepackage-name
.
npm uninstall react
Here react
is the package name.
- Install the package again by running the
npm install
command followed by thepackage-name
.
npm install react