RPV
RPV

Reputation: 397

AWS EC2 not installing nodejs

I am following this tutorial, but it appears that nodejs isn't being installed.

The output I get is:

sudo yum install nodejs

Failed to set locale, defaulting to C

Loaded plugins: priorities, update-motd, upgrade-helper

No package nodejs available.

Error: Nothing to do

I've checked around online, but can't find a way forward. How do I install nodejs on ubuntu in aws ec2?

Upvotes: 2

Views: 3428

Answers (2)

cangokceaslan
cangokceaslan

Reputation: 482

You can install the nvm

curl https://raw.githubusercontent.com/creationix/nvm/v0.11.1/install.sh | bash

Then run the command

source ~/.profile

Now run this and this will show will all installed or other versions of packages:

nvm ls-remote

Installed packages will be in green. Install whatever version you want:

nvm install 6.0.0

Check where is not installed:

which node

Check current version:

node -v

Upvotes: 0

Vikram Tiwari
Vikram Tiwari

Reputation: 3895

I am guessing that you started with a new instance and did not update it with latest updates or package sources first. You are missing the source for NodeJS packages.

This will add the source and install nodejs:

curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - sudo apt-get install -y nodejs

Follow this: https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions

Upvotes: 4

Related Questions