ci(lotus): remove the cached corepack pnpm shim before installing pnpm
CI / Build embedded bundle (push) Failing after 3m33s
CI / Publish to Gitea npm registry (push) Skipped

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
This commit is contained in:
Lotus CI
2026-09-12 13:02:44 -04:00
co-authored by Claude Opus 5
parent 8945c29725
commit b6176e07dd
+18 -2
View File
@@ -56,7 +56,15 @@ jobs:
# pinned version itself. Version is read from package.json's # pinned version itself. Version is read from package.json's
# packageManager field so it cannot drift from the lockfile. # packageManager field so it cannot drift from the lockfile.
- name: Install pnpm (version from packageManager field) - 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 - name: Install dependencies
run: pnpm install --frozen-lockfile run: pnpm install --frozen-lockfile
@@ -125,7 +133,15 @@ jobs:
# pinned version itself. Version is read from package.json's # pinned version itself. Version is read from package.json's
# packageManager field so it cannot drift from the lockfile. # packageManager field so it cannot drift from the lockfile.
- name: Install pnpm (version from packageManager field) - 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 - name: Install dependencies
run: pnpm install --frozen-lockfile run: pnpm install --frozen-lockfile