Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#1415·nvm-windows

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:

bash
corepack enable
corepack prepare yarn@stable --activate

pnpm 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

bash
nvm install 22
nvm use 22

corepack enable
corepack prepare yarn@stable --activate

yarn -v

Expected 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 -v works and triggers Corepack download correctly.

  • A partial yarn directory may appear under:

    D:\tools\nvm\installs\v22.23.3\yarn

    but no executable is properly linked to PATH.

  • Running npm install -g yarn fails initially with EEXIST unless the directory is manually removed.


Workaround

Manually removing the leftover directory and installing Yarn via npm:

bash
rm -rf D:\tools\nvm\installs\v22.23.3\yarn
npm install -g yarn

Question

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

View original on GitHubView discussion on GitHub