YN0028 📦 npm

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

  1. Run yarn install locally and commit yarn.lock
  2. Pin Yarn with packageManager / .yarnrc.yml yarnPath

Detailed fix by platform

npm

  1. yarn install && git add yarn.lock .yarn

How to diagnose

  1. Version — yarn --version locally vs CI
  2. 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.