I've seen the writeup on using yum to install the dependencies, and then installing Node.JS & NPM from source. While this does work, I feel like Node.JS and NPM should both be in a public repo somewhere.
How can I install Node.JS and NPM in one command on AWS Amazon Linux?
Stumbled onto this, was strangely hard to find again later. Putting here for posterity:
EDIT 3: As of July 2016, EDIT 1 no longer works for nodejs 4 (and EDIT 2 neither). This answer (https://stackoverflow.com/a/35165401/78935) gives a true one-liner.
EDIT 1: If you're looking for nodejs 4, please try the EPEL testing repo:
EDIT 2: To upgrade from nodejs 0.12 installed through the EPEL repo using the command above, to nodejs 4 from the EPEL testing repo, please follow these steps:
The newer packages put the node binaries in
/usr/bin
, instead of/usr/local/bin
.And some background:
The option
--enablerepo=epel
causesyum
to search for the packages in the EPEL repository.