Error while building openmrs-distro-referenceapplication

Running this command while building the openmrs-distro-referenceapplication **docker compose build** leads to the error below.

=> ERROR [frontend dev 6/8] RUN npx --legacy-peer-deps openmrs@next assemble --m 256.5s

failed to solve: process “/bin/sh -c npx --legacy-peer-deps openmrs@${APP_SHELL_VERSION:-n ext} assemble --manifest --mode config --config spa-assemble-config.json --target ./spa” d id not complete successfully: exit code: 1

I have just successfully run the same command. What versions of node and npm do you have?

I have tried with node v22.13.1 and npm 11.1.0 also tried with v18.20.6 (npm v10.8.2) still got the same error.

Docker version 27.5.1, build 9f9e405 and Docker Compose version v2.32.4

OS

NAME=“Ubuntu” VERSION_ID=“24.04” VERSION=“24.04.1 LTS (Noble Numbat)”

Updating the solution for this issue on second encounter as it may help someone out there; It is probably a problem that is occurring due to the internet proxy settings (whose influence is but plausible) and/or the DNS servers configured with my/your internet connection.

If I configure 8.8.8.8 for my DNS, everything works fine. If using Docker, painless fix is to create the file /etc/docker/daemon.json and insert the lines below.

{
    "dns": ["10.0.0.2", "8.8.8.8"]
}

Where 10.0.0.2 is the first DNS server your machine requests records from, and 8.8.8.8 is the fallback DNS server, google in this case.

Restart docker and run the build command again.

sudo systemctl stop docker

sudo systemctl start docker

sudo systemctl status docker
2 Likes