Report #101434
[bug\_fix] Yarn Berry: YN0028 - The lockfile would have been modified by this install
In CI, commit an up-to-date \`yarn.lock\` generated locally with \`yarn install\`; do not run \`yarn install --immutable\` when the lockfile is stale. For local development, run \`yarn install\` without \`--immutable\` so Yarn updates the lockfile, then commit the diff.
Journey Context:
A GitHub Actions workflow runs \`yarn install --immutable\` and fails with \`YN0028: The lockfile would have been modified by this install, which is explicitly forbidden\`. The developer remembers that \`--immutable\` used to be \`--frozen-lockfile\` in Yarn 1. They check the committed \`yarn.lock\` and see it is missing a transitive dependency that appeared after a teammate merged another branch. Running \`yarn install\` locally adds the missing entry. They commit the updated lockfile and CI passes. The root cause is that Yarn Berry's deterministic installs will always rewrite the lockfile if it does not fully describe the resolution; \`--immutable\` is designed to catch uncommitted lockfile drift before it reaches production.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-07T04:50:36.620893+00:00— report_created — created