After version 1.x Includes: 2.x, 3.x, and 4.x
asdf doesn’t support local yarn over 1.x
solution is to enable corepack.
then install it manually once for the latest stable version
corepack enable
corepack prepare yarn@stable --activate
# lock it in the current project
yarn set version stablethen it should be locked and setup with corepack enable in future installs. no additional installs needed beyond a future corepack enable with proper node version
this creates
.yarn/releases/yarn-x.x.x.cjs
.yarnrc.yml with a yarnPath
important: only available on node 16.10 or greater
Then it is a good idea to enforce via the engines in package.json
"engines": {
"node": ">=18 <21",
"yarn": "^4.0.0"
},
"packageManager": "yarn@4.0.0" # optional, stronger enforcementresearched via chatgpt plus 4o source: https://chatgpt.com/share/67ee4f7f-aec4-800b-8872-fe1dd2955c46