Yarn is a package manager for JavaScript that was developed by Facebook. It was designed to address some of the limitations and performance issues of other package managers, such as npm. Yarn provides several advantages, including faster and more deterministic dependency resolution, offline caching, parallel installation, and improved security. This article is Guide to Installing Yarn on Debian, which we will teach you using two methods.
To install Yarn on Debian, you need to satisfy the following prerequisites:
– Debian Operating System or A Linux VPS with Debian OS
– Node.js: Yarn requires Node.js to be installed on your system. Check if Node.js is already installed by running the following command:
node -v
If Node.js is not installed, you can install it using the apt package manager:
sudo apt install node.js
– npm: npm (Node Package Manager) is typically bundled with Node.js. Check if npm is installed by running the following command:
npm -v
If npm is missing, you can install it using the apt package manager:
sudo apt install npm
To install Yarn on Debian via NodeSource, you can follow the steps below:
Import the Yarn GPG key by running the following command:
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
Add the Yarn repository to your system’s package sources by running the following command:
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
Update the package list to include the new Yarn repository by running the following command:
sudo apt update
Finally, install Yarn by running the following command:
sudo apt install yarn
You can verify the installation by running the following command in your terminal, which should display the installed version of Yarn:
yarn --version
To install Yarn on Debian via NVM, follow the steps below:
Install NVM (Node Version Manager) by running the following command:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
Close and reopen the terminal, or run the following command to load NVM:
source ~/.bashrc
Install a specific version of Node.js using NVM. You can use the following command to install the latest LTS (Long-term support) version of Node.js:
nvm install --lts
Verify that you have installed Node.js by running:
node -v
Install Yarn globally by running the following command:
nvm install -g yarn
Verify if Yarn is installed successfully by running:
yarn -v
As you have seen, installing Yarn on Debian is a straightforward process that involves adding the Yarn repository, updating the package manager, and running the installation command. Once installed, Yarn provides a reliable package manager for managing JavaScript dependencies, making it a valuable tool for developers.
How useful was this post?
Click on a star to rate it!
Average rating 5 / 5. Vote count: 1
No votes so far! Be the first to rate this post.
In continuation of our tutorials, In this guide, you will learn how to easily install an FTP server ...
RainLoop is a webmail application that allows you to access your external mail server from a web ser...
What is your opinion about this Blog?