fix: Handle Yarn 2+ in @turbo/codemod install commands#12477
Merged
anthonyshew merged 1 commit intomainfrom Mar 28, 2026
Merged
fix: Handle Yarn 2+ in @turbo/codemod install commands#12477anthonyshew merged 1 commit intomainfrom
anthonyshew merged 1 commit intomainfrom
Conversation
Yarn 2+ (Berry) removed `yarn global`, so `getGlobalUpgradeCommand()` now returns undefined for Yarn 2+ and falls through to local install. Also fixes the CLI notify-update suggestion for Yarn Berry users.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
github-actions Bot
added a commit
that referenced
this pull request
Mar 28, 2026
## Release v2.8.22-canary.2 Versioned docs: https://v2-8-22-canary-2.turborepo.dev ### Changes - release(turborepo): 2.8.22-canary.1 (#12473) (`f929b6d`) - fix: Handle Yarn 2+ in @turbo/codemod install commands (#12477) (`64e5ffd`) Co-authored-by: Turbobot <turbobot@vercel.com>
github-actions Bot
added a commit
that referenced
this pull request
Mar 30, 2026
## Release v2.9.0 Versioned docs: https://v2-9-0.turborepo.dev ### Changes - release(turborepo): 2.8.21 (#12472) (`be8dc50`) - fix: Avoid panic for unanchorable/non-UTF8 git paths (#11106) (`5f45fdb`) - release(turborepo): 2.8.22-canary.1 (#12473) (`f929b6d`) - fix: Handle Yarn 2+ in @turbo/codemod install commands (#12477) (`64e5ffd`) - release(turborepo): 2.8.22-canary.2 (#12479) (`be8cf64`) - feat: Accept `experimentalCI` key in turbo.json task config (#12480) (`bff5591`) - release(turborepo): 2.8.22-canary.3 (#12481) (`cd2d25b`) - fix: Prevent pnpm overrides from corrupting resolved peer-dep variants (#12482) (`91d31cf`) - release(turborepo): 2.8.22-canary.4 (#12483) (`a6eabc6`) - fix: Skip writing unchanged files during slow-path cache restore (#12484) (`b7c0001`) - release(turborepo): 2.8.22-canary.5 (#12486) (`3155a35`) - fix: Replace pre-existing symlinks with directories during cache restore (#12488) (`d07bee8`) - release(turborepo): 2.8.22-canary.6 (#12490) (`5e9ba83`) - fix: Follow symlinks during workspace package discovery (#12489) (`f39b370`) - release(turborepo): 2.8.22-canary.7 (#12491) (`c03cc5f`) - fix: Reduce inotify watch count via gitignore-aware directory walking on Linux (#12398) (`664fd88`) - release(turborepo): 2.8.22-canary.8 (#12492) (`841fe79`) --------- Co-authored-by: Turbobot <turbobot@vercel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #8567
getGlobalUpgradeCommand()now returnsundefinedfor Yarn 2+ (Berry removedyarn global), causing the orchestrator to fall through to the correct local install pathyarn dlx @turbo/codemodfor Berry users instead of the invalidyarn global addWhy
Yarn 2+ removed
yarn globalentirely. The codemod was generating invalid install commands for any Yarn Berry project, breaking the final migration step. The local install path already handled Berry correctly via angte("2.0.0")semver check, so the fix lets Berry users naturally reach that path when global install isn't possible.Testing
get-turbo-upgrade-command.test.tscovers all combinations of Yarn 1.x, 2.x, 3.x, and 4.x for both local and global install scenarios. The Yarn 2+/3+ global test cases now verify the fallthrough-to-local behavior instead of asserting the brokenyarn global addoutput.