The yarn is an advanced package management software for Node.js applications. It is a fast, secure, and reliable alternative that any other Nodejs package manager.
This tutorial contains three ways to install Yarn on CentOS, Redhat, & Fedora system. Use one of the following ways:
1. Install Yarn using NPM
Yarn package is available to install with NPM. You can simply run the following command to install Yarn globally. Also, remove -g option to install for the current project only.
sudo npm install yarn -g
Check installed version:
yarn -v 1.22.4
2. Install Yarn using Script
This is the most recommended way for the yarn installation. This downloads the yarn archive and extracts under the .yarn directory at home. The script also set the PATH environment variable.
curl -o- -L https://yarnpkg.com/install.sh | bash
Using this installation yarn is available for the current user only.
3. Install Yarn using Yum
Yarn packages are also available with yum package manager. You can configure yarn official yum repository using the below command:
curl -sL https://dl.yarnpkg.com/rpm/yarn.repo -o /etc/yum.repos.d/yarn.repo
Now run the below command to install it.
sudo yum install yarn ## CentOS and Redhat systems sudo dnf install yarn ## Fedora systems
4 Comments
thanks
Thanks very much for the writeup, it was very helpful!
And… if installing by RPM, the executable is /usr/bin/yarnpkg
FYI
Thanks for the writeup.
YARN is nothing but a package manager for the code that we want to run on our system and it allows us to use and share the code with the other. To use it on your system, first, you need to install it. The installation process is quite simple for you, You just follow the steps given here.