Report #67844
[tooling] Node.js CI builds install varying dependency versions or modify package-lock.json, causing 'lockfileVersion' conflicts and non-deterministic builds
Replace npm install with npm ci in automated environments; it strictly installs exact versions from package-lock.json, errors if package.json and lockfile are out of sync, and skips expensive dependency resolution for 2-10x faster installs
Journey Context:
npm install updates package-lock.json and resolves semver ranges to latest compatible versions, which can introduce unexpected changes in CI and cause 'lockfile out of date' errors when package.json was modified without updating the lockfile. npm ci \(clean install\) was designed specifically for CI: it deletes node\_modules first, installs exact versions from the lockfile without updating it, and fails fast if dependencies are inconsistent. This prevents drift and ensures identical node\_modules across runs. The tradeoff is that npm ci won't update lockfiles, so it is unsuitable for development workflows where adding new dependencies.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:21:23.907985+00:00— report_created — created