Home > Article > Operation and Maintenance > How to install Yarn on CentOS and Fedora
Yarn is an advanced package management software for node.js applications. It is a fast, safe and reliable alternative to any other Nodejs package manager. This article contains three methods for installing Yarn on CentOS, Redhat and Fedora systems.
#1. Use NPM to install Yarn
Yarn components can be installed together with NPM. Just run the following command to install Yarn globally. In addition, without -g, it is installed only for the current project.
$ sudo npm install yarn -g
2. Install Yarn using a script
This is the most recommended method for installing Yarn. This will download the yarn archive and extract it in the .yarn directory of home. The script also sets the PATH environment variable.
$ curl -o- -L https://yarnpkg.com/install.sh | bash
Installing Yarn using this is only for the current user.
3. Use yum to install Yarn
Yum Package Manager also provides Yarn installation packages. The yarn official yum repository can be configured using the following command:
$ curl -sL https://dl.yarnpkg.com/rpm/yarn.repo -o /etc/yum.repos.d/yarn.repo
Now run the command below to install it.
$ sudo yum install yarn ## CentOS and Redhat systems $ sudo dnf install yarn ## Fedora systems
This article has ended here. For more other exciting content, you can pay attention to the Linux Video Tutorial column on the PHP Chinese website!
The above is the detailed content of How to install Yarn on CentOS and Fedora. For more information, please follow other related articles on the PHP Chinese website!