在 windows wsl ubuntu 中安装 yarn,按照官网操作结果失败了
官网教程:
yarn install for debian / ubuntu
报错:
can't connect to the agent: IPC connect call failed
解决办法:
sudo apt remove gpg
sudo apt install gnupg1
然后再执行:
#
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
# 验证是否成功
yarn --version
最后,更新淘宝源:
yarn config get registry
# https://registry.yarnpkg.com
yarn config set registry https://registry.npm.taobao.org
yarn config get registry
# https://registry.npm.taobao.org
参考:Ubuntu20.04安装yarn报错gpg: can't connect to the agent: IPC connect call failed(已解决)