Corepack + nvm v2 on Windows: yarn command not available after prepare
Author: LLLike27Created Sep 25, 2026Updated Sep 25, 2026
Labelsinvestigating
Bug: yarn command not available after corepack prepare (Windows + nvm v2)
Description
On Windows, when using nvm-windows v2 (beta) together with Corepack, the yarn command is not available even after running:
corepack enable
corepack prepare yarn@stable --activatepnpm works as expected, but yarn is not recognized as a command.
Environment
- OS: Windows 11
- nvm-windows: 2.0.1-beta.2
- Node: v22.23.3
- npm: 10.9.9
- Corepack: 0.36.0
- Shell: PowerShell
Steps to Reproduce
nvm install 22
nvm use 22
corepack enable
corepack prepare yarn@stable --activate
yarn -vExpected Behavior
yarn -v should output the Yarn version.
Actual Behavior
yarn: The term 'yarn' is not recognized as the name of a cmdlet, function, script file, or operable program.Additional Notes
pnpm -vworks and triggers Corepack download correctly.A partial
yarndirectory may appear under:D:\tools\nvm\installs\v22.23.3\yarnbut no executable is properly linked to PATH.
Running
npm install -g yarnfails initially withEEXISTunless the directory is manually removed.
Workaround
Manually removing the leftover directory and installing Yarn via npm:
rm -rf D:\tools\nvm\installs\v22.23.3\yarn
npm install -g yarnQuestion
Is this a known compatibility issue between nvm-windows v2 and Corepack on Windows?
Should Corepack be expected to properly install Yarn shims in this setup?
Thanks!
Source: coreybutler/nvm-windows