action-setup icon indicating copy to clipboard operation
action-setup copied to clipboard

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

Open kidonng opened this issue 1 year ago • 4 comments

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?

kidonng avatar Sep 14 '22 10:09 kidonng

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

KSXGitHub avatar Sep 15 '22 02:09 KSXGitHub

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

kidonng avatar Sep 15 '22 03:09 kidonng

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 🙈

kidonng avatar Sep 15 '22 03:09 kidonng

I think the error messages can be improved.

KSXGitHub avatar Sep 15 '22 03:09 KSXGitHub