3 Ways to Install Yarn in Windows

Explore the easiest methods to get this done

Reading time icon 3 min. read


Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team. Read more

Key notes

  • You can install Yarn using its official website, command line package manager Chocolatey, or Node.js.
  • This guide will explain all the methods to install Yarn safely on Windows.
How to Install Yarn On Windows [Step-By-Step Guide]

Yarn is a package manager for Javascript that aids in automating, installing, updating, and managing libraries and utilities. You can download it using various methods.

Here, we will discuss the different methods to download Yarn on Windows and some frequently asked questions related to Yarn. Let’s start! 

How can I install Yarn on Windows?

Before proceeding with any steps for installing Yarn, go through the following preliminary checks:

  • You need to install the latest version of Node.js or use a version manager like NVM to manage multiple versions of Node.js on your machine.
  • The latest version of Git is installed to manage packages.
  • A text editor or IDE is installed to write and edit code, such as Sublime Text or Visual Studio Code.
  • Your computer should have a web browser installed.
  • Windows PowerShell or Command Prompt with admin rights.

Once you complete the checklist, follow any of these methods to install Yarn: 

1. Use the official website

  1. Download the Yarn installer.
  2. Double-click the installer (.msi) file to launch.
  3. Click on the Next button on the installation wizard.Yarn setup 1
  4. On the next window, accept the license agreement and then click Next.Install Yarn Windows
  5. Choose the installation location if you want, or keep it default as shown and click Next.Yarn setup 3
  6. Click Install and then wait for it to complete.Install Yarn Windows
  7. Now, click Finish to close the window.
  8. To verify Yarn installation, press Windows + X  and select Terminal (Admin).
  9. Copy and paste the following command: yarn --version

2. Use NPM

Tip icon Tip
Before proceeding with this method, ensure you have the latest version of Node.js installed.
  1. Press the Windows key, type CMD and click Run as administrator.DOS COmmand Prompt
  2. Type the following command and press Enter: npm install -g yarn
  3. To verify Yarn was correctly installed and check the version, copy and paste this command yarn --version

3. Use Chocolatey

  1. Press the Windows key, type CMD and click Run as administrator.
  2. Copy and paste the following command and press Enter: @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"Chocolatey Install
  3. Once Chocolatey is installed, type the following command and press Enter: choco install yarnYARN installed Windows
  4. Now on the command prompt window, you will be asked, Do you want to run this script? Type Y and press Enter. Yarn will be installed on your computer.
  5. Close the command prompt window.

How do I install Yarn in VS Code on Windows?

You can use method 2 to install Yarn in Virtual Studio Code on Windows. To use Yarn with Visual Studio Code, follow these steps: 

  1.   Install the Yarn extension from VS code marketplace.Yarn extensions
  2. Once installed, press Ctrl + Shift + P and type Yarn. You will get a list of commands you can use on VS Code.

Where is the Yarn install directory on Windows 10?

The default address of the Yarn install directory is C:\Program Files (x86)\Yarn However, if you have chosen a different install location at the time of installation, then open Command Prompt and type the following command, and press Enter: where yarn

Can I install Yarn without NPM?

Yes, you can install Yarn without NPM. Yarn is a separate package manager developed by Facebook and is not tied to NPM. Therefore, you can follow the first method to install Yarn without NPM.

So, these are the different methods you can use to install Yarn on your Windows. Follow any one of them, install Yarn, and start quickly managing, installing, and updating packages. 

If you have any queries or suggestions regarding this guide, then feel free to mention them in the comments below.

More about the topics: Install guides

User forum

0 messages