Skip to content

Commit 0837d45

Browse files
Bulat Yapparovclaude
andcommitted
fix: activate pinned npm via corepack in publish workflow
The publish workflow has been silently failing since v0.3.1 (2026-04-03) with MODULE_NOT_FOUND: promise-retry during `npm install -g npm@latest`. Root cause: the self-upgrade path on the runner's prebuilt npm tree leaves @npmcli/arborist's dependency graph half-replaced and the new binary crashes on first invocation. Symptoms confirmed today while trying to publish v0.3.2 — both v0.3.1 and v0.3.2 tags exist on GitHub but neither version is actually on npm; `npm view @aictrl/cli versions` tops out at 0.3.0. This is why the optionalDependencies pinning fix from #46 hadn't reached users. Switching to corepack sidesteps the failure mechanism entirely: corepack ships with Node 22, installs to its own shim directory, and doesn't touch the bundled npm tree. Pinning to 11.5.2 (minimum OIDC trusted publishing support + 2 patch releases to shake out regressions) instead of tracking a moving `@latest` target. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent 02d828f commit 0837d45

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

‎.github/workflows/publish.yml‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,21 @@ jobs:
2121
with:
2222
node-version: 22
2323

24-
- name: Upgrade npm for OIDC trusted publishing
25-
run: npm install -g npm@latest
24+
- name: Activate pinned npm via corepack for OIDC trusted publishing
25+
# npm's OIDC trusted publishing support requires npm >= 11.5.0, but the
26+
# runner's bundled npm (10.9.x) is older. Previously this step ran
27+
# `npm install -g npm@latest`, which self-corrupted on the runner's
28+
# prebuilt tree and produced MODULE_NOT_FOUND for promise-retry —
29+
# silently breaking every release since v0.3.1.
30+
#
31+
# Corepack ships with Node 22 and installs package managers to its
32+
# own shim directory, sidestepping the self-upgrade corruption path
33+
# entirely. Pinning to a specific version stops tracking a moving
34+
# target that has historically shipped regressions.
35+
run: |
36+
corepack enable
37+
corepack prepare [email protected] --activate
38+
npm --version
2639
2740
- name: Install dependencies
2841
run: bun install

0 commit comments

Comments
 (0)