0

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?

1
  • 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, 2011 at 21:51

2 Answers 2

1

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

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .