October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Corepack

How to Install Yarn on Windows (Corepack, Yarn Classic, and Troubleshooting)

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a current Windows setup, install Node.js, open a new PowerShell window, and run corepack enable. Then verify the installation with yarn --version. Corepack selects the Yarn version declared by each project, which avoids silently using the wrong release. Yarn Classic’s MSI, Chocolatey, and Scoop instructions are separate Yarn 1 paths, not the universal method for modern Yarn.

What you need before installing Yarn

  • Windows 10 or Windows 11 with permission to install software or modify your user environment.
  • Node.js. Yarn runs with Node.js, and Node.js is required for the installer and npm/Corepack workflows.
  • PowerShell or Command Prompt. PowerShell is the simplest choice on native Windows for beginners.

Microsoft’s Windows guidance recommends nvm-windows when you want to install and switch between Node.js versions. A direct Node.js installation also works. After installing or changing Node.js, close every open terminal and start a new one so PATH changes are loaded.

Choose the right Yarn installation method

Method Yarn generation Node.js required first? Project-specific version Prerequisites and PATH behavior
Corepack Modern Yarn releases Yes Yes, when the project declares packageManager Corepack must be available with your Node.js installation; reopen the terminal after setup if the command is not found.
Yarn MSI Yarn 1 (Classic) Yes No automatic per-project selection Download and run the Classic installer; a new terminal may be needed before PATH changes appear.
Chocolatey Yarn 1 (Classic) package Yes No automatic per-project selection Chocolatey must already be installed; run the package-manager command in an elevated or appropriately configured console.
Scoop Yarn 1 (Classic) package Usually; Scoop can suggest Node.js if it is missing No automatic per-project selection Scoop must already be installed and its shims must be on PATH.

The official Classic documentation explicitly says it covers Yarn 1 (Classic) and sends Yarn 2 and later users to the main Yarn documentation. Use Corepack unless you intentionally maintain a Yarn 1 project.

Install Node.js on Windows

Option A: nvm-windows

  1. Install nvm-windows using its Windows distribution.
  2. Open a new PowerShell window and install a Node.js version required by your projects, then activate it with nvm-windows commands.
  3. Check that both runtimes are available:
    node --version
    npm --version

Use nvm-windows when you regularly move between projects with different Node.js requirements. Keep one active Node.js version while enabling Corepack; changing Node versions can change which Corepack installation is on PATH.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Option B: direct Node.js installation

Install Node.js using the Windows installer, accept the option that adds Node.js and npm to PATH, then open a new terminal. Confirm with node --version and npm --version.

Install modern Yarn with Corepack

Corepack is a zero-runtime-dependency Node.js script that bridges a project to the package manager it declares. Node.js documentation states that Corepack is distributed with Node.js from version 14.19.0 up to, but not including, 25.0.0. Some Node.js distributions may require you to enable it before the Yarn command is available.

  1. Open PowerShell.
  2. Enable the package-manager shims:
corepack enable
  1. Verify that Yarn is now available:
yarn --version

A version string confirms that the command is on PATH. Corepack can download and cache the compatible package-manager version when a project declares its package manager.

Use the version declared by a project

From the project directory, inspect package.json. A modern project may include a field such as packageManager that identifies its Yarn release. With Corepack enabled, run normal commands from that directory:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
yarn install
yarn add lodash
yarn run build

Corepack uses the declaration rather than making you install one global Yarn version for every repository. Commit the project’s package-manager metadata according to the project’s own contribution guidelines so other developers receive the same selection.

If Corepack is unavailable

If corepack itself is not recognized, check node --version. A very old, unusual, or newer-than-supported Node.js distribution may not include Corepack in the expected way. Install a supported Node.js release, or use the Yarn 1 method below only when the project specifically requires Classic. Do not mix a global Classic installation with a modern project declaration without checking which executable your shell resolves.

Install Yarn 1 (Classic) on Windows

Use these instructions when a legacy project requires Yarn 1. The official Classic page labels this documentation as Yarn 1, so do not treat its MSI as the current universal Yarn installer.

Classic MSI installer

  1. Install Node.js first and verify node --version.
  2. Download the Yarn Classic .msi package from the official Yarn Classic installation page.
  3. Run the installer wizard and accept its PATH option when offered.
  4. Close and reopen PowerShell or Command Prompt.
  5. Run:
yarn --version

The result should be a Yarn 1 version for a Classic installation. If a project expects modern Yarn, stop and switch to Corepack instead.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Chocolatey

After Chocolatey is installed and available in your shell, run:

choco install yarn

Follow Chocolatey’s prompts, open a new terminal, and verify with yarn --version. This is the Classic package-manager route documented for Yarn 1.

Scoop

After Scoop is installed, run:

scoop install yarn

Scoop can suggest Node.js if it is missing. Restart the terminal if necessary, then run yarn --version.

Verify the installation and identify which Yarn runs

Always verify from a fresh terminal:

node --version
yarn --version
where.exe yarn
  • node --version confirms the runtime required by Yarn.
  • yarn --version confirms that the command returns a version string.
  • where.exe yarn lists the executable locations Windows will search, which is useful when an old MSI installation shadows a Corepack shim.

Run the checks inside the project directory as well as in your home directory. A project declaration can cause Corepack to select a different Yarn release than the one you expected globally.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Fix “yarn is not recognized” in PowerShell

1. Restart the shell

Close PowerShell and Command Prompt windows, open a new one, and run yarn --version again. PATH updates are not retroactive to already-running terminals.

2. Confirm Node.js and Corepack

node --version
corepack --version
corepack enable
yarn --version

If Node.js works but Corepack does not, repair or replace the Node.js installation with a supported distribution, then repeat the commands in a new terminal.

3. Check PATH collisions

Run where.exe yarn. Multiple results indicate that an older Classic directory, a package-manager shim, or another Node.js installation may be taking precedence. Remove obsolete entries from the Windows Environment Variables editor or change their order, then reopen the terminal.

4. Check execution policy and permissions

If PowerShell reports a script or permission problem rather than “not recognized,” run the command in Command Prompt to distinguish PATH problems from PowerShell policy restrictions. Enable Corepack from a terminal with the permissions required by your Node.js installation; do not grant broad administrator rights to unrelated commands.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

5. Check the active Node.js version manager

With nvm-windows, selecting another Node.js version can change the location of npm and Corepack shims. Select the intended Node.js version, open a new shell, run corepack enable again, and verify the result.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common installation errors and fixes

Symptom Likely cause Fix
corepack is not recognized Node.js is missing, unsupported, or its PATH entry is stale. Verify node --version, install a supported Node.js release, reopen the shell, and run corepack enable.
yarn is not recognized after MSI installation The terminal started before PATH was changed. Open a new terminal; if it persists, inspect where.exe yarn and add the Yarn binary directory to PATH.
The wrong Yarn major version appears A Classic install precedes Corepack on PATH, or the project declares another version. Use where.exe yarn, remove the obsolete PATH entry, and check the project’s packageManager field.
Install works globally but fails in a repository The repository expects a particular Node.js or Yarn version. Read its package.json and documentation, activate the required Node.js version, enable Corepack, and run the command from the repository directory.
Chocolatey or Scoop command is unknown The package manager is not installed or its shims are not on PATH. Install or repair that package manager first, reopen the shell, then rerun the Yarn command.

Keeping Yarn reproducible across projects

  • Prefer Corepack for modern repositories so the project can declare its intended Yarn version.
  • Use nvm-windows when separate projects require incompatible Node.js versions.
  • Do not assume the version shown in your home directory is the version a project uses; verify inside the repository.
  • After upgrading Node.js, re-run corepack enable and yarn --version.
  • For a legacy Yarn 1 repository, follow its documented lockfile and Node.js requirements instead of converting it during an unrelated setup task.

Or skip the browser setup

If you are documenting this Windows setup and need a clean screenshot of a documentation page, ScreenshotNeo can return an image or PDF from one API request. It accepts cookie or consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status.

Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. Every feature is included on every plan; 1,000 screenshots per month are free without a card, and paid plans start at $5 for 3,000 shots.

cURL

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://yarnpkg.com -o shot.webp

Python

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://yarnpkg.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://yarnpkg.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

See the ScreenshotNeo documentation for request options. Create a free ScreenshotNeo account to get 1,000 screenshots each month with no card.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Can I install Yarn without Node.js?

No. Node.js is the runtime prerequisite for Yarn’s Windows installer and npm/Corepack workflows.

Which method should a new project use?

Use Corepack when it is available, because it can follow the Yarn version declared by the project.

Is the Yarn MSI installer still current?

The documented MSI route belongs to Yarn 1 (Classic). It is appropriate for projects that explicitly require Yarn Classic.

Why does Yarn work in one terminal but not another?

The older terminal may not have reloaded PATH changes. Open a new shell and use where.exe yarn to inspect which executable is being selected.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read next

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.