Azure-functions-core-tools: Default node Dockerfile fails to build on azure-functions-core-tools@3: npm not found

Created on 8 Jan 2020  路  7Comments  路  Source: Azure/azure-functions-core-tools

Building the default docker image fails with the error npm: not found.

How to reproduce:

  1. $ npm install -g azure-functions-core-tools@3
  2. $ mkdir my-test; cd my-test
  3. $ func init --worker-runtime node --docker --language javascript
  4. $ 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 :)

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-node12 the npm step didn't fail

All 7 comments

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
Was this page helpful?
0 / 5 - 0 ratings