How to reinstall node modules ?

Solve almost anything by learning how to reinstall nodes modules.

There are lot of small issue you can run when developping using nodes. It can be in reactjs or angular.

Everytime i run into issue i didn’t know how to solve it, i reinstall node modules. In this post, let learn how to do it.

How to reinstall node modules ?

Here the command line to solve module not found errors :

rm -rf node_modules
rm -f package-lock.json


# clean npm cache
npm cache clean --force

# install packages
npm install

It’s all! If you are in windows you can simply delete manually node_modules and package-lock.json files . Then just add these command :

# clean npm cache
npm cache clean --force 

# install packages
npm install

Now happy coding !

Leave a Comment