Node.js · Junior · Question 26 of 75
How is npm ci different from npm install?
- 1It only checks for vulnerabilities and installs nothing
- ✓Correct answer: It installs exactly what the lock file says, deletes
node_modulesfirst and fails if the lock file andpackage.jsondon't match - 3It installs packages faster by skipping dependencies
Explanation
npm ci is meant for CI and Docker builds where installs must be clean and reproducible. It never changes package.json or the lock file.