Node.js runs JavaScript command-line tools and server applications on RHEL-family Linux systems. Installing it from the distribution AppStream repositories keeps the runtime under dnf control, which matters when the same host receives normal operating-system updates.
Current CentOS Stream, Rocky Linux, AlmaLinux, and Red Hat Enterprise Linux releases expose Node.js as AppStream content. A selected stream such as nodejs:24 installs Node.js and npm from the same vendor repository set instead of adding an external package source.
The dnf path uses the repository metadata already configured on the system. NodeSource is a separate choice when distribution streams do not provide the release line required by the application.
$ sudo dnf module list nodejs Rocky Linux 9 - AppStream Name Stream Profiles Summary nodejs 18 common [d], development, minimal, s2i Javascript runtime nodejs 20 common [d], development, minimal, s2i Javascript runtime nodejs 22 common [d], development, minimal, s2i Javascript runtime nodejs 24 common [d], development, minimal, s2i Javascript runtime
$ sudo dnf module enable --assumeyes nodejs:24 Dependencies resolved. ================================================================================ Package Architecture Version Repository Size ================================================================================ Enabling module streams: nodejs 24 Transaction Summary ================================================================================ Complete!
Use another listed stream, such as nodejs:20 or nodejs:22, only when the application is pinned to that release line.
$ sudo dnf install --assumeyes nodejs npm Dependencies resolved. ====================================================================================================== Package Arch Version Repo Size ====================================================================================================== Installing: nodejs x86_64 1:24.14.1-2.module+el9.7.0+40151+7a588b37 appstream 67 k npm noarch 1:11.11.0-1.24.14.1.2.module+el9.7.0+40151+7a588b37 appstream 1.9 M Installing dependencies: nodejs-libs x86_64 1:24.14.1-2.module+el9.7.0+40151+7a588b37 appstream 17 M ##### snipped ##### Complete!
$ node --version v24.14.1
$ npm --version 11.11.0
$ node --eval "console.log(1 + 2)" 3