我的是ubuntu系统,Windows系统的话可以直接前往yarn的官网下载安装包

$ cat /etc/issue

Ubuntu 20.10 \n \l

用的是ubuntu20,换源请看这 ubuntu 换源

步骤如下

sudo apt update
sudo apt install -y nodejs  # 安装nodejs
sudo apt install -y npm # 安装npm
export N_S='http://mirrors.cloud.tencent.com/npm/'
sudo npm i -g npm --registry $N_S
sudo npm i -g yarn --registry $N_S
npm config set registry $N_S
yarn config set -g registry $N_S
yarn config set -g sass_binary_site ${N_S}node-sass/

如果是Windows的话,可用这样配置yarn使用腾讯云源

yarn config set -g registry http://mirrors.cloud.tencent.com/npm/
yarn config set -g sass_binary_site http://mirrors.cloud.tencent.com/npm/node-sass/
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐