Home  >  Article  >  Operation and Maintenance  >  How to install Yarn on CentOS and Fedora

How to install Yarn on CentOS and Fedora

不言
不言Original
2019-03-29 15:29:483825browse

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.

How to install Yarn on CentOS and Fedora

#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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn