In this article, we will have explained the necessary steps to install Node.js on Rocky Linux 8. Before continuing with this tutorial, make sure you are logged in as a user with
sudo privileges. All the commands in this tutorial should be run as a non-root user.
Install Node.js on Rocky Linux 8
Step 1. First, before you start installing any package on your Rocky Linux server, we always recommend making sure that all system packages are updated.
sudo dnf update sudo dnf upgrade
Step 2. Install Node.js on Rocky Linux system.
- Installing Nodejs from AppStream Repository.
Now check all available repository modules for Node.js on your Rocky Linux system:
sudo dnf module list nodejs
To enable the latest NodeJS stream, run the command:
sudo dnf module install nodejs:14
After that, verify the repository module Node.js using the command below:
[[email protected] ~]# node -v v14.16.2
- Installing Node.js from Source.
Run the following command to install Node.js from Nodesource Repository:
sudo curl -fsSL https://rpm.nodesource.com/setup_14.x | sudo bash -
Next, run the installation
dnf command as follows to install Node.js:
sudo dnf install nodejs
After the installation is complete, verify Node.js and npm running the following command:
Also, check the nvm version and confirm installation typing:
That’s all you need to do to install Node.js on Rocky Linux 8. I hope you find this quick tip helpful. For further reading on PostgreSQL’s open-source database, please refer to their official knowledge base. If you have questions or suggestions, feel free to leave a comment below.