How to Install Yarn on Ubuntu?

28-Jun-2023

.

Admin

How to Install Yarn on Ubuntu?

Hello Friends,

In this tutorial we will go over the demonstration of how to install yarn on Ubuntu. I would like to show you how to install yarn using sudo. This tutorial will give you a simple example of installing yarn on Ubuntu. it's a simple example of installing and using yarn on Ubuntu.

Yarn is an npm-compatible JavaScript package manager that automates the installation, updating, management, and uninstallation procedures of npm packages. This application manager assists in caching every downloaded package and parallelizing processes to speed up the installation process.

Step 1: Update system repositories


Press “CTRL+ALT+T” to open the terminal of the Ubuntu 22.04 then execute the following command to update system repositories:

sudo apt update<span id="more-59779"></span>

Step 2: Install CURL on Ubuntu 22.04

Execute the following command for CURL installation; as follow:

sudo apt install curl

Step 3: Import Yarn GPG key

Execute the following command to importing the Yarn GPG key to Ubuntu system repositories:

curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -

Step 4: Enable Yarn repository

Execute the following command to enable the Yarn repository on Ubuntu 22.04 system:

echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

Step 5: Install Yarn on Ubuntu 22.04

Execute the following command to install Yarn installation; as follow:

sudo apt install yarn

Step 6: Check Yarn version

Execute the following command to check its installed version on your Ubuntu 22.04 system:

yarn --version

I hope it can help you...

#Ubuntu