0

I have two versions of nodejs on my machine.

I had only v8.6.0. I ran:

sudo apt-add-repository "deb https://deb.nodesource.com/node_8.x $(lsb_release -sc) main"
sudo apt-get update
sudo apt-get install nodejs

And received message: "Installing v8.12.0"

Following this, output of "apt list -a node":

Listing... Done
nodejs/unknown,now 8.12.0-1nodesource1 amd64 [installed]
nodejs/unknown 6.14.4-1nodesource1 amd64
nodejs/trusty-updates,trusty-security 0.10.25~dfsg2-2ubuntu1.2 amd64
nodejs/trusty 0.10.25~dfsg2-2ubuntu1 amd64

But "node -v" still gives:

v8.6.0

"relevant" lines from /etc/apt/sources.list:

deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse

deb https://deb.nodesource.com/node_8.x trusty main

I even have this in /etc/apt/sources.list.d/nodesource.list:

deb https://deb.nodesource.com/node_6.x trusty main
deb-src https://deb.nodesource.com/node_6.x trusty main
deb https://deb.nodesource.com/node_6.x trusty main
deb-src https://deb.nodesource.com/node_6.x trusty main

I guess I have a conflict with Ubuntu's repo and nodesource's?

How to resolve?

1 Answer 1

0

I was looking in the wrong place.

v8.12.0 lives in /usr/bin, and even /usr/bin/nodejs which is a symlink to /etc/alternatives/nodejs which is a symlink to /usr/bin/node.

v8.6.0 lived in /usr/local/bin

I renamed node in /usr/local/bin then created a symlink called node here to /usr/bin/node.

cd /usr/local/bin
mv node node.v8.6.0
sudo ln -s /usr/bin/node ./node

All seems to work so far ...

I guess I got v8.6 some time ago when I installed maybe cordova or some such ...

I also removed /etc/apt/sources.list.d/nodesource.list

1
  • 1
    You could also look into nvm for managing these.
    – Zlatko
    Oct 17, 2018 at 10:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .