How to install Node.js & NPM using yum on Amazon Linux?

@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!"*

:one: First, install NodeSource’s repository setup script:

(Replace 18.x with 20.x if you need Node.js 20.)

:two: Now, install Node.js and NPM:

sudo yum install -y nodejs

:three: 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! :fire: