I’ve worked with Amazon Linux for a while, and the easiest way to get Node.js and NPM up and running is through the amazon-linux-extras repository. No hassle, just a few commands!
First, check if Node.js is available:
amazon-linux-extras list | grep nodejs
This will show available versions, such as nodejs16 or nodejs18.
Enable the required Node.js version:
sudo amazon-linux-extras enable nodejs18
Now, install Node.js and NPM:
sudo yum install -y nodejs
Verify the installation:
node -v
npm -v
And that’s it! With yum install nodejs, you get Node.js and NPM installed in minutes—no need to build anything manually. ![]()