How do I avoid adding the node_modules to my git working directory?

Viewed 2809

I believe it's best not to add node_modules to a git repository, as someone can install those modules with npm and the package.json file. So how do I add all my project files to the working directory without the node_modules folder? Thank you!

1 Answers

Create a .gitignore file in the root directory of your repo and type in node_modules into that file. Save it, add it to the repo and commit it.

Related