Repository navigation
Description
Summary
On v6.0.9, any packageManager other than the bootstrap's own 11.7.0 makes the internal pnpm self-update emit:
[WARN] Detected a pnpm v10 installation layout at PNPM_HOME. The pnpm shims at
PNPM_HOME have been refreshed so the new version is active, but pnpm v11 expects
bins in PNPM_HOME/bin. Run "pnpm setup" to migrate your PATH to the v11 layout.
There is no v10 installation involved — this runs on a clean ubuntu-latest runner, in a fresh ~/setup-pnpm the action itself just created. The marker pnpm is detecting is the .bin/pnpm shim that the action's own npm ci bootstrap writes, so the check false-positives by construction on every version bump the action performs.
Nothing breaks (the action fronts PATH with PNPM_HOME/bin, and the correct version does end up active), so this is a noise/diagnosis report rather than a breakage report. It does mean every CI log carries a warning that tells users to run pnpm setup for a problem they do not have.
Reproduction
package.json — any pinned version that is not 11.7.0:
{ "packageManager": "pnpm@11.13.1" }jobs:
repro:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6.0.9
- uses: actions/setup-node@v6
with:
node-version: 24Output:
Checking for updates...
Switching pnpm from v11.7.0 to v11.13.1...
[WARN] Detected a pnpm v10 installation layout at PNPM_HOME. ...
Successfully updated pnpm to v11.13.1
Pinning packageManager to exactly 11.7.0 makes self-update a no-op and the warning disappears — which is what identifies the self-update as the trigger.
Why it fires
In src/install-pnpm/run.ts (v6.0.9), PNPM_HOME is pointed at the bootstrap's npm .bin directory:
const pnpmHome = standalone && process.platform === 'win32'
? path.join(dest, 'node_modules', '@pnpm', 'exe')
: path.join(dest, 'node_modules', '.bin')
// ... (PATH-precedence comment elided)
addPath(pnpmHome)
addPath(path.join(pnpmHome, 'bin'))
exportVariable('PNPM_HOME', pnpmHome)npm ci always links a pnpm shim into node_modules/.bin, and the action additionally guarantees one on POSIX (the pnpmBinLink symlink block just below). pnpm's self-update then treats a pnpm file sitting directly at PNPM_HOME as a reliable v10-layout marker — selfUpdate.ts:
// A fresh v11 setup never writes a `pnpm` shim at pnpmHomeDir itself — only
// under pnpmHomeDir/bin. The presence of a `pnpm` (or `pnpm.cmd`) file
// directly at pnpmHomeDir is therefore a reliable v10-layout marker.
function hasLegacyHomeDirShim (pnpmHomeDir: string): boolean {
for (const name of ['pnpm', 'pnpm.cmd']) {
if (fs.existsSync(path.join(pnpmHomeDir, name))) return true
}
return false
}That assumption holds for a real user install, but not when PNPM_HOME is an npm .bin directory: the pnpm file there is the bootstrap's own shim, not a v10 leftover. The heuristic and the action's layout choice disagree, and the action's layout is what puts a pnpm file where the heuristic looks.
Notes
standalone: truedoes not avoid it on Linux — both branches resolvepnpmHometo the samenode_modules/.bin; onlywin32 + standalonediffers.- The only workaround available to a consumer is pinning
packageManagerto the bootstrap version, which couples the project's pnpm to an action internal and breaks at the next bootstrap bump (and, wherepackageManageralso drivescorepackin a Dockerfile, changes the version that builds production images).
Possible directions
- Give the bootstrap a dedicated
PNPM_HOME(e.g.<dest>/pnpm-home) separate fromnode_modules/.bin.self-updatealready writes intoPNPM_HOME/bin, which is already onPATHvia the existingaddPath, so the resolution order that consumers rely on would not change. - Or coordinate with pnpm so the marker distinguishes an npm-managed
.binfrom a v10setuplayout.
Related, though a different cause (a genuine v10 → v11 migration where the legacy shim is never cleaned up): pnpm/pnpm#12496. Both cases lean on the same hasLegacyHomeDirShim heuristic.
Happy to open a PR for direction 1 if that is the shape you'd want.
Environment
pnpm/action-setup@v6.0.9(0ebf471)runs-on: ubuntu-latest,actions/setup-node@v6with Node 24- bootstrap pnpm
11.7.0, target pnpm11.13.1(reproduces with any target ≠ 11.7.0)
Activity