Skip to content

fix: route Yarn registry tarballs through the configured npm mirror - #924

Closed
Aschenbath wants to merge 1 commit into
nodejs:mainfrom
Aschenbath:feat/yarn-registry-mirror-753
Closed

Aschenbath wants to merge 1 commit into
nodejs:mainfrom
Aschenbath:feat/yarn-registry-mirror-753

Conversation

@Aschenbath

Copy link
Copy Markdown

When a custom npm registry advertises a Yarn Classic tarball on registry.yarnpkg.com, Corepack currently downloads from that public host instead of the configured mirror. This breaks installs where public registries are blocked and prevents mirror credentials from reaching the download.

This change applies COREPACK_NPM_REGISTRY to tarball URLs on both registry.npmjs.org and registry.yarnpkg.com, including explicit package-manager URLs. It compares URL origins, preserves package paths and query strings, supports registry base paths and trailing slashes, and documents the behavior. Regression tests cover Basic, Bearer, and proxy authentication for both tarball hosts, along with unrelated origins and scoped paths.

Validation:

  • Build, tsc --noEmit, and eslint --max-warnings=0 passed.
  • Full Vitest suite: 8 test files passed, 189 tests passed, 1 existing expected failure.
  • Tests ran with NOCK_ENV=replay. A local, uncommitted setup file enables this sandbox's outbound proxy only for the live npm signing-key check; inherited proxy variables are cleared for the local registry fixtures.

Closes #753.

@aduh95

aduh95 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

This account has opened more than 10 PRs in the last 24 hours. This looks like bot activity, and will result in a ban if the behavior continues.

@aduh95 aduh95 closed this Oct 20, 2026
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.

Bug: corepack ignores COREPACK_NPM_REGISTRY for yarnpkg registry

2 participants