Skip to content

Commit e4a7860

Browse files
author
Dirk Eismann
committed
fix: read npm registry from npm config instead of hard-wiring it to npmjs.org, fixes #3866
1 parent f0e150c commit e4a7860

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/node-package-manager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ export class NodePackageManager implements INodePackageManager {
120120
}
121121

122122
public async getRegistryPackageData(packageName: string): Promise<any> {
123-
const url = `https://registry.npmjs.org/${packageName}`;
123+
const registry = await this.$childProcess.exec(`npm config get registry`);
124+
const url = registry.trim() + packageName;
124125
this.$logger.trace(`Trying to get data from npm registry for package ${packageName}, url is: ${url}`);
125126
const responseData = (await this.$httpClient.httpRequest(url)).body;
126127
this.$logger.trace(`Successfully received data from npm registry for package ${packageName}. Response data is: ${responseData}`);

0 commit comments

Comments
 (0)