{"id":8397,"date":"2021-07-15T11:09:46","date_gmt":"2021-07-15T11:09:46","guid":{"rendered":"https:\/\/linuxways.net\/?p=8397"},"modified":"2021-07-15T11:09:46","modified_gmt":"2021-07-15T11:09:46","slug":"install-node-js-on-rocky-linux-8","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/red-hat\/install-node-js-on-rocky-linux-8\/","title":{"rendered":"Install Node.JS on Rocky Linux 8"},"content":{"rendered":"<p>Node.JS is a cross-platform , JavaScript runtime environment for executing Javascript code outside of a browser. Node.JS is commonly used to create backend services such as APIs which power client applications. Node.JS is used to build superfast, highly scalable, data-intensive, and real-time applications. Notable companies that leverage Node.JS to power their applications include Uber, PayPal, Netflix, LinkedIn and eBay to mention just a few.<\/p>\n<p>If you are running Rocky Linux 8.4, the following steps will help you install NodeJS.<\/p>\n<h2><strong>Check the NodeJS modules on AppStream repositories<\/strong><\/h2>\n<p>NodeJS is available in Rocky Linux AppStream repositories. To see the available NodeJS modules, run the following command:<\/p>\n<pre><strong>$ sudo dnf module list nodejs<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"901\" height=\"209\" class=\"wp-image-8398\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-461.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-461.png 901w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-461-300x70.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-461-768x178.png 768w\" sizes=\"auto, (max-width: 901px) 100vw, 901px\" \/><\/p>\n<p>From the output on the terminal, you can clearly see that the default module with a tag [d] is NodeJS 10 &#8211; which is not the latest version or up to date.<\/p>\n<h2><strong>Install the latest NodeJS release<\/strong><\/h2>\n<p>Therefore, to install the latest release of NodeJS, which at the time of this guide is NodeJS 14.x, invoke the command:<\/p>\n<pre><strong>$ sudo dnf module install nodejs:14<\/strong><\/pre>\n<p>This installs the latest NodeJS module alongside NPM ( Node Package Manager ) and other dependencies as shown in the output.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"901\" height=\"399\" class=\"wp-image-8399\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-462.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-462.png 901w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-462-300x133.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-462-768x340.png 768w\" sizes=\"auto, (max-width: 901px) 100vw, 901px\" \/><\/p>\n<p>The installation of Node.JS proceeds and terminates successfully without any erros as shown below, as should be in your case.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"901\" height=\"392\" class=\"wp-image-8400\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-463.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-463.png 901w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-463-300x131.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-463-768x334.png 768w\" sizes=\"auto, (max-width: 901px) 100vw, 901px\" \/><\/strong><\/p>\n<p>Once complete, verify the NodeJS version as shown.<\/p>\n<pre><strong>$ node -v<\/strong><\/pre>\n<p>or<\/p>\n<pre><strong>$ node --version<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"667\" height=\"169\" class=\"wp-image-8401\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-464.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-464.png 667w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-464-300x76.png 300w\" sizes=\"auto, (max-width: 667px) 100vw, 667px\" \/><\/strong><\/p>\n<p>And that\u2019s how you install NodeJS on Rocky Linux 8. You can now start building your backend services and deploying them.<\/p>\n<h2><strong>How to uninstall NodeJS <\/strong><\/h2>\n<p>To remove NodeJS from your system simply execute:<\/p>\n<pre><strong>$ sudo dnf module remove nodejs<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"902\" height=\"410\" class=\"wp-image-8402\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-465.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-465.png 902w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-465-300x136.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-465-768x349.png 768w\" sizes=\"auto, (max-width: 902px) 100vw, 902px\" \/><\/p>\n<p>To confirm that NodeJS is uninstalled, check the version once again.<\/p>\n<pre><strong>$ node -v<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"614\" height=\"138\" class=\"wp-image-8403\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-466.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-466.png 614w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-466-300x67.png 300w\" sizes=\"auto, (max-width: 614px) 100vw, 614px\" \/><\/strong><\/p>\n<p>The output above confirms that NodeJS is uninstalled.<\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>As you have noted, the installation of NodeJS is quite seamless and straightforward. This will work the same even on CentOS 8 from which Rocky Linux is based.<\/p>","protected":false},"excerpt":{"rendered":"<p>Node.JS is a cross-platform , JavaScript runtime environment for executing Javascript code outside of a browser. Node.JS is commonly used to create backend services such as APIs which&hellip;<\/p>","protected":false},"author":1,"featured_media":8436,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[165],"tags":[259,411],"class_list":["post-8397","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-red-hat","tag-node-js","tag-rocky-linux"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/8397","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=8397"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/8397\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/8436"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=8397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=8397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=8397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}