Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

@BenGC

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'.

@Wilshire

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

sudo su
PATH=$PATH:/home/ec2-user/node
export PATH
curl http://npmjs.org/install.sh | 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
add comment

Your Answer

 
discard

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.