DashboardsupersetSession 071H9JFSqXXn

Session 071H9JFSqXXn

Full ID: 071H9JFSqXXnSLahg
Messages: 15
Distillations: 0
Time range: 2026-05-18 20:56:00 — 2026-05-18 20:56:57

Conversation (15 messages)

I need to understand why npm install -g npm@latest might be failing in a GitHub Actions workflow running on ubuntu-latest with Node.js 22 (set up via actions/setup-node@v4).

Research the following:

  1. Check what version of npm ships with Node.js 22 — look at https://nodejs.org/en/download or release notes
  2. Check if there are known issues with npm install -g npm@latest on recent Node.js versions in GitHub Actions
  3. Check if npm 11+ has any breaking changes that would cause npm install -g npm@latest to fail (npm 11 was released in early 2025)
  4. Check if corepack or package manager settings in the runner could interfere
  5. The package.json has "packageManager": "pnpm@10.28.0" — check if corepack being enabled could cause npm install -g to fail because it would try to enforce pnpm instead

The specific error from the GitHub Actions run is: "Process completed with exit code 1" on the step named "Upgrade npm for OIDC trusted publishing" which runs:

npm install -g npm@latest
npm --version

The workflow uses actions/setup-node@v4 with node-version: 22.

Note: The package.json contains "packageManager": "pnpm@10.28.0" which means corepack may intercept npm commands.

Return your findings about the most likely cause of the failure.

gateway · 2026-05-18 20:56:00

I'll research this systematically. Let me gather information from multiple sources in parallel.

claude-opus-4-6 · 2026-05-18 20:56:01 · ~33 tokens

[tool results provided]

gateway · 2026-05-18 20:56:08

Let me dig deeper into the specific issues — corepack interaction with packageManager field, and npm 11 breaking changes.

claude-opus-4-6 · 2026-05-18 20:56:08 · ~41 tokens

[tool results provided]

gateway · 2026-05-18 20:56:14

Now let me search for the specific corepack + npm interaction issue and check the actions/setup-node behavior regarding corepack:

claude-opus-4-6 · 2026-05-18 20:56:14 · ~44 tokens

[tool results provided]

gateway · 2026-05-18 20:56:19

Now let me look at the exact corepack issue #690 which is precisely about npm global install being blocked in pnpm projects:

claude-opus-4-6 · 2026-05-18 20:56:19 · ~42 tokens

[tool results provided]

gateway · 2026-05-18 20:56:23

I now have all the evidence I need. Let me also quickly check the exact workflow file to understand the context better:

claude-opus-4-6 · 2026-05-18 20:56:23 · ~40 tokens

[tool results provided]

gateway · 2026-05-18 20:56:28

[tool results provided]

gateway · 2026-05-18 20:56:32

Let me check the full workflow context around that step:

claude-opus-4-6 · 2026-05-18 20:56:32 · ~20 tokens

[tool results provided]

gateway · 2026-05-18 20:56:57

Now I have the complete picture. Here are my findings:


Root Cause: Corepack blocks npm install -g because packageManager is set to pnpm

This is a known bug filed as nodejs/corepack#690 — "npm global install / uninstall blocked in yarn/pnpm project if npm enabled".

The chain of events

  1. actions/setup-node@v4 with node-version: 22 installs Node.js 22.x, which ships with Corepack bundled (up to but not including Node.js 25, where it's removed).

  2. Node.js 22.22.x ships with Corepack 0.34.6 and npm 10.9.8 (from the changelog). Corepack is included but historically disabled by default — however, recent Node.js 22 versions have increasingly active corepack behavior when it detects a packageManager field.

  3. Your package.json declares "packageManager": "pnpm@10.28.0" (package.json:6). When Corepack is enabled (or when its shims are active), it reads this field and enforces that only pnpm should be used as the package manager for this project.

  4. When npm install -g npm@latest runs, Corepack intercepts the npm command. Even though this is a global install (-g), Corepack still checks the local package.json, finds "packageManager": "pnpm@10.28.0", and refuses to run npm with an error like:

    This project is configured to use pnpm because /path/to/package.json has a "packageManager" field

  5. The step fails with exit code 1.

Why it may have started failing recently

  • Corepack was updated in Node.js 22.x LTS from 0.31.x to 0.34.6 across recent patch releases. Newer versions of Corepack are stricter about enforcing the packageManager field.
  • The ubuntu-latest runner image may have started enabling corepack or the shims may be present on PATH from the actions/setup-node installation. ...
claude-opus-4-6 · 2026-05-18 20:56:57 · ~1.2K tokens