Docker and CI/CD · Junior · Question 49 of 75
Why use npm ci rather than npm install in CI?
- ✓Correct answer: It installs exactly the lockfile and fails if it's out of sync
- 2It skips dev dependencies, which tests never need
- 3It installs packages without downloading them from npm
Explanation
npm ci deletes node_modules and installs exactly what the lockfile says, never updating it. Builds become reproducible.