2

I moved from windows to ubuntu and following the instruction as per the site - https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions

Following comand ran successfully

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -

Then

sudo apt-get install -y nodejs

The output of the above command is :

 $sudo apt-get install -y nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
nodejs is already the newest version (4.2.6~dfsg-1ubuntu4.1).
0 upgraded, 0 newly installed, 0 to remove and 519 not upgraded.

As you can see its taking nodejs of version 4 , although I trying to install 8+

I removed the nodejs with

sudo apt-get remove nodejs

but still on trying again it says the same thing. Please note that the setup is new and there was nothing installed previously

I am not sure but I wanted 'node', why its trying to install nodejs

If I try to do this -

$ sudo apt-get install node
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package node is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'node' has no installation candidate
Dhananjay
  • 340
  • 4
  • 17

2 Answers2

0

Once you have version 4, you can update it to the latest. See this topic Upgrading Node.js to latest version

Petar D.
  • 129
  • 1
  • 1
  • 13
0

Hey I use Ubuntu 16 the latest LTS

What you can do, is install ubuntu-make

Then run

  • umake nodejs

It installs the latest version available (v8.2.1)

Or, you can also use nvm

The detailed instructions are here

Note If you use ubuntu-make , you may have to log out and log in

Then check your version via node -v