Installing NPM on AWS EC2


Working on Ec2 on AWS.

I have installed Node.js and it works fine.

But the problem arises when trying to install npm.

I am using the following command to install it:

sudo curl | sh

But the install seems to freeze... I get "fetching:" at the prompt and it stays on like this.

Have any idea what is going on here?

11/20/2011 10:43:49 PM

Accepted Answer

sudo yum install nodejs npm --enablerepo=epel
2/11/2014 7:05:47 PM

To install NodeJS 6.x execute the following commands:

curl -sL | sudo -E bash -
yum install nodejs --enablerepo=nodesource


You can install NodeJS 7 and 8 in the same way. Just specify the version you need instead of 6 in the command above.


To update to NodeJS 10 (or any other version) do the following:

rm -rf /etc/yum.repos.d/nodesource-el*
curl -sL | sudo -E bash -
yum install nodejs --enablerepo=nodesource

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow