Question about node modules and git


#1

Hi all -

I got stuck in the deploy problem where the meteor build package I was using failed with message, “meteor requires Node v0.10.41 or later”. With help from different forums, I tried a bunch of things and was able to deploy.

One of the things I tried was to remove “node_modules/” from .gitignore. Later I learned this is a bad practice. However, the folder is now in my git repo.

Is it safe to delete the “node_modules/” folder from my git repo, then re-add “node_modules/” to .gitignore?

Also, why is it bad practice to have these in the .git repo?


#2

It just holds a lot of data, so you don’t want it on your remote repo.

It is also easier if you’re working in a team. The person can pull the repo and do npm install and get what is in your packages.json

There are probably other reasons, those are the two I hear cited most often.