In today blog post we are going to install node.js for our Amazon Linux ec2 instance.
Let's first download the nvm package.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
Now activate the nvm by typing the following at the command line.
. ~/.nvm/nvm.sh
Now let's use nvm to install the latest version of Node.js.
nvm install node
Now test if node.js has been installed.
node -e "console.log('Running Node.js ' + process.version)"
output
Running Node.js v15.2.1
Node.js has been installed and is ready for use.