Install NodeJS 6 in CentOS8

  • administrators

    By the time of this writing, the latest NodeJS is V14.3.0, so there is no meaning to install Node6, which is no longer supported.

    But I still wanted to give it a try, by following those commands:

    # Install Node.js 6.x repository
    curl -sL | bash -
    # Install Node.js and npm
    apt-get install -y nodejs

    Unfortunately, I got not just warnings, but it's failed to installed.
    Then I gave up, and tried to install the higher version of NodeJS by following this tutorial:

    But I stuck at this command:

    sudo dnf module list nodejs

    It throw the errors:

    Failed to download metadata for repo 'nodesource'

    Believe it or not, it's not easy to find out the solution from Google. Finally, I figured it out at:

    But in my case, I need to remove the repo, I installed when I tried to install NodeJS6, which are:

    cd /etc/yum.repos.d/
    sudo rm nodesource-el8.repo
    cd /etc/pki/rpm-gpg/
    sudo yum clean all

    Happy Installing! 🙂