From 91a07eeda61e46ce5d6c42fa51054883b1e60c56 Mon Sep 17 00:00:00 2001 From: Danny Date: Mon, 4 May 2026 20:54:53 +0100 Subject: [PATCH] improving error --- src/install-pnpm/run.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/install-pnpm/run.ts b/src/install-pnpm/run.ts index edfb4e4..4dfd80b 100644 --- a/src/install-pnpm/run.ts +++ b/src/install-pnpm/run.ts @@ -127,11 +127,14 @@ function readTargetVersion(opts: { const definedVersions = new Set([version, packageManagerVersion, devEnginesVersion].filter(v => !!v)) if (definedVersions.size > 1) { + const lines = [ + version && `- version ${version} in the GitHub Action config with the key "version"`, + packageManagerVersion && `- version ${packageManagerVersion} in the package.json with the key "packageManager"`, + devEnginesVersion && `- version ${devEnginesVersion} in the package.json with the key "devEngines.packageManager"`, + ].filter(Boolean).join('\n') throw new Error(`Multiple conflicting pnpm versions specified: - - version ${version ?? "undefined"} in the GitHub Action config with the key "version" - - version ${packageManagerVersion ?? "undefined"} in the package.json with the key "packageManager" - - version ${devEnginesVersion ?? "undefined"} in the package.json with the key "devEngines.packageManager" - Remove conflicting versions to avoid version mismatch errors like ERR_PNPM_BAD_PM_VERSION`) + ${lines} + Remove conflicting versions to avoid version mismatch errors like ERR_PNPM_BAD_PM_VERSION`) } if (definedVersions.size === 0) {