Build Error npm version

Hello, I have an error when an build.

I have this error: New minor version of npm available! 7.0.15 -> 7.1.2 but I have already the version 7.1.2 of npm.

Do you know why he say I doesn’t have the version of npm ?

I usually get this error on Windows.
The solution is to add a working directory in your Dockerfile.

This issue is happening due to changes in nodejs starting version 15. When no WORKDIR is specified, npm install is executed in the root directory of the container, which is resulting in this error. Executing the npm install in a project directory of the container specified by WORKDIR resolves the issue.

example: in your Dockerfile

  1. FROM node:alpine
  2. WORKDIR /usr/app

that should fix the error.