How to Install NodeJS on CentOS 8

First needs to check available modules and it's status.

dnf module list nodejs

Output:

CentOS-8 - AppStream                            2.1 kB/s | 4.3 kB     00:02
CentOS-8 - Base                                 1.9 kB/s | 3.9 kB     00:02
CentOS-8 - Extras                               765  B/s | 1.5 kB     00:02
CentOS-8 - AppStream
Name      Stream    Profiles                                Summary
nodejs    10 [d]    common [d], development, minimal, s2i   Javascript runtime

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

To check the information about thr nodejs

dnf module info --profile nodejs

Output:

Last metadata expiration check: 0:03:05 ago on Thu 24 Oct 2019 10:59:45 AM EDT.
Name        : nodejs:10:8000020191007212731:55190bc5:x86_64
common      : nodejs
            : npm
development : nodejs
            : nodejs-devel
            : npm
minimal     : nodejs
s2i         : nodejs
            : nodejs-nodemon
            : npm

To install NodeJS, in middle it will ask for permission press "y" and enter to proceed with installation.

dnf install nodejs

Output:

Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Running scriptlet: npm-1:6.9.0-1.10.16.3.2.module_el8.0.0+186+542b25fc.   1/1
  Preparing        :                                                        1/1
  Installing       : npm-1:6.9.0-1.10.16.3.2.module_el8.0.0+186+542b25fc.   1/2
  Installing       : nodejs-1:10.16.3-2.module_el8.0.0+186+542b25fc.x86_6   2/2
  Running scriptlet: nodejs-1:10.16.3-2.module_el8.0.0+186+542b25fc.x86_6   2/2
  Verifying        : nodejs-1:10.16.3-2.module_el8.0.0+186+542b25fc.x86_6   1/2
  Verifying        : npm-1:6.9.0-1.10.16.3.2.module_el8.0.0+186+542b25fc.   2/2

Installed:
  nodejs-1:10.16.3-2.module_el8.0.0+186+542b25fc.x86_64
  npm-1:6.9.0-1.10.16.3.2.module_el8.0.0+186+542b25fc.x86_64

Complete!

Installing NodeJS v10.

dnf module install nodejs:10

Output:

Last metadata expiration check: 0:26:18 ago on Thu 24 Oct 2019 10:59:45 AM EDT.
Dependencies resolved.
================================================================================
 Package           Arch             Version             Repository         Size
================================================================================
Installing module profiles:
 nodejs/common

Transaction Summary
================================================================================

Is this ok [y/N]: y
Complete!

To check Version.

 node -v

Output:

v10.16.3

NodeJS Installation Complete.