How to remove node_modules from git

In this article let’s discuss about How to remove node_modules from git. 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 :

remove node_modules
git rm -r --cached node_modules

git commit -am "node_modules be gone!"

git push origin master

Hope the above solution works.

Realted Posts : How to install scikit learn python library