-1

I want to install 11.x version of Node.js on my Ubuntu sevrer using apt/apt-get, but it always installs version 8.10.x. Is there a way to install the latest 12.x or 11.x version without using nvm?

I've tried apt-get update, purging nodejs, using commands below:

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

None of above helped. I'm still getting an old verion of Node.js

alexozornin
  • 33
  • 1
  • 4
  • 1
    You might have better luck asking the question on the unix or ubuntu stack exchanges instead of on stackoverflow since they're more oriented towards these types of questions – Chi May 17 '19 at 19:31
  • Following these commands on my machine installs Node 11.15.0 – Mureinik May 17 '19 at 19:39
  • Yes, I have also successfully installed latest Node.js on other machines using the curl approach, but this time it doesn't work – alexozornin May 17 '19 at 19:44

1 Answers1

0

The implementations of languages provided by operating systems tend to lean towards stability within their particular ecosystem (i.e: they play nice with everything else in the repositories). If you wish to use a newer version I recommend asdf which allows you install multiple versions of implementations of various languages including Node.

0x777C
  • 993
  • 7
  • 21
  • Well, both nvm and asdf approaches helped, but I can't get the source of the problem. I've just installed latest version using curl on clean new machine. I have probably accidentally changed the source repository for nodejs, but that is unlikely. – alexozornin May 17 '19 at 20:18
  • You probably now have multiple node executables that are conflicting, try `whereis node` – 0x777C May 17 '19 at 21:45