Skip to content

Commit 6d91b00

Browse files
committed
fix: respect npm_config_registry for update checks
Use the npm_config_registry env var (set by npm when invoked via npx with custom registry config) instead of hardcoding registry.npmjs.org. Falls back to the default public registry when the env var is not set. Fixes #1943
1 parent c9c1683 commit 6d91b00

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/bin/check-latest-version.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ const cachePath = process.argv[2];
1212

1313
if (cachePath) {
1414
try {
15+
const registry =
16+
process.env.npm_config_registry?.replace(/\/$/, '') ||
17+
'https://registry.npmjs.org';
1518
const response = await fetch(
16-
'https://registry.npmjs.org/chrome-devtools-mcp/latest',
19+
`${registry}/chrome-devtools-mcp/latest`,
1720
);
1821
const data = response.ok ? await response.json() : null;
1922

0 commit comments

Comments
 (0)