mirror of
https://github.com/pnpm/action-setup.git
synced 2026-04-04 19:42:36 +08:00
fix: point pn to pnpm binary directly, not to @pnpm/exe/pn
pnpm self-update only replaces the pnpm binary — it does not update other files in the @pnpm/exe package (setup.js, pn, pnpx, pnx all remain from the v10 bootstrap). So @pnpm/exe/pn may not exist at all. Instead of relying on @pnpm/exe/pn, create the aliases directly: - pn → symlink to the pnpm binary - pnpx/pnx → shell scripts that exec "pnpm dlx" Also remove the setup.js call after self-update since it's no longer needed and would run the v10 version which doesn't know about pn.
This commit is contained in:
@@ -59,17 +59,6 @@ export async function runSelfInstaller(inputs: Inputs): Promise<number> {
|
||||
if (exitCode !== 0) {
|
||||
return exitCode
|
||||
}
|
||||
|
||||
// self-update replaces package files but does not re-run preinstall
|
||||
// scripts, so setup.js (which hardlinks pn/pnpx/pnx to the binary)
|
||||
// needs to be run explicitly.
|
||||
if (standalone) {
|
||||
const exeDir = path.join(dest, 'node_modules', '@pnpm', 'exe')
|
||||
const setupScript = path.join(exeDir, 'setup.js')
|
||||
if (existsSync(setupScript)) {
|
||||
await runCommand(process.execPath, [setupScript], { cwd: exeDir })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create pn/pnx alias bin links if the installed version supports them
|
||||
|
||||
Reference in New Issue
Block a user