Skip to content

Commit 1b35362

Browse files
xiaoxiangmoeaduh95
andauthored
fix: npm registry override (#219)
Co-authored-by: Antoine du Hamel <[email protected]>
1 parent d6aeaf0 commit 1b35362

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sources/corepackUtils.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,13 @@ export async function installVersion(installTarget: string, locator: Locator, {s
104104
return installFolder;
105105
}
106106

107-
const url = spec.url.replace(`{}`, version);
107+
const defaultNpmRegistryURL = spec.url.replace(`{}`, version);
108+
const url = process.env.COREPACK_NPM_REGISTRY ?
109+
defaultNpmRegistryURL.replace(
110+
npmRegistryUtils.DEFAULT_NPM_REGISTRY_URL,
111+
() => process.env.COREPACK_NPM_REGISTRY!,
112+
) :
113+
defaultNpmRegistryURL;
108114

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

0 commit comments

Comments
 (0)