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


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


Copythight © All Rights Reserved.