Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add corepack pnpm and corepack yarn to corepack --help #412

Open
KSXGitHub opened this issue Feb 28, 2024 · 5 comments
Open

Add corepack pnpm and corepack yarn to corepack --help #412

KSXGitHub opened this issue Feb 28, 2024 · 5 comments

Comments

@KSXGitHub
Copy link

KSXGitHub commented Feb 28, 2024

I didn't know this was possible because corepack --help doesn't mention it.

@aduh95
Copy link
Contributor

aduh95 commented Feb 28, 2024

Can you clarify what's missing today? corepack pnpm install should already do what you expect it to do, no?

@merceyz
Copy link
Member

merceyz commented Feb 28, 2024

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.

@KSXGitHub
Copy link
Author

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

@KSXGitHub KSXGitHub changed the title Request: corepack should be able to execute the package manager directly without enable Add corepack pnpm and corepack yarn to corepack --help Feb 29, 2024
@KSXGitHub
Copy link
Author

Can you clarify what's missing today? corepack pnpm install should 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.

@arcanis
Copy link
Contributor

arcanis commented Feb 29, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants