Installation | Yarn

Currently, there are no Alpine packages available for RC or nightly builds of Yarn. Please use the tarball:

Installation Script

One of the easiest ways to install Yarn on macOS and generic Unix environments is via our shell script. You can install Yarn by running the following code in your terminal:

curl -o- -L https://yarnpkg.com/install.sh | bash curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --rc curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --nightly

The installation process includes verifying a GPG signature. View the source on GitHub

You can also specify a version by running the following code in your terminal:

curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version [version]

See the releases for possible versions.

Manual Install via tarball

You can install Yarn by downloading a tarball and extracting it anywhere.

cd /opt wget https://yarnpkg.com/latest.tar.gz tar zvxf latest.tar.gz # Yarn is now in /opt/yarn-[version]/ cd /opt wget https://yarnpkg.com/latest-rc.tar.gz tar zvxf latest-rc.tar.gz # Yarn is now in /opt/yarn-[version]/ cd /opt wget https://nightly.yarnpkg.com/latest.tar.gz tar zvxf latest.tar.gz # Yarn is now in /opt/yarn-[version]/

Before extracting Yarn, it is recommended that you verify the tarball using GPG:

wget -qO- https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --import wget https://yarnpkg.com/latest.tar.gz.asc gpg --verify latest.tar.gz.asc # Look for "Good signature from 'Yarn Packaging'" in the output

Từ khóa » Cài Yarn