Distributions: Unable to install nodejs 8.x/9.x on Debian 10 "buster"

Created on 11 Jul 2019  路  6Comments  路  Source: nodesource/distributions

I just setup a machine with Debian 10 and run the following commands:

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

To my surprise nodejs -v returned v10.15.2. I get the same version if I install from the setup_9.x link.

I tried the rest of the links and they install the correct version:

setup_10.x - v10.16.0
setup_11.x - v11.15.0
setup_12.x - v12.6.0

How come setup_8.x and setup_9.x install nodejs 10.x? Thanks!

Most helpful comment

How come setup_8.x and setup_9.x install nodejs 10.x? Thanks!

because debian/buster include nodejs v10.15 while debian/stretch only provided a v4.8, since it's the same package name and the version is lower apt will install the distribution package.

You will need a preference file to override priority or you can manually specifiy the version:

apt install nodejs=8.16.0-1nodesource1

All 6 comments

Found a solution here that worked for me.

Found a solution here that worked for me.

That not works for me.
For me, it is still not working. I set up the configuration on the /etc/apt/preferences.d/nodesource file as pnedkov say here, then the downloaded script went wrong. The problem is somehow the URL wrong. There are one more ' on the end of the URL, therefore the install script not found the correct site.
The scirp URL recgnized somehow to
https://deb.nodesource.com/node_8.x/dists/buster/Release'
instead the good
https://deb.nodesource.com/node_8.x/dists/buster/Release

The script running:
$ curl -sL https://deb.nodesource.com/setup_8.x | bash -

## Installing the NodeSource Node.js 8.x LTS Carbon repo...

## Populating apt-get cache...

+ apt-get update
Hit:1 https://deb.nodesource.com/node_10.x stretch InRelease
Hit:2 http://packages.microsoft.com/repos/vscode stable InRelease
Hit:3 http://cdn-fastly.deb.debian.org/debian stable InRelease
Hit:4 http://cdn-fastly.deb.debian.org/debian stable-updates InRelease
Hit:5 http://cdn-fastly.deb.debian.org/debian-security stable/updates InRelease
Hit:7 http://cran.rstudio.com/bin/linux/debian stretch-cran34/ InRelease
Hit:6 https://cli-assets.heroku.com/apt ./ InRelease
Hit:8 https://download.docker.com/linux/debian buster InRelease
Reading package lists... Done

## Confirming "buster" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_8.x/dists/buster/Release'

## Your distribution, identified as "buster", is not currently supported, please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your distribution to be considered for support

System:
Operating System: Debian GNU/Linux 10 (buster)
Kernel: Linux 4.19.0-5-amd64
Architecture: x86-64

Can confirm that the issue is still open.

See #875 for a workaround.

How come setup_8.x and setup_9.x install nodejs 10.x? Thanks!

because debian/buster include nodejs v10.15 while debian/stretch only provided a v4.8, since it's the same package name and the version is lower apt will install the distribution package.

You will need a preference file to override priority or you can manually specifiy the version:

apt install nodejs=8.16.0-1nodesource1

curl -sL "https://deb.nodesource.com/setup_${NODE_VERSION}" | bash -
To get the versions.

apt-get install -y --allow-downgrades nodejs=8.16.1-1nodesource1
To install the specific version.
Note; it's now 8.16.1-1nodesource1 instead of 8.16.0-1nodesource1
Because of course it is.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xNarkon picture xNarkon  路  3Comments

christalk picture christalk  路  5Comments

timofey-retailnext picture timofey-retailnext  路  5Comments

muhhizbe picture muhhizbe  路  6Comments

ErisDS picture ErisDS  路  5Comments