by Sai gowtham

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:

  1. Navigate to the project directory in your terminal.
  2. Delete the node_modules folder by running the following command.
rm -rf node_modules
  1. 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:

  1. First, uninstall the package by running the npm uninstall command followed by the package-name.
npm uninstall react

Here react is the package name.

  1. Install the package again by running the npm install command followed by the package-name.
npm install react

Top Udemy Courses

JavaScript - The Complete Guide 2020 (Beginner + Advanced)
JavaScript - The Complete Guide 2020 (Beginner + Advanced)
45,614 students enrolled
52 hours of video content
View Course
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
284,472 students enrolled
40 hours of video content
View Course
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
130,921 students enrolled
21 hours of video content
View Course