vercel/turborepo

Failed to update turbo from 2.2.3 to 2.3.3 using @turbo/codemod with Yarn 4.5.3

KuryKat opened this issue · 1 comments

Verify canary release

  • I verified that the issue exists in the latest Turborepo canary release.

Link to code that reproduces this issue

https://github.com/KuryKat/TurboCodemodYarnFour

Which canary version will you have in your reproduction?

2.3.4-canary.2

Enviroment information

D:\repos\Bugs\TurboCodemodYarnFour>npx turbo info 
turbo 2.3.4-canary.2

CLI:
   Version: 2.3.4-canary.2
   Path to executable: D:\repos\Bugs\TurboCodemodYarnFour\node_modules\turbo-windows-64\bin\turbo.exe
   Daemon status: Not running
   Package manager: berry

Platform:
   Architecture: x86_64
   Operating system: windows
   WSL: false
   Available memory (MB): 2845
   Available CPU cores: 4

Environment:
   CI: None
   Terminal (TERM): unknown
   Terminal program (TERM_PROGRAM): vscode
   Terminal program version (TERM_PROGRAM_VERSION): 1.95.3
   Shell (SHELL): unknown
   stdin: false


D:\repos\Bugs\TurboCodemodYarnFour>

Expected behavior

I expected Turbo to update itself to the latest release, without errors.

Actual behavior

Trying to update using Yarn 4+ causes an error because it tries to use a flag (-W) that doesn't seem to exist in Yarn 4+

To Reproduce

  • Use turbo with yarn
  • Set Yarn version to 4+
  • Try to update turbo using the codemod package
  • Error happens

Additional context

Below is the output from the console commands:

Microsoft Windows [Version 10.0.19045.5131]
(c) Microsoft Corporation. All rights reserved.

D:\repos\Bugs\TurboCodemodYarnFour>npx create-turbo@canary -e with-shell-commands 
? Where would you like to create your Turborepo? .
? Which package manager do you want to use? yarn

>>> Creating a new Turborepo with:

Application packages
 - apps\app-a: An application that uses other Internal Packages
rds.                                                                                                                     rds.
Library packages
 - packages\pkg-a
 - packages\pkg-b
 - packages\tooling-config: A package used by every other package.

>>> Success! Your new Turborepo is ready.

To get started:
- Enable Remote Caching (recommended): npx turbo login
   - Learn more: https://turbo.build/repo/remote-cache

- Run commands with Turborepo:
- Run a command twice to hit cache

D:\repos\Bugs\TurboCodemodYarnFour>yarn set version 4.5.3
(node:18780) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
➤ YN0000: You don't seem to have Corepack enabled; we'll have to rely on yarnPath instead
➤ YN0000: Downloading https://repo.yarnpkg.com/4.5.3/packages/yarnpkg-cli/bin/yarn.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-4.5.3.cjs
➤ YN0000: Done with warnings in 0s 696ms

D:\repos\Bugs\TurboCodemodYarnFour>npx @turbo/codemod@canary update
? Where is the root of the repo to migrate? .
No codemods required to migrate from 2.3.4-canary.2 to 2.3.3 

Upgrading turbo from 2.3.4-canary.2 to 2.3.3 (no codemods required) 

Upgrading turbo with yarn add turbo@latest --dev -W 

Migration failed
Unable to upgrade turbo: Error: Command failed: yarn add turbo@latest --dev -W

D:\repos\Bugs\TurboCodemodYarnFour>yarn add turbo@latest --dev -W 
Unknown Syntax Error: Command not found; did you mean one of:

  0. yarn add [--json] [-F,--fixed] [-E,--exact] [-T,--tilde] [-C,--caret] [-D,--dev] [-P,--peer] [-O,--optional] [--prefer-dev] [-i,--interactive] [--cached] [--mode #0] ...
  1. yarn add [--json] [-F,--fixed] [-E,--exact] [-T,--tilde] [-C,--caret] [-D,--dev] [-P,--peer] [-O,--optional] [--prefer-dev] [-i,--interactive] [--cached] [--mode #0] ...

While running add turbo@latest --dev -W

D:\repos\Bugs\TurboCodemodYarnFour>

I tried looking everywhere for a issue that was already open, but couldn't find, I apologize in advance if there is already an issue open for this matter 🙏✨