3

I have this:

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

but I get:

E: Version '11' for 'nodejs' was not found

I also tried:

RUN apt-get install -y nodejs=11*

does anyone know how I can find out which versions are available? The problem is that node version 12 is already installed on this machine and I want to downgrade the Node.js version here.

0

3 Answers 3

2

Because 12 is already installed, I had to do this:

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

just drop that =11 part. Like this:

sudo apt install nodejs

and

node -v
v11.15.0

The reason is that first curl command installs the repository which replaces apt's pointer for nodejs - so no need to specify the version.

2
  • see my answer, I had to remove the previous version Aug 29, 2019 at 22:05
  • This does not answer the question, as a specific version was requested. Dec 30, 2019 at 9:04
0

try like this:

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

sudo apt-get install -y nodejs

the only problem that I see is the "nodejs=11" in the apt-get, that should do it.

You can find the versions here: https://github.com/nodesource/distributions/blob/master/README.md

The stable version is currently the 10.x

2
  • see my answer, I had to remove the previous version Aug 29, 2019 at 22:04
  • Oh sorry, glad you managed to solve it!
    – Raphael
    Aug 31, 2019 at 1:08

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