Npm issue during deployment of holos-relay-server with docker #3

Closed
opened 2026-01-20 11:28:04 +00:00 by mat · 1 comment
mat commented 2026-01-20 11:28:04 +00:00 (Migrated from codeberg.org)

I am running into an issue during the deployment of the server.
I found and fixed to small things:

  1. .env.docker shall be enhanced with two more variable:

    # Security
    JWT_SECRET=change-me-in-production-use-long-random-string
    ENCRYPTION_KEY=long-encryption-key <- needs to be added
    ADMIN_PASSWORD=adminpassword <- needs to be added
    
  2. Exporting the variable with export $(cat .env.docker | xargs) was leading to error on by side:
    Solution: export $(grep -v '^#' .env.docker | grep -v '^$' | xargs)

  3. Finally docker compose up -d leads to npm error, with which I am not familiar:

$ docker compose up -d
[+] Building 1.8s (14/20)                                                                                                                        
 => [internal] load local bake definitions                                                                                                  0.0s
 => => reading from stdin 556B                                                                                                              0.0s
 => [internal] load build definition from Dockerfile                                                                                        0.0s
 => => transferring dockerfile: 1.13kB                                                                                                      0.0s
 => [internal] load metadata for docker.io/library/node:22-alpine                                                                           0.0s
 => [internal] load .dockerignore                                                                                                           0.0s
 => => transferring context: 435B                                                                                                           0.0s
 => [builder 1/7] FROM docker.io/library/node:22-alpine                                                                                     0.0s
 => [internal] load build context                                                                                                           0.0s
 => => transferring context: 24.18kB                                                                                                        0.0s
 => CACHED [builder 2/7] RUN apk add --no-cache python3 make g++                                                                            0.0s
 => [builder 3/7] WORKDIR /app                                                                                                              0.1s
 => CACHED [stage-1 2/9] RUN apk add --no-cache tini                                                                                        0.0s
 => CACHED [stage-1 3/9] WORKDIR /app                                                                                                       0.0s
 => CACHED [stage-1 4/9] COPY package*.json ./                                                                                              0.0s
 => ERROR [stage-1 5/9] RUN npm ci --only=production                                                                                        1.5s
 => [builder 4/7] COPY package*.json ./                                                                                                     0.1s
 => CANCELED [builder 5/7] RUN npm ci                                                                                                       1.3s
------                                                                                                                                           
 > [stage-1 5/9] RUN npm ci --only=production:                                                                                                   
0.408 npm warn config only Use `--omit=dev` to omit dev dependencies from the install.
1.330 npm error code EUSAGE
1.330 npm error
1.330 npm error `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
1.330 npm error
1.330 npm error Invalid: lock file's picomatch@2.3.1 does not satisfy picomatch@4.0.3
1.330 npm error Missing: picomatch@2.3.1 from lock file
1.330 npm error Missing: picomatch@2.3.1 from lock file
1.330 npm error
1.330 npm error Clean install a project
1.330 npm error
1.330 npm error Usage:
1.330 npm error npm ci
1.330 npm error
1.330 npm error Options:
1.330 npm error [--install-strategy <hoisted|nested|shallow|linked>] [--legacy-bundling]
1.330 npm error [--global-style] [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
1.330 npm error [--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]]
1.330 npm error [--strict-peer-deps] [--foreground-scripts] [--ignore-scripts] [--no-audit]
1.330 npm error [--no-bin-links] [--no-fund] [--dry-run]
1.330 npm error [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
1.330 npm error [-ws|--workspaces] [--include-workspace-root] [--install-links]
1.330 npm error
1.330 npm error aliases: clean-install, ic, install-clean, isntall-clean
1.330 npm error
1.330 npm error Run "npm help ci" for more info
1.332 npm notice
1.332 npm notice New major version of npm available! 10.9.4 -> 11.7.0
1.332 npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.7.0
1.332 npm notice To update run: npm install -g npm@11.7.0
1.332 npm notice
1.332 npm error A complete log of this run can be found in: /root/.npm/_logs/2026-01-20T11_20_14_201Z-debug-0.log
------
[+] up 0/1
 ⠙ Image holos-relay-server-relay Building                                                                                                  1.9s 
Dockerfile:33

--------------------

  31 |     

  32 |     # Install production dependencies only

  33 | >>> RUN npm ci --only=production

  34 |     

  35 |     # Copy built files from builder

--------------------

failed to solve: process "/bin/sh -c npm ci --only=production" did not complete successfully: exit code: 1

Any ideas how to fix the npm issue, or can you update the necessary files on your side?

I am running into an issue during the deployment of the server. I found and fixed to small things: 1. .env.docker shall be enhanced with two more variable: ``` # Security JWT_SECRET=change-me-in-production-use-long-random-string ENCRYPTION_KEY=long-encryption-key <- needs to be added ADMIN_PASSWORD=adminpassword <- needs to be added ``` 2. Exporting the variable with `export $(cat .env.docker | xargs) `was leading to error on by side: Solution: `export $(grep -v '^#' .env.docker | grep -v '^$' | xargs)` 3. Finally docker compose up -d leads to npm error, with which I am not familiar: ``` $ docker compose up -d [+] Building 1.8s (14/20) => [internal] load local bake definitions 0.0s => => reading from stdin 556B 0.0s => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 1.13kB 0.0s => [internal] load metadata for docker.io/library/node:22-alpine 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 435B 0.0s => [builder 1/7] FROM docker.io/library/node:22-alpine 0.0s => [internal] load build context 0.0s => => transferring context: 24.18kB 0.0s => CACHED [builder 2/7] RUN apk add --no-cache python3 make g++ 0.0s => [builder 3/7] WORKDIR /app 0.1s => CACHED [stage-1 2/9] RUN apk add --no-cache tini 0.0s => CACHED [stage-1 3/9] WORKDIR /app 0.0s => CACHED [stage-1 4/9] COPY package*.json ./ 0.0s => ERROR [stage-1 5/9] RUN npm ci --only=production 1.5s => [builder 4/7] COPY package*.json ./ 0.1s => CANCELED [builder 5/7] RUN npm ci 1.3s ------ > [stage-1 5/9] RUN npm ci --only=production: 0.408 npm warn config only Use `--omit=dev` to omit dev dependencies from the install. 1.330 npm error code EUSAGE 1.330 npm error 1.330 npm error `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing. 1.330 npm error 1.330 npm error Invalid: lock file's picomatch@2.3.1 does not satisfy picomatch@4.0.3 1.330 npm error Missing: picomatch@2.3.1 from lock file 1.330 npm error Missing: picomatch@2.3.1 from lock file 1.330 npm error 1.330 npm error Clean install a project 1.330 npm error 1.330 npm error Usage: 1.330 npm error npm ci 1.330 npm error 1.330 npm error Options: 1.330 npm error [--install-strategy <hoisted|nested|shallow|linked>] [--legacy-bundling] 1.330 npm error [--global-style] [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]] 1.330 npm error [--include <prod|dev|optional|peer> [--include <prod|dev|optional|peer> ...]] 1.330 npm error [--strict-peer-deps] [--foreground-scripts] [--ignore-scripts] [--no-audit] 1.330 npm error [--no-bin-links] [--no-fund] [--dry-run] 1.330 npm error [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]] 1.330 npm error [-ws|--workspaces] [--include-workspace-root] [--install-links] 1.330 npm error 1.330 npm error aliases: clean-install, ic, install-clean, isntall-clean 1.330 npm error 1.330 npm error Run "npm help ci" for more info 1.332 npm notice 1.332 npm notice New major version of npm available! 10.9.4 -> 11.7.0 1.332 npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.7.0 1.332 npm notice To update run: npm install -g npm@11.7.0 1.332 npm notice 1.332 npm error A complete log of this run can be found in: /root/.npm/_logs/2026-01-20T11_20_14_201Z-debug-0.log ------ [+] up 0/1 ⠙ Image holos-relay-server-relay Building 1.9s Dockerfile:33 -------------------- 31 | 32 | # Install production dependencies only 33 | >>> RUN npm ci --only=production 34 | 35 | # Copy built files from builder -------------------- failed to solve: process "/bin/sh -c npm ci --only=production" did not complete successfully: exit code: 1 ``` Any ideas how to fix the npm issue, or can you update the necessary files on your side?
tom79 commented 2026-01-20 15:48:04 +00:00 (Migrated from codeberg.org)

Just pushed a fix, please pull the latest changes and try again.

Just pushed a fix, please pull the latest changes and try again.
Sign in to join this conversation.
No description provided.