Skip to content
Home » How to remove node modules from git

How to remove node modules from git

Let’s start the discussion about How to remove node modules from git in following methods. For items you deploy, such as websites and apps, check node modules into git. For libraries and modules that will be reused, do not check node modules into git. npm should be used to handle dependencies in your development environment, but not in your deployment scripts.

Remove node_modules from git

Initially make the .gitignore file and run the below commands one by one in the terminal. Hope this solves your issue.

git rm -r --cached node_modules
git commit -am "node_modules are gone"
git push origin master

I hope the strategies listed above work for you. Happy coding and come back again.

Similar Post : How to restart Apache