This article will take you through how to install Nodejs on Rocky Linux 9. Node.js is a cross-platform, open-source back-end JavaScript runtime environment that uses the V8 engine to execute JavaScript code outside of a web browser.
How to Install Nodejs on Rocky Linux 9
- Update your system using the command below.
sudo dnf update
- Next, install Nodejs using the command below. Note, it will install the current stable version.
sudo dnf install nodejs -y
Sample output
Last metadata expiration check: 1:40:16 ago on Sat 23 Jul 2022 01:48:02 PM EAT. Dependencies resolved. ===================================================================== Package Arch Version Repo Size ===================================================================== Installing: nodejs x86_64 1:16.14.0-4.el9_0 appstream 201 k Installing dependencies: nodejs-libs x86_64 1:16.14.0-4.el9_0 appstream 14 M Installing weak dependencies: nodejs-docs noarch 1:16.14.0-4.el9_0 appstream 6.7 M nodejs-full-i18n x86_64 1:16.14.0-4.el9_0 appstream 8.1 M npm x86_64 1:8.3.1-1.16.14.0.4.el9_0 appstream 1.7 M Transaction Summary ===================================================================== Install 5 Packages Total download size: 31 M Installed size: 161 M Downloading Packages: (1/5): npm-8.3.1-1.16.14.0.4.el9_0.x 177 kB/s | 1.7 MB 00:09 (2/5): nodejs-16.14.0-4.el9_0.x86_64 167 kB/s | 201 kB 00:01 (3/5): nodejs-full-i18n-16.14.0-4.el 196 kB/s | 8.1 MB 00:42 (4/5): nodejs-docs-16.14.0-4.el9_0.n 208 kB/s | 6.7 MB 00:33 (5/5): nodejs-libs-16.14.0-4.el9_0.x 259 kB/s | 14 MB 00:56 --------------------------------------------------------------------- Total 436 kB/s | 31 MB 01:12 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Running scriptlet: npm-1:8.3.1-1.16.14.0.4.el9_0.x86_64 1/1 Preparing : 1/1 Installing : nodejs-docs-1:16.14.0-4.el9_0.noarch 1/5 Installing : nodejs-libs-1:16.14.0-4.el9_0.x86_64 2/5 Installing : nodejs-full-i18n-1:16.14.0-4.el9_0.x86_64 3/5 Installing : nodejs-1:16.14.0-4.el9_0.x86_64 4/5 Installing : npm-1:8.3.1-1.16.14.0.4.el9_0.x86_64 5/5 Running scriptlet: npm-1:8.3.1-1.16.14.0.4.el9_0.x86_64 5/5 Verifying : npm-1:8.3.1-1.16.14.0.4.el9_0.x86_64 1/5 Verifying : nodejs-libs-1:16.14.0-4.el9_0.x86_64 2/5 Verifying : nodejs-full-i18n-1:16.14.0-4.el9_0.x86_64 3/5 Verifying : nodejs-1:16.14.0-4.el9_0.x86_64 4/5 Verifying : nodejs-docs-1:16.14.0-4.el9_0.noarch 5/5 Installed: nodejs-1:16.14.0-4.el9_0.x86_64 nodejs-docs-1:16.14.0-4.el9_0.noarch nodejs-full-i18n-1:16.14.0-4.el9_0.x86_64 nodejs-libs-1:16.14.0-4.el9_0.x86_64 npm-1:8.3.1-1.16.14.0.4.el9_0.x86_64 Complete!
- Check the version installed.
node -v
- Check the version of npm installed.
npm -v
- That marks the end of our article, We have gone through how to install Nodejs on Rocky Linux 9.
Read more on Nodejs Documentation