So I can't get to install npm in alpine linux. I thought perhaps I can just do a apk add npm but apparently apk search npm returns 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 npm
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 nodejs would still require a sudo apt-get install npm (which installs development packages e.g. gcc)


Here's what I ran: apk add nodejs=6.11.2-r0 nodejs-npm=6.11.2-r0 --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main/ --allow-untrusted
– Anton Babushkin Aug 22 '17 at 23:53nodejs-npmon https://pkgs.alpinelinux.org/packages. There isnpmpackage which also does the job. Is it some kind of alias? – Tad Lispy Jul 25 '18 at 14:28https://pkgs.alpinelinux.org/package/v3.14/main/x86_64/npm
– BotanMan Jul 07 '21 at 09:33