Building the default docker image fails with the error npm: not found.
How to reproduce:
$ npm install -g azure-functions-core-tools@3$ mkdir my-test; cd my-test$ func init --worker-runtime node --docker --language javascript$ docker build -t my-test .This above fails with /bin/sh: 1: npm: not found.
When adding the command RUN ls /usr/bin/n* one can see that it indeed lacks the npm executable, however the node executable is present.
When running the node installation RUN command from the base docker image (https://github.com/Azure/azure-functions-docker/blob/master/host/3.0/buster/amd64/node12.Dockerfile) directly, then all the expected executables are present. It seems that npm disappears somewhere along the way :)
That's weird. I was able to reproduce. I will take a look at it. cc: @ahmelsayed
Having same issue, for now using @2
Any workaround?
@eaguadmeat we decided to use v2 of the core tools for now.
Same issue, might fall back to v2 but that doesn't like Node v12 so it's a problem
Using this link https://mcr.microsoft.com/v2/azure-functions/node/tags/list
I looked what other tags/version of the docker image there were, when I tried the tag 3.0.13113-node12 the npm step didn't fail
@benc-uk Thank you so much!
Just in case, for someone who came here because of this issue (in my case, I followed Create a function on Linux using a custom container and encountered this problem), open Dockerfileand change the following should help you:
FROM mcr.microsoft.com/azure-functions/node:3.0
TO
FROM mcr.microsoft.com/azure-functions/node:3.0.13113-node12
Most helpful comment
Using this link https://mcr.microsoft.com/v2/azure-functions/node/tags/list
I looked what other tags/version of the docker image there were, when I tried the tag
3.0.13113-node12the npm step didn't fail