{"id":9383,"date":"2021-06-28T22:12:13","date_gmt":"2021-06-28T19:12:13","guid":{"rendered":"https:\/\/kifarunix.com\/?p=9383"},"modified":"2024-03-18T20:13:35","modified_gmt":"2024-03-18T17:13:35","slug":"install-yarn-on-rocky-linux-8","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-yarn-on-rocky-linux-8\/","title":{"rendered":"Install Yarn on Rocky Linux 8"},"content":{"rendered":"\n<p>Follow through this guide to learn how to install Yarn on Rocky Linux 8. Yarn is an acronym for <strong>Y<\/strong>et&nbsp;<strong>A<\/strong>nother&nbsp;<strong>R<\/strong>esource&nbsp;<strong>N<\/strong>avigator, and 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 Rocky Linux 8<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Prerequisites<\/h3>\n\n\n\n<p>In order to install Yarn, you need to have NPM installed.<\/p>\n\n\n\n<p>Install latest Nodejs Package Manager on Rocky Linux. Nodejs 16.x is the current stable release based on the <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>curl -sL https:\/\/rpm.nodesource.com\/setup_16.x | sudo -E bash -<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install nodejs<\/code><\/pre>\n\n\n\n<p>Nodejs installs NPM.<\/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.18.1<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Installing Yarn on Rocky Linux 8<\/h3>\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-dnf\">Install Yarn from Yarn Repo via YUM\/DNF 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>Assuming 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 Rocky Linux 8;<\/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.10<\/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-dnf\">Install Yarn via DNF\/YUM<\/h3>\n\n\n\n<p>Once you have NPM installed via the Nodejs, you can install Yarn via the YUM repository by running the commands below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>curl -sL https:\/\/dl.yarnpkg.com\/rpm\/yarn.repo | sudo tee \/etc\/yum.repos.d\/yarn.repo<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install yarn<\/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. 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>dnf 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=\"scroll-box\"><code>...\n&gt; GPG signature looks good\n&gt; Extracting to ~\/.yarn...\n&gt; Adding to $PATH...\n&gt; We've added the following to your \/root\/.bashrc\n&gt; If this isn't the profile of your current shell then please add the following to your correct profile:\n   \nexport PATH=\"$HOME\/.yarn\/bin:$HOME\/.config\/yarn\/global\/node_modules\/.bin:$PATH\"\n\n&gt; Successfully installed Yarn 1.22.5! Please open another terminal where the `yarn` command will now be available.\n<\/code><\/pre>\n\n\n\n<p>The script dont install yarn globally and so if you can update your PATH environment variable as shown from the command output.<\/p>\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.<\/p>\n\n\n\n<p>Read more on <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-latest-nodejs-on-rocky-linux-8\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install Latest Nodejs on Rocky Linux 8<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-php-composer-on-rocky-linux-8\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install PHP Composer on Rocky Linux 8<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-lamp-stack-on-rocky-linux-8\/#php-8.0-rocky\" target=\"_blank\" rel=\"noreferrer noopener\">Install PHP 8.0 on Rocky Linux 8<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Follow through this guide to learn how to install Yarn on Rocky Linux 8. Yarn is an acronym for Yet&nbsp;Another&nbsp;Resource&nbsp;Navigator, and is a fast, secure<\/p>\n","protected":false},"author":1,"featured_media":9384,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121],"tags":[3759,3760,3757,3761],"class_list":["post-9383","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-install-yarn-rocky-linux","tag-nodejs","tag-npm","tag-yarn-rocky-linux","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\/9383"}],"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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=9383"}],"version-history":[{"count":4,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/9383\/revisions"}],"predecessor-version":[{"id":21758,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/9383\/revisions\/21758"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/9384"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=9383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=9383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=9383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}