Skip to content

npm install -g corepack enables Corepack #686

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

Open
MikeMcC399 opened this issue Mar 23, 2025 · 4 comments
Open

npm install -g corepack enables Corepack #686

MikeMcC399 opened this issue Mar 23, 2025 · 4 comments

Comments

@MikeMcC399
Copy link
Contributor

Situation

If Corepack is installed globally using npm, as documented in the README > Manual Installs section using

npm install -g corepack

then Corepack behaves as if corepack enable had been executed.

This differs from how Corepack behaves when it is installed together with Node.js as a bundled component. In this case Corepack is not enabled by default.

The difference between defaults of Corepack being enabled or not, depending on how Corepack is installed, is not documented in the README, neither under the Manual Installs section, nor under the corepack enable section.

Suggestion

Add the information to the README document that using npm install -g corepack effectively executes corepack enable.

@MikeMcC399
Copy link
Contributor Author

The documentation should also mention that if you had previously selectively enabled Corepack based on a Node.js installation for any individual package manager, then installing with npm enables Corepack for all eligible package managers. It overrides any previous selection.

For example

corepack enable yarn # enable only Yarn
npm install -g corepack

results in both Yarn and pnpm being enabled.

@ljharb
Copy link
Member

ljharb commented Mar 24, 2025

It's also frustrating there's no reliable/explicit way to determine if corepack is enabled or not.

@MikeMcC399
Copy link
Contributor Author

@ljharb

It's also frustrating there's no reliable/explicit way to determine if corepack is enabled or not.

I have also found that to be an issue working in a hybrid desktop environment where I need to enable and disable Corepack. I end up just calling corepack enable / corepack disable blindly, not knowing what the existing status is. Probably this should be a separate topic to add a corepack status command or similar.

@MikeMcC399
Copy link
Contributor Author

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

2 participants