Skip to content

Commit

Permalink
fix: npm registry override (#219)
Browse files Browse the repository at this point in the history
Co-authored-by: Antoine du Hamel <[email protected]>
  • Loading branch information
xiaoxiangmoe and aduh95 authored Feb 17, 2023
1 parent d6aeaf0 commit 1b35362
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sources/corepackUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,13 @@ export async function installVersion(installTarget: string, locator: Locator, {s
return installFolder;
}

const url = spec.url.replace(`{}`, version);
const defaultNpmRegistryURL = spec.url.replace(`{}`, version);
const url = process.env.COREPACK_NPM_REGISTRY ?
defaultNpmRegistryURL.replace(
npmRegistryUtils.DEFAULT_NPM_REGISTRY_URL,
() => process.env.COREPACK_NPM_REGISTRY!,
) :
defaultNpmRegistryURL;

// Creating a temporary folder inside the install folder means that we
// are sure it'll be in the same drive as the destination, so we can
Expand Down

0 comments on commit 1b35362

Please sign in to comment.