Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using EC2 with their Amazon Linux AMI. There is no way to login as root for security reasons. I installed node.JS with no problem but failed with the Node Package Manger. When using curl without sudo it fails because userrights are missing, if you use sudo it fails because it thinks node is missing. Tried get and make install too, but this fails also (don't know where to look up why...) Has anyone finished installing npm with sudo only?

share|improve this question
Have you checked to make sure node.JS is in your path? It could be npm can't find it because it was installed where npm isn't expecting it. – Wilshire Jul 1 '11 at 21:51

Why don't you just type

sudo su

at the command line to get a root prompt? This is confirmed to work with the latest Amazon Linux AMI...

share|improve this answer


In my case it makes no difference if you switch to a root prompt first or do it in one line, it both results in 'npm cannot be installed without node'.


That does the trick. So I've done the following to make it work

sudo su
export PATH
curl | sh

I don't know where npm expects node to be, maybe just using 'home/ec2-user/node' wasn't a good idea...?!

Thanks to all for their response.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.