So I can’t get to install npm in alpine linux. I thought perhaps I can just do a
apk add npmbut apparently
apk search npmreturns nothing, even after a
apk update. I’m experimenting with all this from the nginx:alpine docker image, i.e.
docker run -it nginx:alpine /bin/sh
Edit 1: I can see how the nodejs:alpine dockerfile builds
node, but I don’t understand how it builds
Edit 2: now that I know that npm gets installed with nodejs on alpine, and just for clarification, the reason this wasn’t evident to me at first is that on ubuntu 14.04 a
sudo apt-get install nodejswould still require a
sudo apt-get install npm(which installs development packages e.g.
For the recent versions of Alpine (v3.8+) the correct way to install nodejs with
apk add --update nodejs npm
npm package depends on
nodejs, so you can do:
apk add --update npm
Note: since Alpine 3.8 there is no nodejs-npm package.