

Once the process completes, verify that Yarn has been installed successfully. This will install Yarn along with nodejs. Update Ubuntu or Debian system to refresh the list of available packages and then install yarn: sudo apt update Now that you have curl, you can use it to add the GPG key of Yarn project in the following fashion: curl -sS | sudo apt-key add -Īfter that, add the repository to your sources list so that you can easily upgrade the Yarn package in future with the rest of the system updates: sudo sh -c 'echo "deb stable main" > /etc/apt//yarn.list' The above command will install Curl if it wasn’t installed already. Since the tutorial uses Curl to add the GPG key of Yarn project, make sure to install curl on Ubuntu first. The same set of instructions are also valid for Debian and other Debian based distributions. The instructions mentioned here should be applicable to all versions of Ubuntu such as Ubuntu 18.04, 16.04 etc. However, I would recommend using the official way to install Yarn on Ubuntu/Debian. In that case, you can use npm to install Yarn globally in the following manner: sudo npm install yarn -g If you are using nodejs on Ubuntu, probably you already have npm installed on your system.

Yarn also guarantees that an install that worked on one system will work exactly the same way on any other system. Yarn also uses checksums to verify the integrity of every installed package before its code is executed. It also parallelizes operations to maximize resource utilization. The advantage of Yarn is that it is faster as it caches every package it downloads so it doesn’t need to download it again.

Like npm, Yarn provides you a way to automate the process of installing, updating, configuring, and removing packages retrieved from a global registry. Facebook claims that Yarn is faster, reliable and more secure than npm.

Facebook developers’ team created Yarn to overcome the shortcomings of npm. It is an alternative or should I say improvement to the popular npm package manager. Yarn is an open source JavaScript package manager developed by Facebook. You’ll also learn some basic Yarn commands and the steps to remove Yarn completely. This quick tutorial shows you the official way of installing Yarn package manager on Ubuntu and Debian Linux.
