Skip to content

Why is node_modules in gitignore? #4785

Answered by alymurtazamemon
cyberdisc0 asked this question in Q&A
Discussion options

You must be logged in to vote

@cyberdisc0 Because it contains a large number of dependencies and packages that are installed by the npm package manager when you run npm install in a project. Adding the node_modules folder to the .gitignore file helps to keep the size of the Git repository small and reduces clutter in the Git history. And every developer knows after cloning any repo first we need to install the dependency so they run the npm install command and all of the dependencies and packages they can get back.

This is a command practice, not a necessary thing, if you want you can add it.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alymurtazamemon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants