@emma-crepeau method works great, but if you need a newer or specific version of Node.js that isn’t available in amazon-linux-extras, you should use NodeSource. It’s my go-to for flexibility!"*
First, install NodeSource’s repository setup script:
(Replace 18.x with 20.x if you need Node.js 20.)
Now, install Node.js and NPM:
sudo yum install -y nodejs
Verify the installation:
node -v
npm -v
This method ensures you get the latest stable version straight from the source. If amazon-linux-extras doesn’t have what you need, this is the way to go! ![]()