ci(lotus): install pnpm directly — corepack shim breaks the matrix-js-sdk prepare
CI / Build embedded bundle (push) Failing after 1m13s
CI / Publish to Gitea npm registry (push) Skipped

Run #1854 failed in `pnpm install --frozen-lockfile`: matrix-js-sdk is a
git dependency (upstream pins matrix-org/matrix-js-sdk#develop) that pnpm
must build from source, and that source's devEngines pins pnpm 11.9.0.
Under `corepack enable` the nested `pnpm install` runs the 11.21.0 shim,
which refuses to switch versions ("pnpm does not switch versions when
running under corepack") and the prepare step aborts. Reproduced locally
with a fresh store; with a real pnpm binary the nested install downloads
11.9.0 itself and succeeds.

Both jobs now `npm install -g pnpm@<version>` with the version read from
package.json's packageManager field.

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 12:09:46 -04:00
co-authored by Claude Opus 5
parent 9c52146312
commit 8945c29725
+18 -4
View File
@@ -48,8 +48,15 @@ jobs:
registry-url: "https://code.lotusguild.org/api/packages/LotusGuild/npm/"
scope: "@lotusguild"
- name: Enable corepack (pnpm from packageManager field)
run: corepack enable
# pnpm is installed directly (NOT via `corepack enable`): matrix-js-sdk
# is a git dependency that pnpm has to build from source, and its own
# devEngines pins a different pnpm (11.9.0). A corepack-shimmed pnpm
# refuses to switch versions for that nested install and the whole
# `pnpm install` fails (run #1854); a real pnpm binary downloads the
# 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]")"
- name: Install dependencies
run: pnpm install --frozen-lockfile
@@ -110,8 +117,15 @@ jobs:
registry-url: "https://code.lotusguild.org/api/packages/LotusGuild/npm/"
scope: "@lotusguild"
- name: Enable corepack
run: corepack enable
# pnpm is installed directly (NOT via `corepack enable`): matrix-js-sdk
# is a git dependency that pnpm has to build from source, and its own
# devEngines pins a different pnpm (11.9.0). A corepack-shimmed pnpm
# refuses to switch versions for that nested install and the whole
# `pnpm install` fails (run #1854); a real pnpm binary downloads the
# 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]")"
- name: Install dependencies
run: pnpm install --frozen-lockfile