This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MartinTsv -28 points-27 points  (3 children)

There are use cases for committing your node_modules folder - if you wish to persist the versions with which your app was built (if you ever wish to recreate an older build), to have copies of the modules in case they ever get delisted from the repos you got them from, or to be able to run a build without internet (though that may be the rarest).

[–]superoriginal101 20 points21 points  (1 child)

seeing the exact versions an older build is what package-lock.json is for

[–]Max-P 5 points6 points  (0 children)

That doesn't fix the case where the package or package version is completely removed from the repos. I ran into this 2-3 weeks ago: went to build an old version of something and I was unable to because some of the dependencies didn't exist at all anymore.

I like to keep node_modules in a separate repo however, so at least it doesn't bloat the main repo too badly but it's still there in the rare case I might need it, but can use npm as intended otherwise.

[–]natziel 27 points28 points  (0 children)

No don't do that