How to install Yarn on CentOS and Fedora

不言
Release: 2019-03-29 15:29:48
Original
3766 people have browsed it

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
Copy after login

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
Copy after login

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
Copy after login

Now run the command below to install it.

$ sudo yum install yarn    ## CentOS and Redhat systems 
$ sudo dnf install yarn    ## Fedora systems
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!