How to remove node_modules from github repository?

a month 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
txt/node_modules
...

Then run the following commands

shgit 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

ShahriyarAlam

Copythight © All Rights Reserved.