install node in redhat linux

C++
-------------- As root user -------------- 
# curl -sL https://rpm.nodesource.com/setup_10.x | bash -

-------------- A user with root privileges  --------------
$ curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
# yum -y install nodejs
OR
# dnf -y install nodejs

Source

Also in C++: