- Fast: Yarn caches every package it has downloaded.
- Reliable: Using a detailed but concise lockfile format and a deterministic algorithm for install operations.
- Secure: Yarn uses checksums to verify the integrity of every installed package before its code is executed.
There are also other features such as its efficiency in the use of the network as well as offline mode. All this can be found on the Github site of Yarn.
Unfortunately, Yarn is not present in the official distribution repositories. You can check this by running the following command
sudo zypper search yarn
You will get an output screen like the following:
Loading repository data... Reading installed packages... No matching items found.
So we have to use another method to perform the installation.
The easiest and recommended method is to use the compiled Linux binary that we can download via the
So, install the
curl tool by running the following command:
sudo zypper in curl
After that, download and install Yarn
curl -o- -L https://yarnpkg.com/install.sh | bash
And to make Yarn available from any prompt location, run the following command:
Now you can use Yarn for whatever you want, for example, to check the installed version of Yarn
yarn -v 1.22.5
So, enjoy it.
Yarn is a great alternative to NPM to manage the dependencies of our web projects. So it becomes essential if we are web developers or we are learning in it.