npm 快速安装 yarn

本文将介绍怎样利用 npm 命令快速安装 yarn 命令

注意:

如果你没有 npm 命令,可以通过安装 NodeJS 来安装 npm(npm 是随同 NodeJS 一起安装的包管理工具)。

NodeJS 官网:http://nodejs.cn/download/

npm 安装 yarn 命令很便捷,如下:

C:\Users\Administrator> npm install -g yarn
npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! errno UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! request to https://registry.npmjs.org/yarn failed, reason: unable to verify the first certificate

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-10-22T14_43_23_448Z-debug.log

安装失败了,请求到 https://registry.npmjs.org/yarn  失败。

你可以通过“--registry”指定到国内镜像,如下:

npm install -g yarn --registry=https://registry.npm.taobao.org

然后,再配置下源:

yarn config set registry https://registry.npm.taobao.org -g
yarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g

yarn 官方安装方法:https://yarn.bootcss.com/docs/install/#windows-stable

沉浸于现实的忙碌之中,没有时间和精力思念过去,成功也就不会太远了。——雷音
0 不喜欢
说说我的看法 -
全部评论(
没有评论
关于
本网站属于个人的非赢利性网站,转载的文章遵循原作者的版权声明,如果原文没有版权声明,请来信告知:hxstrive@outlook.com
公众号