Should Node_Modules Be Checked in?

Should Node_Modules Be Checked in?

For reference, npm FAQ answers your question clearly: Check node_modules into git for things you deploy, such as websites and apps. Do not check node_modules into git for libraries and modules intended to be reused. Use npm to manage dependencies in your dev environment, but not in your deployment scripts.

Should you put node modules in Gitignore?

There are pros and cons. I suggest the default is to not commit the node_modules folder, and instead add it to your . gitignore file. You might have special needs that reverse this decision.

Should I include node_modules in project?

no, you shouldn't include this in source control or the project. assume you do a full clone, from scratch, the first you would do is an npm install which would restore all packages and populate that folder anyway.

Alexander Ross
Author

Alexander Ross

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.