Raspberry Pi 安装 Yarn 资源管理器

Yarn是 Node.js 的包管理器,允许从 npm 注册表安装包。Yarn 与 npm 兼容,可以用作替代品。Yarn 可以使用相同的 package.json 格式。

本教程介绍了如何在 Raspberry Pi 上安装 Yarn。

下载 GPG 密钥并将其添加到可信密钥列表中。然后将新存储库添加到列表中。

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

image-20210913163044538

如果您已经安装了 Node.js,则执行以下命令仅安装 Yarn:

sudo apt install --no-install-recommends -y yarn

如果没有安装 Node.js,你可以运行这个命令来安装 Yarn 和 Node.js:

sudo apt install -y yarn

安装完成后,我们可以查看 Yarn 版本。

yarn --version

image-20210913163325554

如果要完全删除 Yarn 和相关依赖项,请执行以下命令:

sudo apt purge --autoremove -y yarn

引用于: https://lindevs.com/install-yarn-on-raspberry-pi/