SIGN IN SIGN UP

fix(patch): explain out-of-sync lockfile after --ignore-patch-failures (#9576)

When `--ignore-patch-failures` skips a broken patch, the package
installs unpatched and the lockfile records no `patched` entry, but
`package.json` still declares it. A later `npm ci` then fails with a
generic out-of-sync `EUSAGE` whose "run `npm install`" advice is wrong
(a plain install just re-fails with `EPATCHFAILED`).

The state can't be reconciled automatically — recording the patch would
be a lie, and rewriting `package.json` would discard the user's intent.
So this PR makes the out-of-sync state self-explanatory:

- `reify.js`: when a patch is skipped, warn that the lockfile is now out
of sync with `package.json` and `npm ci` will fail until the patch is
fixed or its `patchedDependencies` entry is removed.
- `validate-lockfile.js`: make the patch mismatch error direction-aware.
A patch declared in `package.json` but missing from the lockfile names
`--ignore-patch-failures` and gives remediation; a patch in the lockfile
that `package.json` dropped says so; integrity/path drift keeps the
existing message. This flows into the `npm ci` `EUSAGE`.

## References

Fixes #9573
M
Manzoor Wani committed
62b0694d5ec4c529076bf968c3fe6cd47c3f2bb0
Parent: cfda867
Committed by GitHub <noreply@github.com> on 6/18/2026, 8:54:00 PM