mirror of
https://github.com/pnpm/action-setup.git
synced 2026-05-15 06:43:32 +08:00
fix: honor devEngines.packageManager.onFail=error (#252)
Export pnpm_config_pm_on_fail=download so the bootstrap pnpm switches to the version pinned in devEngines.packageManager instead of throwing BAD_PM_VERSION on the user's first invocation.
This commit is contained in:
@@ -67,6 +67,11 @@ export async function runSelfInstaller(inputs: Inputs): Promise<SelfInstallerRes
|
||||
addPath(pnpmHome)
|
||||
addPath(path.join(pnpmHome, 'bin'))
|
||||
exportVariable('PNPM_HOME', pnpmHome)
|
||||
// Force pnpm to honor manage-package-manager-versions even when the project
|
||||
// pins `devEngines.packageManager.onFail = "error"`. Without this override
|
||||
// the bootstrap pnpm errors with BAD_PM_VERSION instead of switching to the
|
||||
// requested version on the user's first invocation (issue #252).
|
||||
exportVariable('pnpm_config_pm_on_fail', 'download')
|
||||
|
||||
// Ensure pnpm bin link exists — npm ci sometimes doesn't create it
|
||||
if (process.platform !== 'win32') {
|
||||
|
||||
Reference in New Issue
Block a user