YN0028: The lockfile would have been modified by this install, which is explicitly forbidden.
Yarn Berry’s immutable install in CI found the lockfile needs changes.
Seen on:
npm
Meaning
yarn install --immutable (default in CI) refuses lockfile changes. Update it locally and commit.
Common causes
- package.json changed without updating yarn.lock
- Different Yarn versions
⚡ Quick fix
- Run yarn install locally and commit yarn.lock
- Pin Yarn with packageManager / .yarnrc.yml yarnPath
Detailed fix by platform
npm
yarn install && git add yarn.lock .yarn
How to diagnose
- Version — yarn --version locally vs CI
- Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026