{"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<p>Follow through this guide to learn how to install Yarn on Debian 11. Yarn is an acronym for&nbsp;<strong>Y<\/strong>et&nbsp;<strong>A<\/strong>nother&nbsp;<strong>R<\/strong>esource&nbsp;<strong>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<h2 class=\"wp-block-heading\">Installing Yarn on Debian 11<\/h2>\n\n\n\n<p>There are multiple ways in which you can install:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#npm\">Install Yarn via npm package manager<\/a><\/li>\n\n\n\n<li><a href=\"#yarn-via-apt\">Install Yarn from Yarn Repo via APT package manager<\/a><\/li>\n\n\n\n<li><a href=\"#yarn-script\">Install Yarn with Script<\/a><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"npm\">Install Yarn via npm<\/h3>\n\n\n\n<p>In order to install Yarn via NPM, you need to have NPM installed.<\/p>\n\n\n\n<p>You can install latest Nodejs Package Manager on Debian 11. Nodejs 16.x is the current stable release based on the&nbsp;<a href=\"https:\/\/nodejs.org\/en\/about\/releases\/\" target=\"_blank\" rel=\"noreferrer noopener\">releases page<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install curl sudo -y<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>curl -sL https:\/\/deb.nodesource.com\/setup_16.x | sudo -E bash -<\/code><\/pre>\n\n\n\n<p>Next, run the command below to install Node.js 16.x and npm<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install nodejs<\/code><\/pre>\n\n\n\n<p>Check Nodejs package manager version<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>npm -v<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>7.20.3<\/code><\/pre>\n\n\n\n<p>Now that NPM is already installed, you can then install Yarn via npm using the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>npm install --global yarn <\/code><\/pre>\n\n\n\n<p>Checking the version of installed Yarn on Debian 11;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>yarn -v<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>1.22.11<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Uninstall Yarn<\/h3>\n\n\n\n<p>If for some reasons you want to uninstall Yarn, you can use the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>npm uninstall -g yarn<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"yarn-via-apt\">Install Yarn via APT<\/h3>\n\n\n\n<p>To install Yarn via APT, you need to ass the Yarn APT repo as shown in the commands below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>curl -sL https:\/\/dl.yarnpkg.com\/debian\/pubkey.gpg | gpg --dearmor | sudo tee \/usr\/share\/keyrings\/yarnkey.gpg &gt;\/dev\/null<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>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<pre class=\"wp-block-preformatted\"><code>apt update<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install yarn<\/code><\/pre>\n\n\n\n<p>Please note this method may not get you the latest version of yarn though.<\/p>\n\n\n\n<p>The command above installs both Yarn and NPM;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>yarn -v<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>1.22.5<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>npm -v<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>7.20.3<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"yarn-script\">Install Yarn via install Script<\/h3>\n\n\n\n<p>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<p>To install Yarn via the install script, you need to have Nodejs installed.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>curl -sL https:\/\/deb.nodesource.com\/setup_16.x | sudo -E bash -<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install nodejs<\/code><\/pre>\n\n\n\n<p>You can simply run the command below to download and run the Yarn installation script.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install curl tar<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>curl -o- -L https:\/\/yarnpkg.com\/install.sh | bash<\/code><\/pre>\n\n\n\n<p>Sample command output;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>...\n&gt; GPG signature looks good\n&gt; Extracting to ~\/.yarn...\n&gt; Adding to $PATH...\n&gt; Successfully installed Yarn 1.22.5! Please open another terminal where the `yarn` command will now be available.<\/code><\/pre>\n\n\n\n<p>The script don&#8217;t install yarn globally and hence, it can only be used under your profile.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>less ~\/.bashrc<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>export PATH=\"$HOME\/.yarn\/bin:$HOME\/.config\/yarn\/global\/node_modules\/.bin:$PATH\"<\/code><\/pre>\n\n\n\n<p>Source your bashrc and verify the Yarn version:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>source ~\/.bashrc<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>yarn -v<\/code><\/pre>\n\n\n\n<p>That marks the end of our tutorial on how to install Yarn on Debian.<\/p>\n\n\n\n<p>Read more on&nbsp;<a href=\"https:\/\/classic.yarnpkg.com\/en\/docs\" target=\"_blank\" rel=\"noreferrer noopener\">Yarn Documentation page<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Other Tutorials<\/h3>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-php-7-1-7-2-7-3-7-4-on-debian-11\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install PHP 7.1\/7.2\/7.3\/7.4 on Debian 11<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-php-8-on-debian-11\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install PHP 8 on Debian 11<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-latest-nodejs-on-rocky-linux-8\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install Latest Nodejs on Rocky Linux 8<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Follow through this guide to learn how to install Yarn on Debian 11. Yarn is an acronym for&nbsp;Yet&nbsp;Another&nbsp;Resource&nbsp;Navigator. Yarn is a fast, secure and reliable<\/p>\n","protected":false},"author":3,"featured_media":10182,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121],"tags":[4003,4004,4001,3757,1046,4002],"class_list":["post-10175","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-debian-11-yarn","tag-install-yarn-on-debian","tag-install-yarn-on-debian-11","tag-npm","tag-yarn","tag-yarn-debian-11","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/10175"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=10175"}],"version-history":[{"count":6,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/10175\/revisions"}],"predecessor-version":[{"id":21679,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/10175\/revisions\/21679"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/10182"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=10175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=10175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=10175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}