Install NODEJS on a remote instance of AWS Red Hat Enterprise Linux 7.1

I am trying to install NODEJS on a remote instance of AWS Red Hat Enterprise Linux 7.1

I read some of the posts here and was on the node js website

I tried t

curl --silent --location https://rpm.nodesource.com/setup | bash - 

but then get an error

error: cannot create a transaction lock on /var/lib/rpm/.rpm.lock (denial of rights)

I even get this error if I run

 sudo curl --silent --location https://rpm.nodesource.com/setup | bash - 

I also tried changing the permissions of this file, but then it still doesn't install

Can someone suggest a better way / right way to do this?

thanks

+7
javascript linux amazon-web-services
source share
3 answers

You simply do not have installation rights. It doesn't matter that you use curl with sudo, because you really need superuser rights - this is the bash session inside which you run the script.

So it will work.

 curl --silent --location https://rpm.nodesource.com/setup | sudo bash - 
+23
source share

On at least one of our ESXi RedHat virtual machines, the easiest way I know to install nodejs is:

  yum install epel-release yum install nodejs 

Let yum do all the hard lifting :)

+1
source share

You may be working as a user without root. Before running your actual curl command, run

 sudo su 

Then run (without sudo, since now you are working as root user)

 curl --silent --location https://rpm.nodesource.com/setup | bash - 
0
source share

All Articles