From 063ce1a37517f8037eeeaf318e22a2bc7b2f285a Mon Sep 17 00:00:00 2001 From: Amir Fathi Date: Wed, 9 Sep 2026 21:36:12 +0000 Subject: [PATCH] fix(docker): work around npm 10.x's arborist crash in the TS builders The builder stage's npm install crashes on all four TS servers with "Cannot read properties of null (reading 'edgesOut')", reproduced on unmodified main with a fully cleared build cache. Bisected past the issue's own finding: plain vitest alone triggers it, in an otherwise empty package.json, so it isn't specific to this repo's dependency graph. It's an npm 10.x arborist bug; npm 11.19.1 resolves the same package.json with no errors and no extra flags. release.yml already upgrades past this for a different reason (OIDC trusted publishing needs npm >=11.5.1, and node 22's bundled npm is 10.x). Do the same in each builder stage before npm install. Confirmed npm 10.9.x in the release stage still reads a lockfile that npm 11 wrote with npm ci, so nothing downstream needs to change. Verified with docker buildx build --no-cache for all four servers: fails on unmodified main with the issue's exact error, builds clean on this branch. Ran each built image through a real MCP initialize handshake over stdio to confirm it still starts and responds. Fixes #4782 --- src/everything/Dockerfile | 2 ++ src/filesystem/Dockerfile | 2 ++ src/memory/Dockerfile | 2 ++ src/sequentialthinking/Dockerfile | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/everything/Dockerfile b/src/everything/Dockerfile index 6729298b06..eff822d61c 100644 --- a/src/everything/Dockerfile +++ b/src/everything/Dockerfile @@ -5,6 +5,8 @@ COPY tsconfig.json /tsconfig.json WORKDIR /app +RUN npm install -g npm@^11.5.1 + RUN --mount=type=cache,target=/root/.npm npm install FROM node:22-alpine AS release diff --git a/src/filesystem/Dockerfile b/src/filesystem/Dockerfile index 418b140056..f87e58c02f 100644 --- a/src/filesystem/Dockerfile +++ b/src/filesystem/Dockerfile @@ -5,6 +5,8 @@ WORKDIR /app COPY src/filesystem /app COPY tsconfig.json /tsconfig.json +RUN npm install -g npm@^11.5.1 + RUN --mount=type=cache,target=/root/.npm npm install RUN --mount=type=cache,target=/root/.npm-production npm ci --ignore-scripts --omit-dev diff --git a/src/memory/Dockerfile b/src/memory/Dockerfile index 2f85d0cfa2..ce23649b88 100644 --- a/src/memory/Dockerfile +++ b/src/memory/Dockerfile @@ -5,6 +5,8 @@ COPY tsconfig.json /tsconfig.json WORKDIR /app +RUN npm install -g npm@^11.5.1 + RUN --mount=type=cache,target=/root/.npm npm install RUN --mount=type=cache,target=/root/.npm-production npm ci --ignore-scripts --omit-dev diff --git a/src/sequentialthinking/Dockerfile b/src/sequentialthinking/Dockerfile index f1a88195bc..e4846749d8 100644 --- a/src/sequentialthinking/Dockerfile +++ b/src/sequentialthinking/Dockerfile @@ -5,6 +5,8 @@ COPY tsconfig.json /tsconfig.json WORKDIR /app +RUN npm install -g npm@^11.5.1 + RUN --mount=type=cache,target=/root/.npm npm install RUN --mount=type=cache,target=/root/.npm-production npm ci --ignore-scripts --omit-dev