From fa629c307c31d7b9793b9b2137a67ca71190ce8a 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile.non_root b/docker/Dockerfile.non_root index 1cf6c0dfd1..bf1af9ed75 100644 --- a/docker/Dockerfile.non_root +++ b/docker/Dockerfile.non_root @@ -46,7 +46,10 @@ ENV LITELLM_NON_ROOT=true # package-lock.json with pinned versions + integrity hashes. RUN mkdir -p /var/lib/litellm/ui && \ mv /app/.npmrc /app/.npmrc.bak && \ - npm install -g npm@11.12.1 && npm cache clean --force && \ + 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; \