From 4821102f2b00eeca2b63a0cecb7cbc071fb10a08 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Thu, 2 Apr 2026 17:29:47 -0700 Subject: [PATCH] [Fix] Dockerfile.non_root: install node-gyp for npm ci The wolfi-base npm@11.12.1 package does not bundle node-gyp, causing `npm ci` to fail with `Cannot find module 'node-gyp/bin/node-gyp.js'` when building the Admin UI in the non-root Docker image. Install node-gyp@12.2.0 globally and symlink it into npm's internal node_modules where @npmcli/run-script expects to find it. Co-Authored-By: Claude Opus 4.6 (1M context) --- docker/Dockerfile.non_root | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile.non_root b/docker/Dockerfile.non_root index db3981fb7e7..d00d34c88ac 100644 --- a/docker/Dockerfile.non_root +++ b/docker/Dockerfile.non_root @@ -42,7 +42,11 @@ ENV LITELLM_NON_ROOT=true # Build Admin UI using the upstream command order while keeping a single RUN layer RUN mkdir -p /var/lib/litellm/ui && \ - npm install -g npm@latest && npm cache clean --force && \ + mv /app/.npmrc /app/.npmrc.bak && \ + npm install -g npm@11.12.1 && \ + npm install -g node-gyp@12.2.0 && \ + ln -sf /usr/local/lib/node_modules/node-gyp /usr/lib/node_modules/npm/node_modules/node-gyp && \ + npm cache clean --force && \ cd /app/ui/litellm-dashboard && \ if [ -f "/app/enterprise/enterprise_ui/enterprise_colors.json" ]; then \ cp /app/enterprise/enterprise_ui/enterprise_colors.json ./ui_colors.json; \