Your Gateway To Digital Success
Wesbytes Blue Logo

Wesbytes Knowledge Base

Search our articles or browse by category below

Yarn Installation On Linux VPS Server in 5 Steps

Last modified: July 2, 2022
You are here:
Estimated reading time: 1 min

Developers frequently utilise a dependency manager to save time on installing dependencies for their projects. A lot of major companies, including Facebook, Google, Tilde, and Exponent, developed Yarn, a Javascript dependency management that is frequently used on VPS. The speed with which this dependency manager processes dependencies, along with its security and versatility, are its key selling advantages.

Step 1: Access Server with SSH

Firstly, you will need to access your server using a SSH and also requires the root access.

Step 2: Add GPG Key

It is necessary to add the GPG key to your server by using the following command.

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

It is used to assure that all the downloaded packages are authentic.

Step 3: Add Yarn Repository

After adding the GPG Key, the next thing that needs to be added is the Yarn repository. To install the Yarn repository into your server, use the following command.

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

Step 4: Installation

Now that you have the Yarn repository installed, you can install it on your server. However, it is always recommended to update all your repositories before making any installation. To update your repositories, use the following command.

sudo apt update

After finishing updating, use the following command to install Yarn on your server.

sudo apt install yarn node.js

Step 5: Verification

Finally, check if the installation for Yarn was successful or not. To verify it, you can check the Yarn version installaed using the following command.

yarn -version

The output shown will be the version of Yarn you had installed. If it is not installed correctly, you won’t be able to see the version or might not be found. Retrace the previous steps to check if you missed any steps if the installation failed.

Was this article helpful?
Dislike 0
Views: 35