Git · Junior · Question 53 of 75
Why is node_modules usually not committed?
- 1Git can't store folders with many files
- 2npm refuses to install into a Git repository
- ✓Correct answer: It's huge and can be rebuilt from the lockfile
Explanation
Commit package.json and the lockfile instead: npm ci installs exactly the same versions on any machine, and the repository stays small.