With the growing dependencies in software development, it is crucial to have a package manager to resolve all the conflicts of versioning and updating third-party libraries. Npm is one of a kind. It helps us to manage and remove the Node.js dependencies in the project.
An alternative to npm is Yarn . It is a package manager for Node.js developed by Meta. It doesn’t come bundled with Node’s installation but has to be installed explicitly.
The primary concern of creating Yarn was to ensure consistency, security, and performance issues with large and complex codebases. In terms of speed, reliability, and compatibility, Yarn outperforms npm. In addition, the former offers the following features:
- Support for installing dependencies in parallel.
- Plug and play.
Check out: Yarn vs NPM
I will help you install Yarn on Windows using three different methods in this article.
How to Install Yarn on Windows?
Let us now peek into the installation process of Yarn using different methods.
Installation via npm
Prerequisite: You must have npm installed on your machine.
Use the following command.
npm install --global yarn
Installation via Chocolatey
Prerequisite: You must have Chocolatey installed on Windows .
Use the following command.
choco install yarn
Installation via Installer
Step 1
Go to the official website of the Yarn package manager, and download the latest stable release.
Step 2
Wait for the download to complete. After the .msi file is downloaded, right-click on it and select ‘Install’ .
The installation wizard will open up, and click on Next .
Step 3
Accept the license agreement, and click Next .
Step 4
Accepting the license agreement will prompt for the installation location. It is recommended to let it as it is. Also, you can change its destination as per your requirement.
After selecting the installation location, hit Next .
Step 5
It will prompt ‘Ready for Installation’ . Hit Install on the next step.
Step 6
After the installation, a screen will appear with the title ‘Completed the Yarn Setup Wizard’ . Finally, click Finish .
Step 7
Verify the installation.
Open the command prompt on your machine and run the following command to verify the successful installation of Yarn.
yarn -version
Conclusion
As we move toward including new third-party libraries for our software application, we must have a manager for them. Using a manager for the libraries makes it easy to install, update, and uninstall them. Yarn is a go-to choice for Node.js.
I have provided detailed steps of every method to install Yarn on Windows. If you like this article, please leave us a comment in the comment section below.
Happy learning!
People are also reading:
Leave a Comment on this Post