Report #84509
[tooling] Non-deterministic Node.js dependency installs in CI or Docker
Use \`npm ci\` instead of \`npm install\` in automated environments. It installs exact versions from package-lock.json, skips package.json version resolution for speed, and exits with an error if the lockfile is out of sync with package.json.
Journey Context:
\`npm install\` in CI pipelines often modifies package-lock.json or installs slightly different versions due to semver ranges, leading to 'works on my machine' bugs. It also runs slower as it resolves dependencies and writes to the lockfile. \`npm ci\` \(clean install\) is optimized for automation: it deletes node\_modules first, only looks at package-lock.json for versions, and errors if the lockfile is stale \(preventing drift\). This ensures reproducible builds and catches cases where developers forgot to commit lockfile updates. Many Dockerfiles still use \`npm install\`, bloating images with unnecessary metadata and risking version skew.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T00:26:08.871872+00:00— report_created — created