Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@turbo/codemod migrate will downgrade Yarn from version 4 to 1.x. #8308

Closed
1 task done
Thiry1 opened this issue Jun 5, 2024 · 4 comments · Fixed by #8551
Closed
1 task done

@turbo/codemod migrate will downgrade Yarn from version 4 to 1.x. #8308

Thiry1 opened this issue Jun 5, 2024 · 4 comments · Fixed by #8551
Assignees
Labels
kind: bug Something isn't working

Comments

@Thiry1
Copy link

Thiry1 commented Jun 5, 2024

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/Thiry1/turborepo-bug-repro

What package manager are you using / does the bug impact?

Yarn v2/v3/v4 (node_modules linker only)

What operating system are you using?

Mac

Which canary version will you have in your reproduction?

2.0.0-canary.4 and 2.0.1

Describe the Bug

@turbo/codemod migrate will downgrade Yarn from version 4.x to 1.x.

Expected Behavior

packageManager field will not be changed.

To Reproduce

  1. clone reporoduction repo
  2. run npx @turbo/codemod migrate

Additional context

No response

@Thiry1 Thiry1 added kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage owned-by: turborepo labels Jun 5, 2024
@Thiry1 Thiry1 changed the title @turbo/codemod migrate will downgrade the package manager Yarn from version 4 to 1.x. @turbo/codemod migrate will downgrade Yarn from version 4 to 1.x. Jun 5, 2024
@Thiry1
Copy link
Author

Thiry1 commented Jun 5, 2024

I guess the root cause is that yarnpkg --version is being executed in the tmp directory instead of the repository directory.
https://github.com/vercel/turbo/blob/67b2a855dbb28b0bcc4d16513f7a89b95c9c3906/packages/turbo-utils/src/managers.ts#L11

@Xhale1
Copy link

Xhale1 commented Jun 5, 2024

pnpm is also downgraded from 9 to 8

@karl-run
Copy link

Fixes the downgrade issue, but it still tries to run

yarn add turbo@latest --dev -W

at the end, which is not a valid yarn 2-4 command.

$ yarn add turbo@latest --dev -W                                  1 ↵  ✹main 
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

@anthonyshew
Copy link
Contributor

Made a fresh issue for that since it's a different concern!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants