corepack
corepack copied to clipboard
Add `corepack pnpm` and `corepack yarn` to `corepack --help`
I didn't know this was possible because corepack --help doesn't mention it.
Can you clarify what's missing today? corepack pnpm install should already do what you expect it to do, no?
Why do you have enable/disable Corepack based on the project?
If packageManager isn't specified Corepack will use the global version, whatever that is set to.
I just assumed it doesn't work because corepack --help doesn't mention it. Now this is more of a documentation issue. I will change the issue title
Can you clarify what's missing today?
corepack pnpm installshould already do what you expect it to do, no?
Actually, there's one thing that is missing: PATH.
The scripts in package.json will sometimes invoke pnpm or yarn, but since corepack didn't set PATH, they will invoke the wrong versions. I know this because corepack pnpm exec which pnpm doesn't return the right pnpm.
I think that's something you should bring up to pnpm - in the case of Yarn it isn't a problem because Yarn already adds itself to the PATH, Corepack or not, precisely for this reason.