How to delete node_modules

In this article let’s discuss about How to delete node_modules. Let’s go through the following methods without any delay.

Method 1:

# Do the below steps -
# Make .gitignore file.
# Run below commands in your terminal

git rm -r --cached node_modules

git commit -am "node_modules be gone!"

git push origin master

If you are facing any issues with the above approach then try the alternative that is given below. It may look similar but have a try!

Method 2 :

rm -rf node_modules/
npm install

Hope the above solution works.

Realted Posts : Powershell execute command only if previous successful