{"id":10243,"date":"2021-09-20T18:30:22","date_gmt":"2021-09-20T18:30:22","guid":{"rendered":"https:\/\/linuxways.net\/?p=10243"},"modified":"2021-09-20T18:30:22","modified_gmt":"2021-09-20T18:30:22","slug":"how-to-install-yarn-on-rocky-linux-8-almalinux-8","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/red-hat\/how-to-install-yarn-on-rocky-linux-8-almalinux-8\/","title":{"rendered":"How to Install Yarn on Rocky Linux 8 \/ AlmaLinux 8"},"content":{"rendered":"<p>YARN, short for Yet Another Resource Navigator, is a fast, stable, and reliable Javascript package manager which is compatible with npm ( Node Package Manager). Yarn helps with the management of npm packages which includes installation, updating, configuration, and removal of packages.<\/p>\n<p>In this walkthrough, you will learn how to install Yarn on Rocky Linux 8 \/ AlmaLinux 8.<\/p>\n<h2><strong>Step 1: Install Node.JS and NPM<\/strong><\/h2>\n<p>To set sail, we need to install NPM as a prerequisite for Yarn installation. To achieve this, we will install <a href=\"https:\/\/nodejs.org\/\">NodeJS<\/a> which provides the npm package. At the moment, Node.JS 16 is the latest version of Node and can be installed from Nodesource.<\/p>\n<p>So, login as a sudo user and download and run the Nodesource script.<\/p>\n<pre><strong>$ curl -sL https:\/\/rpm.nodesource.com\/setup_16.x | sudo -E bash -<\/strong><\/pre>\n<p>The script inspects your system\u2019s architecture, confirms if it supports Node.JS, and proceeds to install the Nodesource repository on your system.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"895\" height=\"301\" class=\"wp-image-10244\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-404.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-404.png 895w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-404-300x101.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-404-768x258.png 768w\" sizes=\"auto, (max-width: 895px) 100vw, 895px\" \/><\/strong><\/p>\n<p>At the very end of the output, some post installations instructions will be displayed as shown.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"844\" height=\"233\" class=\"wp-image-10245\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-405.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-405.png 844w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-405-300x83.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-405-768x212.png 768w\" sizes=\"auto, (max-width: 844px) 100vw, 844px\" \/><\/strong><\/p>\n<p>The next step is to install npm and NodeJS which is an open-source Javascript runtime environment. To install NodeJS and npm by extension, execute the command:<\/p>\n<pre><strong>$ sudo dnf install nodejs<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"902\" height=\"294\" class=\"wp-image-10246\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-406.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-406.png 902w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-406-300x98.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-406-768x250.png 768w\" sizes=\"auto, (max-width: 902px) 100vw, 902px\" \/><\/strong><\/p>\n<p>Once installed, verify that NodeJS is installed:<\/p>\n<pre><strong>$ node -v<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"506\" height=\"104\" class=\"wp-image-10247\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-407.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-407.png 506w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-407-300x62.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-407-501x104.png 501w\" sizes=\"auto, (max-width: 506px) 100vw, 506px\" \/><\/strong><\/p>\n<p>And npm as well.<\/p>\n<pre><strong>$ npm -v<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"554\" height=\"107\" class=\"wp-image-10248\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-408.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-408.png 554w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-408-300x58.png 300w\" sizes=\"auto, (max-width: 554px) 100vw, 554px\" \/><\/strong><\/p>\n<p>Great! The prerequisite packages have been installed. The next step will be to install Yarn.<\/p>\n<h2><strong>Step 2: Install Yarn on Rocky Linux<\/strong><\/h2>\n<p>To install Yarn, proceed and add the Yarn repository to Rocky Linux as shown.<\/p>\n<pre><strong>$ curl -sL https:\/\/dl.yarnpkg.com\/rpm\/yarn.repo | sudo tee \/etc\/yum.repos.d\/yarn.repo<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"917\" height=\"180\" class=\"wp-image-10249\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-409.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-409.png 917w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-409-300x59.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-409-768x151.png 768w\" sizes=\"auto, (max-width: 917px) 100vw, 917px\" \/><\/strong><\/p>\n<p>Then install Yarn from the Yarn repository:<\/p>\n<pre><strong>$ sudo dnf install yarn<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"899\" height=\"277\" class=\"wp-image-10250\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-410.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-410.png 899w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-410-300x92.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-410-768x237.png 768w\" sizes=\"auto, (max-width: 899px) 100vw, 899px\" \/><\/strong><\/p>\n<p>When prompted, accept the GPG key by pressing \u2018y\u2019.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"905\" height=\"326\" class=\"wp-image-10251\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-411.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-411.png 905w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-411-300x108.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-411-768x277.png 768w\" sizes=\"auto, (max-width: 905px) 100vw, 905px\" \/><\/strong><\/p>\n<p>When the installation is complete, confirm that Yarn is installed by checking its version.<\/p>\n<pre><strong>$ yarn -v<\/strong><\/pre>\n<p>The output below confirms that we have successfully installed Yarn version 1.22.5.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"637\" height=\"90\" class=\"wp-image-10252\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-412.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-412.png 637w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-412-300x42.png 300w\" sizes=\"auto, (max-width: 637px) 100vw, 637px\" \/><\/strong><\/p>\n<p>A much simpler way of installing Yarn is by downloading and running an installation script as shown.<\/p>\n<pre><strong>$ curl -o- -L https:\/\/yarnpkg.com\/install.sh | bash<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"789\" height=\"392\" class=\"wp-image-10253\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-413.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-413.png 789w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-413-300x149.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-413-768x382.png 768w\" sizes=\"auto, (max-width: 789px) 100vw, 789px\" \/><\/strong><\/p>\n<p>At the very end, you should see the confirmation that the installation of Yarn went along successfully.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"895\" height=\"324\" class=\"wp-image-10254\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-414.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-414.png 895w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-414-300x109.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-414-768x278.png 768w\" sizes=\"auto, (max-width: 895px) 100vw, 895px\" \/><\/p>\n<p>And that\u2019s it, guys. We have walked you through 2 ways of installing Yarn on Rocky Linux. Any of those methods will work seamlessly to ensure that Yarn is installed on your system.<\/p>","protected":false},"excerpt":{"rendered":"<p>YARN, short for Yet Another Resource Navigator, is a fast, stable, and reliable Javascript package manager which is compatible with npm ( Node Package Manager). Yarn helps with&hellip;<\/p>","protected":false},"author":1,"featured_media":10321,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[165],"tags":[435,436,551],"class_list":["post-10243","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-red-hat","tag-almalinux-8","tag-rocky-linux-8","tag-yarn"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/10243","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=10243"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/10243\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/10321"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=10243"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=10243"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=10243"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}