pnpm / action-setup

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

Confusing error messages when user doesn't specify `version` #54

Open kidonng opened 2 years ago

kidonng commented 2 years ago

It seems this action requires a package.json file to be present:

https://github.com/pnpm/action-setup/blob/6e1964dde3397a825e79e4607ad57f3f7ca2c7cb/src/install-pnpm/run.ts#L13-L14

Even if users only use pnpx and do not install packages locally, they have to provide a package.json, which is inconvenient.

Will the action support using it without a package.json?

KSXGitHub commented 2 years ago

You misinterpreted the code. Have you tried running this action without package.json?

kidonng commented 2 years ago

Yep: https://github.com/kidonng/api/actions/runs/3051844927/jobs/4920548325#step:4:7

kidonng commented 2 years ago

Ah, I think I got what's happening. I didn't specify a version, so the action is finding the packageManager field in package.json, but I don't have one.

Sorry, my assumption is wrong 🙈

KSXGitHub commented 2 years ago

I think the error messages can be improved.