安装

经典稳定版本: v1.22.19
Node: ^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0
在开始使用 Yarn 之前,你首先需要将其安装在系统上。 安装 Yarn 的方法有很多种,但推荐使用一种方法,并且是跨平台的:

通过 npm 安装

¥Install via npm

建议通过 npm 包管理器 安装 Yarn,当你在系统上安装 Yarn 时,它会与 Node.js 打包在一起。

¥It is recommended to install Yarn through the npm package manager, which comes bundled with Node.js when you install it on your system.

安装 npm 后,你可以运行以下命令来安装和升级 Yarn:

¥Once you have npm installed you can run the following both to install and upgrade Yarn:

npm install --global yarn

备择方案

单击展开/折叠
Loading...

检查安装

通过运行以下命令检查 Yarn 是否已安装:

yarn --version