How to remove node_modules from github repository

6 months agoa minute read

If you have accidentally added the node_modules folder to your github repo and want to remove it from reomte repository then follow the steps bellow

First add /node_modules to your .gitignore file

.gitignore
/node_modules
...

Then run the following commands

git rm --cached node_modules -r
git add . 
git commit -m "removed node_modules"
git push

After that the node_modules folder will no longer be in your repository

Write your comment

Login to comment

ShahriyarAlam

Copythight © All Rights Reserved.