Question: I am trying to install node.js on Red Hat Enterprise Linux Server release 6.1 using the following command:

```
sudo yum install nodejs npm

```

I got the following error:

```
Error: Package: nodejs-0.10.24-1.el6.x86_64 (epel)
           Requires: libssl.so.10(libssl.so.10)(64bit)
Error: Package: nodejs-devel-0.10.24-1.el6.x86_64 (epel)
           Requires: libcrypto.so.10(libcrypto.so.10)(64bit)
Error: Package: nodejs-0.10.24-1.el6.x86_64 (epel)
           Requires: libcrypto.so.10(libcrypto.so.10)(64bit)
Error: Package: nodejs-devel-0.10.24-1.el6.x86_64 (epel)
           Requires: libssl.so.10(libssl.so.10)(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

```

I tried the following command as well:

```
sudo yum install -y nodejs

```

I am getting the following error:

```
Error: Package: nodejs-0.10.24-1.el6.x86_64 (epel)
           Requires: libssl.so.10(libssl.so.10)(64bit)
Error: Package: nodejs-0.10.24-1.el6.x86_64 (epel)
           Requires: libcrypto.so.10(libcrypto.so.10)(64bit)

```

How should I install it? I want to install the latest version.

Answer: 
Just as per <https://nodejs.org/en/download/package-manager/> you have to launch:

```
curl --silent --location https://rpm.nodesource.com/setup_4.x | bash -

```

or

```
curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -

```

depending on NodeJS version you need. Then simply run 

```
yum -y install nodejs

```
I recommend using `dnf` to install the version of NodeJS you need because `yum` will likely pull the wrong version. As seen [Here](https://linuxconfig.org/how-to-install-node-js-on-redhat-8-linux)

List the available versions;

```
sudo dnf module list nodejs

```

Install the one you want:

```
sudo dnf module install nodejs:14

```