In this context, we shall look into how to install NodeJS on Rocky Linux 8.4.
NodeJS is available in Rocky Linux AppStream repositories. To see the available NodeJS modules, run the following command:
$ sudo dnf module list nodejs
If the version of nodejs is now up to date then follow the process below to Install the latest version.
Now, to install the latest release of NodeJS, which at the time of this guide is NodeJS 14.x, invoke the command:
$ sudo dnf module install nodejs:14
This command will install the latest NodeJS module alongside NPM ( Node Package Manager ) and other dependencies.
The installation of Node.JS proceeds and terminates successfully without any errors.
Once completed, verify the NodeJS version with the below command:
$ node -v
$ node --version
To remove NodeJS from your system simply execute:
$ sudo dnf module remove nodejs
To confirm that NodeJS is uninstalled, check the version once again:
$ node -v