Closed dylanh724 closed 4 days ago
resulting in v 1.22.11 (which isn't even the classic stable version)
This should not happen if Corepack is properly enabled unless
The Corepack version that comes with Node 20.12.2 should be Corepack 0.25.2, which default to yarn v1.22.21.
Check your PATH
or use which yarn
(or equivalent on your system) to make sure your yarn
command is the shim generated by Corepack.
yarn dlx -q envinfo --preset jest
yarn run v1.22.11
Also should not happen if Corepack is properly enabled
resulting in v 1.22.11 (which isn't even the classic stable version)
This should not happen if Corepack is properly enabled unless
- Your working directory is inside a project with a pinned yarn version
- You somehow installed an old Corepack version
The Corepack version that comes with Node 20.12.2 should be Corepack 0.25.2, which default to yarn v1.22.21.
Check your
PATH
or usewhich yarn
(or equivalent on your system) to make sure youryarn
command is the shim generated by Corepack.yarn dlx -q envinfo --preset jest
yarn run v1.22.11
Also should not happen if Corepack is properly enabled
Hmm, please define "properly" - from my understanding, it's just 1 command (above)?
I'm on a fresh install of Win11, installed Node via nvm, installed node 20 and activated via nvm, then issues the corepack enable command.
Does yarn have known issues with nvm?
Looking at it again, I think the most likely scenario is you have a pinned version of yarn. Try yarn --version
again. If it still shows v1.22.11, look for a package.json
file and see if there is a packageManager
field.
Let's try this then
> node -v
v20.12.2
> corepack -v
0.25.2
> yarn -v
1.22.11
yarn
command points to. That would be where yarn
for CMD or Get-Command yarn
for PowerShell. Make sure that is in the same directory as your node
command. If not then you have installed yarn
outside of Corepack and that is interfering with Corepack.> Get-Command yarn
CommandType Name Version Source
----------- ---- ------- ------
ExternalScript yarn.ps1 C:\Program Files\nodejs\yarn.ps1
> Get-Command node
CommandType Name Version Source
----------- ---- ------- ------
Application node.exe 20.12.2.0 C:\Program Files\nodejs\node.exe
yarn config get yarnPath
to check if you are inside a project with a pinned yarn binary. If that outputs a path then that is the pinned yarn binary.Not sure if its related but I'm having the reverse of this.
I opened an issue on the original repo
When I try install yarn v1 via NPM
or Brew
I get version 3.6.4
This is on a M1 Mac
I fixed it by running the following command:
rm -rf ~/.yarn*
Suggested by someone on stackoverflow. Might be useful here. https://stackoverflow.com/a/70978316/11701253
Not really sure how berry got installed on my machine as I've never used it before.
Just on my phone, but I'll be able to test this soon -- perhaps in a few days. Cheers for advice.
Hi! 👋
It seems like this issue as been marked as probably resolved, or missing important information blocking its progression. As a result, it'll be closed in a few days unless a maintainer explicitly vouches for it.
Self-service
Describe the bug
https://yarnpkg.com/getting-started/install
These instructions are the same as the classic instructions, more or less, resulting in v 1.22.11 (which isn't even the classic stable version)
To reproduce
With node 20.12.2 (lts):
corepack enable
yarn -v
Environment
Additional context
The installation process to get to the correct latest stable version (3.x?) is wildly confusing with inaccurate best-practice installation steps. I tried to go to the Discord for help, but your website Discord link was also broken. Perhaps this hasn't been updated since 1.x?