geekflare.com Open in urlscan Pro
2606:4700:3108::ac42:285d  Public Scan

URL: https://geekflare.com/how-to-install-yarn-on-windows/
Submission: On December 14 via api from US — Scanned from DE

Form analysis 1 forms found in the DOM

GET https://geekflare.com/

<form role="search" method="get" class="search-form" action="https://geekflare.com/">
  <label>
    <span class="screen-reader-text">Search for:</span>
    <input type="search" class="search-field aa-input" placeholder="Search …" value="" name="s" autocomplete="off" spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="false" aria-owns="algolia-autocomplete-listbox-0" dir="auto"
      style="">
    <pre aria-hidden="true"
      style="position: absolute; visibility: hidden; white-space: pre; font-family: geekflare-primary, system-ui, -apple-system, &quot;Segoe UI&quot;, roboto, &quot;Helvetica Neue&quot;, arial, &quot;Noto Sans&quot;, &quot;Liberation Sans&quot;, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 500; word-spacing: 0px; letter-spacing: normal; text-indent: 0px; text-rendering: auto; text-transform: none;"></pre>
  </label>
  <input type="submit" class="search-submit" value="Search">
</form>

Text Content

Skip to content
 * 
 * 
 * 

 * Business
    * * Project Management
      * Collaboration
      * Productivity Tools
      * Electronic Signature
    * * CRM
      * Sales & Marketing
      * Customer Service
      * Human Resources
    * * Digital Marketing
      * SEO
      * Digital Analytics
      * Brand Management

 * Tech
    * * Cloud Computing
      * DevOps
      * Development
      * Hosting
    * * Data Management
      * Data Visualization
      * Database
      * API
    * * Best of Tech
      * Game Hosting
      * Gaming
      * HealthTech

 * Future
    * * AI Tech
      * AI Tools
      * Metaverse
    * * Crypto
      * NFT
      * IoT

 * Security
    * * Cybersecurity
      * Data Recovery
      * Monitoring
      * Network Security
    * * Antivirus
      * Privacy
      * VPN
      * Home Security

 * Latest

Search for:



More

 * Advertise
 * About



Geekflare is supported by our audience. We may earn affiliate commissions from
buying links on this site.

In Windows  |  Last updated: December 5, 2023
Share on:
 * 
 * 
 * 
 * 

Jira Software is the #1 project management tool used by agile teams to plan,
track, release, and support great software.




HOW TO INSTALL YARN ON WINDOWS?

By Bipasha Nath

If you are looking for how to install Yarn on Windows operating system, you are
in the right place. Yarn is a fast and safe package manager for JavaScript, and
the process of installation on Windows is pretty straightforward.

The npm package manager for JavaScript tools and libraries has been used for a
long time. However, it suffers from issues like security, performance, and
consistency. The issues become exponential when you plan to use npm for a large
and concurrency software development project.

However, you can bypass all these issues and still get access to the npm
registry by using Yarn. Additionally, it is a future-ready package manager with
robust features and simple commands. Continue reading as we show you how to
install yarn packages on your Windows PC from scratch.  

PS: If you are a newbie and don’t know what Yarn is, what it does, its workflow
and benefits, scroll to the bottom as we’ve got you covered too!        


PREREQUISITES TO INSTALL YARN ON WINDOWS

Installing developer runtimes and other tools has become effortless these days.
Yarn’s installation process is no different. You can instantly start maintaining
and managing JavaScript libraries and dependencies on your Windows computer
using Yarn. You just need to type a few codes and make a few clicks.

Before you can learn how to install Yarn on Windows, you need to ensure whether
the device is appropriately conditioned. For example, consider the followings: 

 * You will need .NET Framework 4.0 or later.
 * Administrative access to Windows Command Prompt.
 * Similarly, you will need admin access to PowerShell.
 * The latest Node.js version runtime is also mandatory to run Yarn.

If you are working on a Windows 10 or Windows 11 workstation logged in as an
admin, then you have taken care of the first three prerequisites. However, learn
more about the Node.js installation below: 


CHECKING FOR NODE.JS INSTALLATION ON YOUR WINDOWS COMPUTER

#1. Click on the Search icon on your Windows 10 PC and type in CMD.

#2. You will see the Command Prompt app under the Best match section.

#3. Right-click on the Command Prompt link and then select Run as administrator.

#4. Command Prompt app will open with the following command line output:

C:\Windows\system32>

#5. Now, type the following syntax and hit Enter.

node --version

#6. If CLI output shows that 'node' is not recognized as an internal or external
command, operable program, or batch file text, it means you need to install
Node.js.


INSTALLING NODE.JS ON YOUR WINDOWS PC

#1. Visit the Node.js portal to download the latest version of it. 

#2. Select any version to download below the Download for Windows.

#3. Double-click on the Node.js installation package.

#4. Click Next once the installer verifies the space requirement.

#5. Now, you must accept the end user license and click Next.

#6. Select Next again on the Destination Folder screen.

#7. Do not make any changes on the Custom Setup screen. Just click Next.

#8. Select Next again on the Native Modules Tool, and then click Install.

#9. Once the installation is complete, click Finish.


INSTALL YARN ON WINDOWS USING THE YARN MSI INSTALLER

Now, you are all set to install Yarn on Windows.


GET YARN MSI INSTALLER

#1. Visit the Yarn download portal.

#2. You must see the Click to expand/collapse text below the Alternatives
header.

#3. Click on the drop-down list arrow near the above message to expand Yarn
installation alternatives.

#4. On the Operating system option, select Windows.

#5. Select Classic Stable on the Version option.

#6. Now, just click on Download Installer.

That is it! You should find the .msi installer of Yarn in the Downloads folder.


RUNNING THE YARN MSI INSTALLER

#1. Go to the Downloads folder on your Windows PC.

#2. Double-click on the Yarn installation package.

#3. You will see the Welcome to the Yarn Setup Wizard screen. Click Next.

#4. The Yarn installer will now show the End-User License Agreement screen.

#5. On the above screen, checkmark the I accept box and then select Next.

#6. You shall now see the Destination Folder where the Yarn installer is
installing Yarn. You may keep that as is. Just select Next.

#7. Finally, you are at the Ready to Install screen. Simply click Install to
allow the Yarn MSI installer to install Yarn on Windows.

The process is complete when you see the Completed the Yarn Setup Wizard. Just
click Finish and you are all set.


VERIFYING THE YARN INSTALLATION ON YOUR WINDOWS PC

#1. Open the Command Prompt as an admin user.

#2. After the CLI output C:\Windows\system32> type yarn –version.

#3. You should see the following script as an output:

1.22.19<br>C:\Windows\system32>

The above script means that you have successfully installed Yarn on Windows PC.
The Yarn version that you have installed is 1.22.19.              


INSTALL YARN ON WINDOWS USING THE COMMAND PROMPT APP

Expert developers may not always like to install development runtimes or
packages through an MSI installer. Hence, for seasoned developers like you, Yarn
also offers command line interface installation. You can follow the steps here:

#1. Start the process on a Windows 11 or Windows 10 computer so that you do not
need to install the latest .NET Framework, Command Prompt, PowerShell, etc.,
separately.

#2. Ensure that you have already installed Node.js on that PC. You can confirm
that by trying the steps mentioned above in the “Checking for Node.js
Installation” section.

#3. If you get a CLI output with the version number of Node.js, it means you
already have Node.js.

#4. If you do not get any version information, you need to install Node.js. You
can follow the steps mentioned earlier in the ‘Installing Node.js on Your
Windows PC’ section.

#5. Your Node.js installation should have installed Corepack already. Just
activate it using a Command Prompt. Execute the following command to enable this
feature:

corepack enable

#6. Once done, you can execute the following script on Command Prompt to install
Yarn on Windows: 

npm install --global yarn

#7. The CLI output will be added 1 package, and audited 2 packages in 1s when
the installation is successful.

You can check the Yarn version installed to confirm whether the installation was
successful or not. That is it! 


INSTALL YARN ON WINDOWS USING SCOOP

Another convenient way to install Yarn on Windows without running any installer
is Scoop. It is a package installer for Windows. The tool works through the
PowerShell app. Most expert developer use Scoop, so it is considered that you
already have this on your Windows system.

If you do not have Scoop on your Windows PC, you can get it from GitHub by
following the official installation guide. Access the Scoop Quick Start GitHub
portal to install Scoop in a few minutes.

Once done, open the PowerShell app and run the following Scoop command to
install Yarn:

scoop install yarn

Scoop will not continue with the installation if there is no Node.js runtime on
your PC. It will suggest you install that. Here is the command to run:

scoop install nodejs    


INSTALL YARN ON WINDOWS USING CHOCOLATEY



Seasoned devs regularly use Chocolatey for Windows package management. If you
have it on your PC, then you can install Yarn using Chocolatey as well.

If you do not have this tool, you can visit Installing Chocolatey to get it.
Once done installing Chocolatey, open the Command Prompt to run the following
command which installs Yarn automatically:

choco install yarn

If you do not have Node.js runtime, Chocolatey will install that on its
own.        


WHAT IS YARN?

Google, Facebook, Tilde, and Exponent collaborated on a JavaScript package
management tool that can replace npm. The result of the project is the Yarn
package manager released as an open source tool in 2016.

Yarn is a novel package manager that eases off and modifies the existing
workflow for maintaining and managing JavaScript packages on npm or other
package managers. However, the Yarn tool will still support the npm registry to
fetch pre-programmed JS libraries, tools, etc.

Find below the novel features of Yarn that make it an extraordinary tool for
every developer:

 * It fetches and installs JS libraries, tools, packages, etc., faster.
 * Its core engine ensures integrity, reliability, and version control of
   installed packages.
 * A simple software development project can include thousands of dependencies.
   Yarn makes dependency management workflow effortless.
 * It supports mixing registries.
 * Yarn is compatible with Bower and npm workflows.
 * It offers installed module license restrictions.
 * Comes with a public JS API for consumption of API data via build tools.
 * Yarn also offers beautiful CLI outputs, minimal code lines, and a readable
   user interface.

This future-ready package manager has a somewhat similar or more straightforward
process for DevOps package management. However, the Yarn tool is highly
reliable, faster, and extremely secure when compared with Yarn
alternatives.          


WHAT DOES YARN DO?

Yarn simply solves common package management problems that npm suffers. The
followings are some popular functionalities of Yarn: 

 * Yarn supports plugins. Users can use Yarn plugins, third-party plugins for
   Yarn, or write their own plugins.
 * The Constraints functionality enables developers to enforce rules and
   policies for manifest fields or dependencies across scoped workspaces.
 * Yarn lets a programmer use an offline cache on the local machine using a
   single file. 
 * The Plug’n’Play option lets users run Node.js projects minus the node_modules
   folder. The resultant Node.js application starts faster when compared with
   apps that contain the node_modules folder.
 * The Protocols functionality enables developers to define the protocol for
   package resolution. For instance, you will be using the patch protocol to
   create a patched version of the original package. Another example could be
   the git protocol to fetch public packages from any Git repository.
 * The Release Workflow option helps a software developer automatically upgrade
   relative packages distributed in several monorepos. For this, a programmer
   needs to upgrade the root packages and Release Workflow handles the
   rest.           
 * Yarn Workspaces is an intuitive functionality. It allows programmers to
   install dependencies all in one go from multiple package.json files in many
   subfolders of a single root package.json file.


THE YARN WORKFLOW

Whenever you switch from one package manager to another, the main challenge is
the change of workflow. Facebook’s goal was to create a package manager that
will be easy to use while supporting the existing standard workflows from
popular package repos like npm. Hence, Yarn did not make any drastic changes.
Here is a snapshot of the basic workflow of Yarn:

 * Create or start a new app development project: yarn init.
 * Adding, removing, or updating various dependencies: yarn add [package], yarn
   upgrade [package], yarn remove [package].
 * Installing or reinstalling a code library or dependency: yarn install, yarn
   install --force, etc. 
 * Managing versions of packages being created, updated, patched, etc., using
   Gits.
 * Integrating with related tools continuously like AppVeyor, CirleCI, Codeship,
   Semaphore, Codefresh, etc.   


THE BENEFITS OF YARN

 * Yarn allows the developers to maintain several local cache files for multiple
   projects. Hence, using or updating numerous packages for multiple app
   development projects becomes easy and faster.
 * Tech giants like Facebook, Google, etc., support the Yarn community. Hence,
   you can find the latest patches, upgrades, and new releases frequently.
 * Yarn comes with a detailed migration guide if you are moving an existing
   JavaScript development project to Yarn.
 * Yarn guarantees baseline installation throughout all systems via the
   deterministic manner of installing operations and a lock file format.
 * Yarn ensures the integrity of all the imported packages by running
   checksums. 
 * Yarn avoids request waterfalls when getting packages from cloud sources. This
   process increases network efficiency.       

Apart from these Yarn’s core engine comes with powerful algorithms to allow
faster installation of packages. When you fetch and install thousands of
packages in your software project, Yarn installs them in parallel. On contrary,
npm does this one by one. Hence, the project time frame increases drastically.


FINAL WORDS FOR INSTALL YARN ON WINDOWS

So far the article has discussed the basics of Yarn, like what it is, its
benefits, purpose, and more. Additionally, you also have discovered several ways
to install Yarn from scratch. 

If you are new to JavaScript-based development projects, you will benefit
tremendously from the steps. You will cut short the guessing and Google
searching part for how to install Yarn on Windows and start maintaining and
managing JavaScript packages on Yarn.

READ MORE ON DEVELOPMENT

 * Best JavaScript (JS) Frameworks You Should Know
 * Best Package Hosting Repo for Your DevOps Projects
 * Best JavaScript (JS) UI Libraries to Build Modern Applications

Share on:
 * 
 * 
 * 
 * 

 * Bipasha Nath
   Author
    * 
   
   Bipasha has a decade of experience as a technical and creative writer.
   Holding degrees in English and Sociology and having worked with software
   development firms, she possesses a unique perspective on how technology
   intertwines with our… read more

CONTENTS

Show

CONTENTS

 1. Prerequisites to Install Yarn on Windows
 2. Install Yarn on Windows Using the Yarn MSI Installer
 3. Install Yarn on Windows Using the Command Prompt App
 4. Install Yarn on Windows Using Scoop
 5. Install Yarn on Windows Using Chocolatey

MORE GREAT READINGS

8 WAYS WINDOWS 11 IS BETTER THAN WINDOWS 10

7 BEST TOOLS TO CHECK GPU AND CPU TEMPERATURE ON WINDOWS COMPUTER

HOW TO REPAIR WINDOWS IMAGE USING DISM COMMAND

WHAT DOES ABOUT:BLANK MEAN IN CHROME/FIREFOX OR SAFARI?

12 SHORTCUT WAYS TO OPEN TASK MANAGER IN WINDOWS 10/11





THANKS TO OUR SPONSORS

 * 
 * 
 * 
 * 
 * 
 * 

MORE GREAT READINGS ON WINDOWS

TOP 10 MEDIA STREAMING SERVER FOR PERSONAL AND BUSINESS USE

By Durga Prasad Acharya

Once upon a time, Media Streaming Servers would have seemed extraneous. However,
technological advancement has added multiple dimensions of entertainment with
smartphones and powerful computers.

HOW TO FIX IRQL NOT LESS OR EQUAL IN WINDOWS 10 AND 11

By Dhruv Parmar

Discover quick fixes to resolve the IRQL NOT LESS OR EQUAL error on Windows 10
and 11 and optimize your system stability.

HOW TO INSTALL WINDOWS 11 LITE VERSION ON YOUR PC (TINY11)

By Gargi Ghosal

If you own a PC that doesn’t meet the minimum requirements to run Windows 11 or
has limited resources, then you should try Tiny11 (Windows 11 Lite Version).

25 RUN COMMANDS IN WINDOWS YOU SHOULD MEMORIZE

By Karrar Haider

Using Run commands in Windows is an efficient way to access different settings &
apps directly. Here are the top 25 run commands in Windows you should know!

HOW TO FIX “THE REQUESTED OPERATION REQUIRES ELEVATION” ERROR

By Srujana Maddula

Facing a “The requested operation requires elevation” error on your Windows when
you try accessing your data? Here we explore the best solutions to fix this
error.

HOW TO SPLIT SCREEN INTO 2, 3 OR 4 SECTIONS ON WINDOWS 10/11

By Hitesh Sant

Let’s check how to split screen on Windows 10/11 to multitask like a pro.



POWER YOUR BUSINESS

SOME OF THE TOOLS AND SERVICES TO HELP YOUR BUSINESS GROW.

 * The text-to-speech tool that uses AI to generate realistic human-like voices.
   
   Try Murf AI

 * Web scraping, residential proxy, proxy manager, web unlocker, search engine
   crawler, and all you need to collect web data.
   
   Try Brightdata

 * Monday.com is an all-in-one work OS to help you manage projects, tasks, work,
   sales, CRM, operations, workflows, and more.
   
   Try Monday

 * Intruder is an online vulnerability scanner that finds cyber security
   weaknesses in your infrastructure, to avoid costly data breaches.
   
   Try Intruder

Your trusted source for Technology Resources

© Geekflare, 71-75 Shelton Street, London, WC2H 9JQ
English

English French Spanish German
 * Twitter
 * Facebook
 * LinkedIn

COMPANY

 * About
 * Advertise
 * Sitemap
 * Careers
 * Contact

LEGAL

 * Terms
 * Privacy
 * Cookie Policy
 * Editorial Policies
 * Disclosure