fix: run bootstrap pnpm via node instead of bin shim

Use `node .../pnpm/bin/pnpm.cjs` to run the bootstrap pnpm, matching
the approach used by the old bundled pnpm.cjs. This avoids issues with
the .bin symlink on different platforms.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Zoltan Kochan
2026-03-16 02:15:16 +01:00
parent 9fbc6cd1d1
commit 49b8837b49
2 changed files with 4 additions and 4 deletions

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -27,7 +27,7 @@ export async function runSelfInstaller(inputs: Inputs): Promise<number> {
return npmExitCode
}
const bootstrapPnpm = path.join(bootstrapDir, 'node_modules', '.bin', 'pnpm')
const bootstrapPnpm = path.join(bootstrapDir, 'node_modules', 'pnpm', 'bin', 'pnpm.cjs')
// Step 2: Use bootstrap pnpm to install the target version (verified via project's pnpm-lock.yaml)
await rm(dest, { recursive: true, force: true })
@@ -47,8 +47,8 @@ export async function runSelfInstaller(inputs: Inputs): Promise<number> {
// prepare target pnpm
const target = await readTarget({ version, packageJsonFile, standalone })
const installArgs = ['install', target, '--no-lockfile']
const exitCode = await runCommand(bootstrapPnpm, installArgs, { cwd: dest })
const installArgs = [bootstrapPnpm, 'install', target, '--no-lockfile']
const exitCode = await runCommand(process.execPath, installArgs, { cwd: dest })
if (exitCode === 0) {
const pnpmHome = path.join(dest, 'node_modules/.bin')
addPath(pnpmHome)