mirror of
https://github.com/pnpm/action-setup.git
synced 2026-06-23 12:27:45 +00:00
improving error
This commit is contained in:
parent
da754f8c6b
commit
91a07eeda6
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user