{"id":9380,"date":"2021-06-28T20:22:40","date_gmt":"2021-06-28T17:22:40","guid":{"rendered":"https:\/\/kifarunix.com\/?p=9380"},"modified":"2024-03-18T20:14:10","modified_gmt":"2024-03-18T17:14:10","slug":"install-latest-nodejs-on-rocky-linux-8","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-latest-nodejs-on-rocky-linux-8\/","title":{"rendered":"Install Latest Nodejs on Rocky Linux 8"},"content":{"rendered":"\n

In this tutorial, you will learn how to install latest Nodejs on Rocky Linux 8. Nodejs<\/a> is a JavaScript runtime built on Chrome’s V8 JavaScript engine<\/a> and is designed to build scalable network applications.<\/p>\n\n\n\n

Installing Nodejs on Rocky Linux 8<\/h2>\n\n\n\n

Nodejs is available on the default Rocky Linux 8 AppStream repos. However, the available versions may not be up-to-date.<\/p>\n\n\n\n

For example, in the command output below, you can see that Nodejs 10.x repo modules are enabled.<\/p>\n\n\n\n

dnf module list nodejs<\/code><\/pre>\n\n\n\n
\nRocky Linux 8 - AppStream\nName                             Stream                           Profiles                                                       Summary                                    \nnodejs                           10 [d]                           common [d], development, minimal, s2i                          Javascript runtime                         \nnodejs                           12                               common [d], development, minimal, s2i                          Javascript runtime                         \nnodejs                           14                               common [d], development, minimal, s2i                          Javascript runtime                         \n\nHint: [d]efault, [e]nabled, [x]disabled, [i]nstalled\n<\/code><\/pre>\n\n\n\n

Install latest Nodejs YUM\/DNF Repository<\/h3>\n\n\n\n

Therefore, to install the latest, which is Nodejs 16.x, which is the current stable release as per the Nodejs releases page<\/a>, you need to install Nodejs Yum repository on Rocky Linux 8 by executing the command below;<\/p>\n\n\n\n

curl -sL https:\/\/rpm.nodesource.com\/setup_16.x | sudo -E bash -<\/code><\/pre>\n\n\n\n

Install Nodejs on Rocky Linux 8<\/h3>\n\n\n\n

Once the repos are in place, you can now install latest Nodejs.<\/p>\n\n\n\n

dnf install nodejs<\/code><\/pre>\n\n\n\n

Sample command output;<\/p>\n\n\n\n

\nDependencies resolved.\n============================================================================================================================================================================\n Package                                   Architecture                  Version                                                    Repository                         Size\n============================================================================================================================================================================\nInstalling:\n nodejs                                    x86_64                        2:16.4.0-1nodesource                                       nodesource                         31 M\nInstalling dependencies:\n python3-pip                               noarch                        9.0.3-19.el8.rocky                                         appstream                          19 k\n python3-setuptools                        noarch                        39.2.0-6.el8                                               baseos                            162 k\n python36                                  x86_64                        3.6.8-2.module+el8.3.0+120+426d8baf                        appstream                          18 k\nEnabling module streams:\n python36                                                                3.6                                                                                               \n\nTransaction Summary\n============================================================================================================================================================================\nInstall  4 Packages\n\nTotal download size: 31 M\nInstalled size: 87 M\nIs this ok [y\/N]: y\n<\/code><\/pre>\n\n\n\n

Checking installed version of Nodejs on Rocky Linux 8;<\/p>\n\n\n\n

node -v<\/code><\/pre>\n\n\n\n
v16.4.0<\/code><\/pre>\n\n\n\n

Note that the command above also installs NPM along with Nodejs. You can verify by checking the version of installed NPM on Rocky Linux 8.<\/p>\n\n\n\n

npm -v<\/code><\/pre>\n\n\n\n
7.18.1<\/code><\/pre>\n\n\n\n

Install development tools to build native addons<\/h3>\n\n\n\n

If you need to build native Nodejs addons, you need to install some development tools by running the command below;<\/p>\n\n\n\n

dnf install gcc-c++ make<\/code><\/pre>\n\n\n\n

Install Yarn on Rocky Linux 8<\/h3>\n\n\n\n

You may also want to install Yarn on Rocky Linux 8. To do so, run the command below:<\/p>\n\n\n\n

curl -sL https:\/\/dl.yarnpkg.com\/rpm\/yarn.repo | sudo tee \/etc\/yum.repos.d\/yarn.repo<\/code><\/pre>\n\n\n\n
dnf install yarn<\/code><\/pre>\n\n\n\n

You can now proceed to build your web applications using Nodejs.<\/p>\n\n\n\n

Read more on Nodejs getting started guide<\/a>.<\/p>\n\n\n\n

Other tutorials<\/h3>\n\n\n\n

Install PHP Composer on Rocky Linux 8<\/a><\/p>\n\n\n\n

Install PHP 8.0 on Rocky Linux 8<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

In this tutorial, you will learn how to install latest Nodejs on Rocky Linux 8. Nodejs is a JavaScript runtime built on Chrome’s V8 JavaScript engine<\/p>\n","protected":false},"author":1,"featured_media":9382,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121],"tags":[3758,3756,3757,1046],"class_list":["post-9380","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-install-nodejs-rocky-linux","tag-nodejs-rocky-linux","tag-npm","tag-yarn","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\/9380"}],"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=9380"}],"version-history":[{"count":2,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/9380\/revisions"}],"predecessor-version":[{"id":21760,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/9380\/revisions\/21760"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/9382"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=9380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=9380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=9380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}