ScreenshotNeo

BlogHow-to

How to Install Yarn on Windows

Install Yarn on Windows with Corepack, or use Yarn 1 alternatives. Fix PATH errors and verify your project.

By the ScreenshotNeo team1 October 20263 min read

Short answer: Install Node.js, open a new PowerShell window, run corepack enable, then verify with yarn --version. Corepack selects the Yarn version declared by each project. For Yarn 1 (Classic), use its MSI, Chocolatey, or Scoop instructions.

Choose a method

Method Use when Generation
Corepack Current projects Modern Yarn
MSI, Chocolatey, Scoop Legacy projects Yarn 1 Classic

The Yarn Classic documentation says it covers “Yarn 1 (Classic).”

Install Node.js first

Yarn requires Node.js. Install Node.js for Windows, or use nvm-windows when you need version management. Open a new terminal and check:

node --version
npm --version

Corepack is distributed with Node.js 14.19.0 up to (but not including) 25.0.0. It installs Yarn shims and can download the project-selected version.

corepack enable
yarn --version

If enabling fails with access denied, run PowerShell as Administrator for that command, then reopen a normal terminal.

Use the project version

From the project root, inspect package.json for packageManager, then run:

cd C:\path\to\project
yarn install
yarn --version

The first run may download and cache the selected release. Keep the repository’s declared version and lockfile.

Yarn 1 Classic alternatives

MSI

  1. Install Node.js.
  2. Download the Yarn Classic Windows MSI.
  3. Run the wizard with its PATH option enabled.
  4. Open a new terminal and run yarn --version.

Chocolatey

choco install yarn

Reopen the terminal and verify.

Scoop

scoop install yarn

Scoop can suggest Node.js if missing. Reopen the terminal and verify.

PowerShell and Command Prompt

# PowerShell
New-Item -ItemType Directory yarn-demo
Set-Location yarn-demo
yarn init -2
yarn add lodash

:: Command Prompt
mkdir yarn-demo
cd yarn-demo
yarn init -2
yarn add lodash

For Yarn 1 repositories, follow their existing scripts and lockfile instead of converting them.

PATH troubleshooting

PATH is read when a process starts. Restart PowerShell, Command Prompt, Windows Terminal, and your IDE after installation.

Get-Command yarn
where.exe yarn
yarn --version

If a manual install is not found, add its Yarn binary directory to Windows Environment Variables, save, and reopen the terminal.

Common errors

Symptom Cause and fix
yarn is not recognized Old terminal or missing PATH. Reopen it, inspect with Get-Command yarn/where.exe yarn, then repair PATH.
corepack is not recognized Node is missing or too old. Check node --version and install a supported release.
Corepack access denied Protected Node directory. Enable Corepack in Administrator PowerShell.
Wrong Yarn major version Classic global install or wrong directory. Inspect package.json, enable Corepack, and check the version in the project root.
Download/registry failure Proxy, firewall, or registry settings. Use approved settings; do not delete the lockfile.
Works in terminal but not IDE Restart the IDE so it reads the new environment.

Verify the repository

  1. Run yarn --version beside the lockfile.
  2. Run yarn install.
  3. Confirm lockfile changes are expected.
  4. Run yarn test or yarn build as documented.

Performance and cost

  • Corepack reduces version drift by honoring project declarations.
  • A new Yarn release may download once, then use its cache.
  • Install time depends on registry, network, and cache state.
  • This setup uses downloadable software; no physical product is required.

Or skip the browser setup

For screenshots of a Yarn-powered site, ScreenshotNeo returns a clean image or PDF from one GET request. It removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed. Its MCP server provides screenshot, page-info, and PDF tools for AI agents.

See the ScreenshotNeo API documentation for options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.

FAQ

Is Yarn included with Node.js?

Corepack is distributed with many Node versions; enable it and verify with yarn --version.

Should I use npm to install Yarn?

Use Corepack for modern projects; use Classic methods when a project requires Yarn 1.

Do I need to restart Windows?

No. Restart the terminal or IDE so it reads PATH changes.

How do I identify the required version?

Inspect package.json for packageManager.

Can Classic and modern Yarn coexist?

Yes, but make each project’s selection explicit and verify the version in that directory.