As documented at http://askubuntu.com/questions/786272/why-does-installing-node-6-x-on-ubuntu-16-04-actually-install-node-4-2-6, apparently there's some error in node installation script and when the user intends to install Node v6 on Ubuntu 16.04 LTS, v4 is actually installed. One has to manually add the NodeJS entry in sources.list.d for the installation to work.
Although that question on StackExchange was asked in June, I'm surprised to still encounter the same error, three months later. Seems that nobody filed a bug report.
Looking at that forum post, there's no bug to report here. It just says "the installer script didn't do what it's supposed to do". If the installer script doesn't run, then you'll get Node v4.2.6 because that's what's in the mainline Ubuntu repositories.
If the installer script is failing for you in some way, please re-open this issue and provide the exact command you are using to run the script as well as any console output so we can try and see what's going on. Thanks.
I don't know how "there is no bug to report here". The reproduction steps are clear: Just run
url -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install -y npm
on any Ubuntu 16.04 LTS and you get node 4.26 installed instead of v6.
The console doesn't output any error or whatsoever, the output suggests everything is normal but eventually v4 gets installed.
The output of the script:
## Installing the NodeSource Node.js v6.x repo...
## Populating apt-get cache...
+ apt-get update
... Output from apt-get update, which doesn't show any abnormality
Is that not enough? What else are users supposed to provide here. Of course the answer just says "the installer script didn't do what it's supposed to do", because it reports everything is normal and then boom, nothing works!
Why doesn't somebody from the nodesource team actually try it out on Ubuntu 16.04 LTS and see if they can reproduce the issue as described instead of just closing the issue without even looking at it? The question is upvoted 17 times on StackExchange. I and the OP are certainly not the only ones impacted by it. It's not like 17 people just pop out of nowhere upvoting posts for fun. This is a quite insidious issue, since no error message is ever shown, a user might well expect Node v6 to be installed, only to face a load of issues later on. And I don't believe users of Ubuntu 16.04 LTS to be exactly a minority either.
I can't reopen the issue myself. Please look at the new issue I created.
Okay, we're sorry you are running into that.
We have tested this installer extensively on Ubuntu 16.04 (I am typing this from my home desktop, which is running Ubuntu 16.04 for example), and we obviously didn't see this or else we wouldn't have shipped anything.
I need to see the _complete_ console output from the installer script. Also, if you could download it directly to your machine and run it as
sudo bash -xe setup_6.x
and attach the complete output here also that should help as a starting point.
Re-opening as requested.
Also as @mweagle noted, if after the script runs, can you also let us know what the output of:
cat /etc/apt/sources.list.d/nodesource.list
as well as
sudo ls -la /etc/apt/sources.list.d
are? Thanks.
I had this problem on Ubuntu trusty, 14.04.4 LTS, on Joyent.
After following the instructions to download and install, node -v still shows v4.3.1 !
Then I recalled docs that said there is some conflict with the name node on ubuntu.
So I checked:
node -v // v4.3.1
nodejs -v // v6.9.1
npm -v // 2.14.12
Also, note the install locations are diffent
which node // /usr/local/bin/node
which nodejs // /usr/bin/nodejs
which npm // /usr/local/bin/npm
Also, npm is installed but in a different place, so:
/usr/bin/npm -v // 3.10.8
Okay, you clearly have more than one thing installed. Please clear out _all_ previous node or npm packages. You can see what you have with:
$ dpkg -l | grep -E 'nodejs|npm'
After you remove everything, please remove the NodeSource apt list entry with
$ sudo rm -fv /etc/apt/sources.list.d/nodesource*
Then, you need to additionally make sure you've uninstalled any other non-packaged versions of node. The command:
$ which node
should return nothing.
Then run the installer script again.
I tried removing everything, then:dpkg -l | grep -E 'nodejs|npm' returns nothing
I saved setup_6.x locally, then ran:
sudo bash -xe setup_6.x
The output seems to show a 404:
## Installing the NodeSource Node.js v6.x repo...
## Populating apt-get cache...
+ apt-get update
Hit:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu xenial-backports InRelease
Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Ign:5 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial InRelease
Hit:6 http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu xenial InRelease
Ign:7 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial Release
Ign:8 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main amd64 Packages
Ign:9 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main all Packages
Ign:10 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main Translation-en_US
Ign:11 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main Translation-en
Ign:8 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main amd64 Packages
Ign:9 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main all Packages
Ign:10 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main Translation-en_US
Ign:11 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main Translation-en
Ign:8 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main amd64 Packages
Ign:9 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main all Packages
Ign:10 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main Translation-en_US
Ign:11 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main Translation-en
Ign:8 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main amd64 Packages
Ign:9 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main all Packages
Ign:10 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main Translation-en_US
Ign:11 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main Translation-en
Ign:8 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main amd64 Packages
Ign:9 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main all Packages
Ign:10 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main Translation-en_US
Ign:11 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main Translation-en
Err:8 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main amd64 Packages
404 Not Found
Ign:9 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main all Packages
Ign:10 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main Translation-en_US
Ign:11 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main Translation-en
Fetched 102 kB in 2s (45.4 kB/s)
Reading package lists...
Error executing command, exiting
That is a problem in your apt setup, somehow. The 404 error is coming from trying to read the PPA:
http://ppa.launchpad.net/mc3man/trusty-media/ubuntu
I am immediately suspicious because the PPA pathname indicates Ubuntu Trusty, but it's looking for a Ubuntu Xenial repository.
But, whatever is happening here, it is happening before apt ever reads anything from the NodeSource repository, as you can see since the string "nodesource" doesn't appear anywhere in the above output.
@chrislea
I have the same issue with linux mint 18.3 You have perfectly explained why it happens but could you please advise how can I fix it?
@Rim-777 In my case, it was a problem with the package manager. Fixed it by removing broken PPAs: https://stackoverflow.com/questions/48691220/error-executing-command-exiting-error-upon-installation-of-nodejs
Most helpful comment
I don't know how "there is no bug to report here". The reproduction steps are clear: Just run
on any Ubuntu 16.04 LTS and you get node 4.26 installed instead of v6.
The console doesn't output any error or whatsoever, the output suggests everything is normal but eventually v4 gets installed.
The output of the script:
Is that not enough? What else are users supposed to provide here. Of course the answer just says "the installer script didn't do what it's supposed to do", because it reports everything is normal and then boom, nothing works!
Why doesn't somebody from the nodesource team actually try it out on Ubuntu 16.04 LTS and see if they can reproduce the issue as described instead of just closing the issue without even looking at it? The question is upvoted 17 times on StackExchange. I and the OP are certainly not the only ones impacted by it. It's not like 17 people just pop out of nowhere upvoting posts for fun. This is a quite insidious issue, since no error message is ever shown, a user might well expect Node v6 to be installed, only to face a load of issues later on. And I don't believe users of Ubuntu 16.04 LTS to be exactly a minority either.