{"id":10175,"date":"2021-08-24T10:14:41","date_gmt":"2021-08-24T07:14:41","guid":{"rendered":"https:\/\/kifarunix.com\/?p=10175"},"modified":"2024-03-18T18:44:14","modified_gmt":"2024-03-18T15:44:14","slug":"install-yarn-on-debian-11","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-yarn-on-debian-11\/","title":{"rendered":"Install Yarn on Debian 11"},"content":{"rendered":"\n
Follow through this guide to learn how to install Yarn on Debian 11. Yarn is an acronym for Y<\/strong>et A<\/strong>nother R<\/strong>esource N<\/strong>avigator. Yarn is a fast, secure and reliable JavaScript package manager that is compatible with npm registry and can be used with npm.<\/p>\n\n\n\n There are multiple ways in which you can install:<\/p>\n\n\n\n In order to install Yarn via NPM, you need to have NPM installed.<\/p>\n\n\n\n You can install latest Nodejs Package Manager on Debian 11. Nodejs 16.x is the current stable release based on the releases page<\/a>.<\/p>\n\n\n\n Next, run the command below to install Node.js 16.x and npm<\/p>\n\n\n\n Check Nodejs package manager version<\/p>\n\n\n\n Now that NPM is already installed, you can then install Yarn via npm using the command below;<\/p>\n\n\n\n Checking the version of installed Yarn on Debian 11;<\/p>\n\n\n\n If for some reasons you want to uninstall Yarn, you can use the command below;<\/p>\n\n\n\n To install Yarn via APT, you need to ass the Yarn APT repo as shown in the commands below;<\/p>\n\n\n\n Please note this method may not get you the latest version of yarn though.<\/p>\n\n\n\n The command above installs both Yarn and NPM;<\/p>\n\n\n\n The easiest way to install Yarn is via install script. However, note that also, the script installation may not install the latest version of Yarn.<\/p>\n\n\n\n To install Yarn via the install script, you need to have Nodejs installed.<\/p>\n\n\n\n You can simply run the command below to download and run the Yarn installation script.<\/p>\n\n\n\n Sample command output;<\/p>\n\n\n\n The script don’t install yarn globally and hence, it can only be used under your profile.<\/p>\n\n\n\n Source your bashrc and verify the Yarn version:<\/p>\n\n\n\n That marks the end of our tutorial on how to install Yarn on Debian.<\/p>\n\n\n\n Read more on Yarn Documentation page<\/a>.<\/p>\n\n\n\n Install PHP 7.1\/7.2\/7.3\/7.4 on Debian 11<\/a><\/p>\n\n\n\nInstalling Yarn on Debian 11<\/h2>\n\n\n\n
\n
Install Yarn via npm<\/h3>\n\n\n\n
apt install curl sudo -y<\/code><\/pre>\n\n\n\n
curl -sL https:\/\/deb.nodesource.com\/setup_16.x | sudo -E bash -<\/code><\/pre>\n\n\n\n
apt install nodejs<\/code><\/pre>\n\n\n\n
npm -v<\/code><\/pre>\n\n\n\n
7.20.3<\/code><\/pre>\n\n\n\n
npm install --global yarn <\/code><\/pre>\n\n\n\n
yarn -v<\/code><\/pre>\n\n\n\n
1.22.11<\/code><\/pre>\n\n\n\n
Uninstall Yarn<\/h3>\n\n\n\n
npm uninstall -g yarn<\/code><\/pre>\n\n\n\n
Install Yarn via APT<\/h3>\n\n\n\n
curl -sL https:\/\/dl.yarnpkg.com\/debian\/pubkey.gpg | gpg --dearmor | sudo tee \/usr\/share\/keyrings\/yarnkey.gpg >\/dev\/null<\/code><\/pre>\n\n\n\n
echo \"deb [signed-by=\/usr\/share\/keyrings\/yarnkey.gpg] https:\/\/dl.yarnpkg.com\/debian stable main\" | sudo tee \/etc\/apt\/sources.list.d\/yarn.list<\/code><\/pre>\n\n\n\n
apt update<\/code><\/pre>\n\n\n\n
apt install yarn<\/code><\/pre>\n\n\n\n
yarn -v<\/code><\/pre>\n\n\n\n
1.22.5<\/code><\/pre>\n\n\n\n
npm -v<\/code><\/pre>\n\n\n\n
7.20.3<\/code><\/pre>\n\n\n\n
Install Yarn via install Script<\/h3>\n\n\n\n
curl -sL https:\/\/deb.nodesource.com\/setup_16.x | sudo -E bash -<\/code><\/pre>\n\n\n\n
apt install nodejs<\/code><\/pre>\n\n\n\n
apt install curl tar<\/code><\/pre>\n\n\n\n
curl -o- -L https:\/\/yarnpkg.com\/install.sh | bash<\/code><\/pre>\n\n\n\n
...\n> GPG signature looks good\n> Extracting to ~\/.yarn...\n> Adding to $PATH...\n> Successfully installed Yarn 1.22.5! Please open another terminal where the `yarn` command will now be available.<\/code><\/pre>\n\n\n\n
less ~\/.bashrc<\/code><\/pre>\n\n\n\n
export PATH=\"$HOME\/.yarn\/bin:$HOME\/.config\/yarn\/global\/node_modules\/.bin:$PATH\"<\/code><\/pre>\n\n\n\n
source ~\/.bashrc<\/code><\/pre>\n\n\n\n
yarn -v<\/code><\/pre>\n\n\n\n
Other Tutorials<\/h3>\n\n\n\n