=> CANCELED [client-build 1/1] RUN npm run build ; => ERROR [test 1/1] RUN npm run test Docker Build
18:20 11 Jun 2026

I am new to Docker following this tutorial to build and push my first Docker image. When I run this command to build a Docker image:

docker build -t DOCKER_USERNAME/getting-started-todo-app .

I get this error:

 => CANCELED [client-build 1/1] RUN npm run build                                                                                                                 10.2s  => ERROR [test 1/1] RUN npm run test                                                                                                                              8.9s

some more stack trace:

------
Dockerfile:73
--------------------
  71 |     ###################################################
  72 |     FROM backend-dev AS test
  73 | >>> RUN npm run test
  74 |
  75 |     ###################################################
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c npm run test" did not complete successfully: exit code: 1

full stack trace can be found here and Dockerfile

docker npm docker-build