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