Install Yarn on Raspberry Pi

Install Yarn on Raspberry Pi

Yarn is a package manager for Node.js that allows to install packages from the npm registry. Yarn is compatible with npm and can be used as alternative. Yarn can use the same package.json format.

This tutorial explains how to install Yarn on Raspberry Pi.

Connect to Raspberry Pi via SSH. Download GPG key and add it to the list of trusted keys. Then add new repository to the list.

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

If you have Node.js already installed, then execute the following command to install Yarn only:

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

If Node.js is not installed, you can run this command to install Yarn and Node.js:

sudo apt install -y yarn

When installation has been completed, we can check Yarn version.

yarn --version

Execute the following command if you want completely remove Yarn and related dependencies:

sudo apt purge --autoremove -y yarn

Leave a Comment

Cancel reply

Your email address will not be published.