1

I am new to Alpine Linux and I tried to install Node.js 4.

According to this I can specify the version like this:

apk add nodejs=4

I also tried this because I though maybe it doesn't understand semantic versions and I saw here that 4.3.0-r0 seems to be the only available version:

apk add nodejs=4.3.0-r0

Both commands lead to an error:

ERROR: unsatisfiable constraints:
  nodejs-6.2.0-r0:
    breaks: world[nodejs=4.3.0-r0]

What am I doing wrong?

2 Answers 2

2

Use this to list available packages:

apk search --update 'node*'

choose one and install it as next:

apk add nodejs-lts --update

(1/4) Installing libgcc (5.3.0-r0)
(2/4) Installing libstdc++ (5.3.0-r0)
(3/4) Installing libuv (1.9.1-r0)
(4/4) Installing nodejs-lts (4.4.4-r0)
2
  • Could you elaborate on how my assumptions were wrong? Commented Nov 11, 2016 at 16:52
  • It’s named nodejs-lts only in v3.4, it’s just nodejs in further versions or nodejs-current for the “current” version (that’s the upstream’s terminology, it’s non-LTS version). Commented Sep 23, 2017 at 18:31
2

Alpine is a rolling release distro. Packages for nodejs are dependent from which version of alpine you are using.

In your example, if you need nodejs-4.3x, you should use Alpine 3.3:

https://pkgs.alpinelinux.org/packages?name=nodejs&branch=&repo=&arch=&maintainer=

This because there is no way yet to install arbitrary an older versions of a package from official repositories.

A possible workaround, if it might be fitting for you, is using an lxc container, where you can specify the alpine version to use, with a small footprint on the host.

1
  • Alpine is not a rolling release distro. Only edge branch is rolling. Commented Sep 23, 2017 at 18:30

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.