Search code examples
node.jsnodes

Install specific version of nodejs on RHEL server


I am trying to install NodeJS 6.9.5 version at my RHEL server but it is not working.

I ran below command successfully

curl -sL https://rpm.nodesource.com/setup_6.x | sudo bash -

But yum install -y nodejs:6.9.5 command is failing with below error. Could someone guide me?

yum install -y nodejs:6.9.5 Loaded plugins: ovl, product-id, search-disabled-repos, subscription-manager This system is not registered with an entitlement server. You can use subscription-manager to register. No package nodejs:6.9.5 available. Error: Nothing to do


Solution

  • Use nvm to install specific version of node.js.

    To install node 6.9.5 in your machine,

    • Install nvm curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
    • First source your .bash_profile source ~/.bash_profile
    • Now install your desired version nvm install v6.9.5

    You can go through this article, for details, especially Install Node Using the Node Version Manager section.