Skip to content

Commit

Permalink
fix: replace npm registry domain in tarball URL (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 authored Jul 12, 2024
1 parent 56de2ed commit db6fae5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions sources/corepackUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,11 @@ export async function installVersion(installTarget: string, locator: Locator, {s
if (registry.bin) {
binPath = registry.bin;
}
} else {
url = url.replace(
npmRegistryUtils.DEFAULT_NPM_REGISTRY_URL,
() => process.env.COREPACK_NPM_REGISTRY!,
);
}
url = url.replace(
npmRegistryUtils.DEFAULT_NPM_REGISTRY_URL,
() => process.env.COREPACK_NPM_REGISTRY!,
);
}
} else {
url = decodeURIComponent(version);
Expand Down
2 changes: 1 addition & 1 deletion tests/_registryServer.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function generateVersionMetadata(packageName, version) {
shasum,
size: mockPackageTarGz.length,
noattachment: false,
tarball: `${process.env.COREPACK_NPM_REGISTRY}/${packageName}/-/${packageName}-${version}.tgz`,
tarball: `https://registry.npmjs.org/${packageName}/-/${packageName}-${version}.tgz`,
...generateSignature(packageName, version),
},
};
Expand Down

0 comments on commit db6fae5

Please sign in to comment.