Follow the steps given below for setting up NodeJS on RedHat 7/Uubntu or Amazon Linux ec2 server.
- Update the repository.
For RHEL/Amazon Linux:
sudo yum update -y
For Ubuntu:
sudo apt-get update -y
-
Install nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
-
Refresh the terminal
source ~/.bashrc
-
You can list the available node versions using the following command.
nvm list
-
Install the specific version of node using nvm.
nvm install 6.9.2
-
Test the installation by executing the following command.
node --version