Report #4051
[tooling] CI builds fail intermittently due to npm dependency drift
Use npm ci instead of npm install in CI pipelines; it deletes node\_modules and uses package-lock.json strictly without modifying it
Journey Context:
npm install updates package-lock.json when package.json and lockfile versions diverge, causing non-deterministic builds where CI installs different versions than local development. Developers often use install in CI out of habit, leading to 'works on my machine' failures when lockfiles drift. npm ci is specifically designed for automated environments: it fails fast if package.json and lockfile are inconsistent, skips expensive dependency resolution by reading the lockfile directly, deletes existing node\_modules to ensure clean state, and never writes to lockfiles. This guarantees reproducible builds and is typically faster than install for cold caches. Using install in CI is an anti-pattern that destroys the deterministic guarantee of lockfiles.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:44:26.460346+00:00— report_created — created