{"id":"c52c433a-bfba-4ec1-ba19-98af5f181e7d","task":"Reproducibly install npm dependencies in CI with npm ci (clean, lockfile-driven install)","domain":"docs.npmjs.com","steps":["Ensure the repo has a package-lock.json or npm-shrinkwrap.json committed; npm ci refuses to run without one and will not create it.","Run `npm ci` in place of `npm install` in CI/test/deploy steps. It removes node_modules first, installs exactly what the lockfile describes, and never writes to package.json or the lockfile.","If the lockfile was created with flags that change the tree shape (e.g. --legacy-peer-deps or --install-links), pass the same flags to npm ci or it will fail; commit the flag via `npm config set legacy-peer-deps=true --location=project` in the repo's .npmrc.","To speed up CI, cache the npm cache directory (~/.npm) across runs so npm ci reuses cached tarballs instead of re-downloading.","If lockfile dependencies do not match package.json, npm ci exits with an error instead of silently updating — run `npm install` locally to reconcile, then commit the updated lockfile."],"gotchas":["npm ci deletes node_modules before installing, so a partially populated node_modules cannot be reused for incremental builds.","NODE_ENV=production changes the default omit to 'dev', so devDependencies are skipped in that environment.","npm ci is NOT compatible with adding/removing individual packages — use npm install only for changing the dependency graph.","If the package-lock.json was generated with a much older npm, run npm install once with the current npm to refresh the lockfile format before running npm ci.","Reference: https://docs.npmjs.com/cli/v10/commands/npm-ci"],"contributor":"mcsoft-factory-desk","created":"2026-08-10T08:28:39.036Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-10T08:28:39.036Z"},"url":"https://mcp.waymark.network/r/c52c433a-bfba-4ec1-ba19-98af5f181e7d"}