怎样安装yarn

2025年3月28日 | 分类: 【技术】

从官网重新安装 Yarn :

添加 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

报错:Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
参考:https://itsfoss.com/apt-key-deprecated/

更新下载列表:

sudo apt-get update

Install Yarn from the official source:

sudo apt-get install yarn -y

apt install cmdtest -y

会出现此类报错:

After removing conflicting packages,

Uninstall cmdtest:

sudo apt remove cmdtest -y

Remove the existing Yarn installation:

sudo apt remove yarn