{"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 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 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 Once the repos are in place, you can now install latest Nodejs.<\/p>\n\n\n\n Sample command output;<\/p>\n\n\n\n Checking installed version of Nodejs on Rocky Linux 8;<\/p>\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 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 You may also want to install Yarn on Rocky Linux 8. To do so, run the command below:<\/p>\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\nInstalling Nodejs on Rocky Linux 8<\/h2>\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
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
dnf install nodejs<\/code><\/pre>\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
node -v<\/code><\/pre>\n\n\n\n
v16.4.0<\/code><\/pre>\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
dnf install gcc-c++ make<\/code><\/pre>\n\n\n\n
Install Yarn on Rocky Linux 8<\/h3>\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
Other tutorials<\/h3>\n\n\n\n