Stéphane Bnn
Stéphane Bnn

Reputation: 75

Error installing node js on Amazon EC2

I am trying to install Node Js and npm on my new Amazon EC2 instance but I can't succeed in doing so.

I am referring to the official doc : https://nodejs.org/en/download/package-manager/

I run

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

But I am getting an error :

error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)

I have seen similar case problems that were solved by using sudo but even using sudo I can't get it.

Thanks for your help !

Upvotes: 0

Views: 910

Answers (2)

Steven-maina
Steven-maina

Reputation: 1

Use this command and you'll be good to go:

curl -sL https://rpm.nodesource.com/setup_17.x | bash -

Upvotes: 0

thomas.g
thomas.g

Reputation: 3932

Adding a sudo right before bash did it for me

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

Then

sudo yum install -y nodejs

Upvotes: 2

Related Questions