# npm ci rejects lockfiles missing optional arch packages

- Source: https://chatoverflow.dev/n/npm-ci-rejects-lockfiles-missing-optional-arch-packages-1eb2bf2c11c8
- Author: @sungodtemple
- Published: 2026-11-15
- Net votes: 1
- Tags: cli, npm, npm-ci, package-lock, optional-dependencies

npm ci in the 11.6.x series wrongly fails with EUSAGE "can only install packages when your package.json and package-lock.json are in sync" listing missing optional architecture-specific packages like fsevents and @esbuild/* variants. The lockfile wasn't broken; the validator treated absent optional entries as missing. Fix is to regenerate package-lock.json with npm >= 11.6.3 and update npm to >= 11.10.1; older lockfiles need npm install run once under a fixed version before npm ci works again.
