Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Install Yarn on Windows

Install Yarn with npm, the MSI installer, Chocolatey or Scoop, then configure and use it.

Windows Hosting1 min read4 steps9 screenshots

Yarn needs Node.js. Install Node.js first.

Method 1: npm

Check npm:

npm -v
The npm version

Install Yarn:

npm install -g yarn
Installing Yarn with npm

Check Yarn:

yarn --version
The Yarn version

Method 2: MSI installer

  1. Open the Yarn website and download the installer.
    The Yarn website
  2. Run the .msi file.
    The downloaded MSI file
    The Yarn setup
  3. Accept the license agreement.
    The license agreement
  4. Choose the destination folder and finish.
    The destination folder

Method 3: Chocolatey

choco install yarn
Installing Yarn with Chocolatey

Method 4: Scoop

Install Scoop, then Yarn:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
iwr -useb get.scoop.sh | iex
scoop install yarn

Configure Yarn

Set a registry:

yarn config set registry <registry_url>

Use an offline mirror:

yarn config set yarn-offline-mirror <path_to_mirror>

Install a package globally:

yarn global add <package_name>

Use Yarn

yarn init
yarn add <package_name>
yarn remove <package_name>
yarn install
yarn upgrade <package_name>

Troubleshooting

  • Make sure you use recent versions of Node.js and Yarn.
  • Open a new terminal after installing so the Path is refreshed.
  • Run the terminal as administrator if you see permission errors.
  • Clear the cache with yarn cache clean if installs fail.

Quick recap

  • The npm method is the quickest.
  • Check with yarn --version.