Report #6756
[bug\_fix] npm ci requires package-lock.json to be in sync with package.json
Run npm install to regenerate the package-lock.json so it matches the current package.json, then commit the updated lockfile. If in CI, ensure the lockfile is committed and not manually edited.
Journey Context:
You run npm ci in your CI pipeline \(GitHub Actions, GitLab CI\) or locally for a clean install. It fails with 'npm ERR\! code EUSAGE' and the message that 'npm ci can only install packages when your package.json and package-lock.json ... are in sync'. You recently manually edited package.json to add a dependency but didn't run npm install locally. Or, you resolved a git merge conflict in package.json but not in the lockfile, leaving them inconsistent. You realize npm ci is strict—it verifies the lockfile matches package.json exactly. You run npm install locally, which updates package-lock.json. You commit both files and push. The CI now passes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T00:49:47.982465+00:00— report_created — created