From b6176e07dd9deaab2e3beb1e4a80466df8766c09 Mon Sep 17 00:00:00 2001 From: Lotus CI Date: Sat, 12 Sep 2026 13:02:44 -0400 Subject: [PATCH] ci(lotus): remove the cached corepack pnpm shim before installing pnpm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Run #1855: `npm install -g pnpm@…` failed with EEXIST because the runner's persistent hostedtoolcache Node install still carries the corepack `pnpm` shim from earlier `corepack enable` runs, and npm won't overwrite it. Disable/remove the shim first, then install, and print the version so the log shows which pnpm actually ran. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA --- .gitea/workflows/ci.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 5637fd17..c2f70997 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -56,7 +56,15 @@ jobs: # pinned version itself. Version is read from package.json's # packageManager field so it cannot drift from the lockfile. - name: Install pnpm (version from packageManager field) - run: npm install -g "pnpm@$(node -p "require('./package.json').packageManager.split('@')[1].split('+')[0]")" + # The runner's cached Node toolchain keeps a corepack `pnpm` shim from + # earlier runs, and npm refuses to overwrite it (EEXIST, run #1855) — + # drop the shim first so the real binary lands. + run: | + B="$(dirname "$(command -v node)")" + corepack disable pnpm 2>/dev/null || true + rm -f "$B/pnpm" "$B/pnpx" + npm install -g "pnpm@$(node -p "require('./package.json').packageManager.split('@')[1].split('+')[0]")" + pnpm --version - name: Install dependencies run: pnpm install --frozen-lockfile @@ -125,7 +133,15 @@ jobs: # pinned version itself. Version is read from package.json's # packageManager field so it cannot drift from the lockfile. - name: Install pnpm (version from packageManager field) - run: npm install -g "pnpm@$(node -p "require('./package.json').packageManager.split('@')[1].split('+')[0]")" + # The runner's cached Node toolchain keeps a corepack `pnpm` shim from + # earlier runs, and npm refuses to overwrite it (EEXIST, run #1855) — + # drop the shim first so the real binary lands. + run: | + B="$(dirname "$(command -v node)")" + corepack disable pnpm 2>/dev/null || true + rm -f "$B/pnpm" "$B/pnpx" + npm install -g "pnpm@$(node -p "require('./package.json').packageManager.split('@')[1].split('+')[0]")" + pnpm --version - name: Install dependencies run: pnpm install --frozen-lockfile