Skip to content

Conversation

@evaliyev
Copy link

@evaliyev evaliyev commented Jan 26, 2026

Fixes #741

Also adding a test that demonstrates .corepack.env is ignored when running corepack use <pkg>.

Add a test that demonstrates .corepack.env is ignored when running
"corepack use <pkg>". The test uses it.fails() to document this as
a known issue.

Root cause: In BaseCommand.resolvePatternsToDescriptors(), loadSpec()
is only called when patterns.length === 0. When a pattern is provided
(e.g., "corepack use pnpm"), loadSpec() is never called, so .corepack.env
is never read before registry calls are made.
@evaliyev
Copy link
Author

evaliyev commented Jan 30, 2026

@aduh95 Please take a look.
I hope that test would clearly showcase the issue.
I'm not really confident in the fix. Would appreaciate an advice where loadSpec should be called.

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

Successfully merging this pull request may close these issues.

corepack use does not load COREPACK_NPM_REGISTRY from .corepack.env

1 participant