pnpm / action-setup

Install pnpm package manager
https://github.com/marketplace/actions/setup-pnpm
MIT License
936 stars 89 forks source link

Only check `packageManager` if it actually specifies `pnpm` #143

Closed fkorotkov closed 2 months ago

fkorotkov commented 2 months ago

We upgrade to version 4 and started seeing the following weird error:

Error: Multiple versions of pnpm specified:
  Error: Error: Multiple versions of pnpm specified:
    - version 9 in the GitHub Action config with the key "version"
    - version yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e in the package.json with the key "packageManager"
  Remove one of these versions to avoid version mismatch errors like ERR_PNPM_BAD_PM_VERSION
    - version 9 in the GitHub Action config with the key "version"
    - version yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e in the package.json with the key "packageManager"

Even though we don't specify packageManager in package.json explicitly.

Either way this change seems like an improvement to do pnpm version validation only if it's actually pnpm.

zkochan commented 2 months ago

Even though we don't specify packageManager in package.json explicitly.

I don't understand, if you don't have the field in package.json, how do you get the error?

fkorotkov commented 2 months ago

Found the issue. There was some problem with a working dir.