ubuntu安装yarn

2022-09-01 15:20:19 浏览数 (1)

大家好,又见面了,我是你们的朋友全栈君。

1、安装yarn

代码语言:javascript复制
sudo apt-get update
sudo apt-get upgrade
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -

echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get install yarn

验证

代码语言:javascript复制
yarn --version

2、换源

代码语言:javascript复制
yarn config set registry https://registry.npm.taobao.org

提示:如果输入yarn报错(There are no scenarios ; must have at least one)则按如下进行升级

代码语言:javascript复制
sudo apt remove cmdtest
sudo apt remove yarn
 
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
 
sudo apt update
sudo apt install yarn

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/141438.html原文链接:https://javaforall.cn

0 人点赞