You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Update checks should respect npm registry configuration to avoid Windows Security warnings in enterprise environments #478
fetchLatestVersion() in playwright-cli.js hardcodes the update-check URL to https://registry.npmjs.org/${packageJson.name}/latest instead of respecting the user's configured npm registry.
The reporter notes that Microsoft internal users encounter this problem: enterprise policies may block access to this public URL, and the CLI's update check triggers Windows Security warnings. Even when an enterprise npm registry is configured, the CLI still accesses registry.npmjs.org directly.
Catching network errors only prevents the CLI from reporting an error; it does not prevent the outgoing request or the resulting security warning. No exact Windows Security warning text or screenshot was provided.
Steps to reproduce
In an enterprise-managed Windows environment, configure an enterprise npm registry through npm configuration or .npmrc, including @playwright:registry where applicable.
Ensure that neither NO_UPDATE_NOTIFIER nor CI is set and that the update-check cache is missing or older than one day.
Run a playwright-cli command to trigger the startup update check.
In an environment that blocks registry.npmjs.org, observe the outgoing public-registry request and any resulting Windows Security warning.
Expected behavior
The update check should respect the npm registry configuration applicable to @playwright/cli and comply with enterprise network policies. If a custom registry is unavailable, it should not fall back to public npmjs.
Suggested fix and acceptance criteria
Resolve npm registry configuration correctly, considering environment variables, project/user/global .npmrc files, and scoped registries. Consider querying the version through npm to reuse its configuration and authentication logic.
When an enterprise registry is configured, the update check must not send requests to registry.npmjs.org. Preserve the normal default behavior when no custom registry is configured.
Preserve the existing approximately 1.5-second total lookup timeout, once-per-day cache check, and NO_UPDATE_NOTIFIER / CI opt-out behavior.
Lookup failures, timeouts, or invalid responses must not affect the CLI's main functionality. If an npm subprocess is used, cover missing npm and Windows subprocess startup/termination behavior.
Avoid leaking registry authentication information in output or logs.
Use local test servers or mocks to cover default, custom, and scoped registries, as well as failure and timeout scenarios, without depending on a real enterprise network.
Temporary workaround
Set NO_UPDATE_NOTIFIER=1 to skip the current update check. This is not a long-term fix for respecting registry configuration.
changed the title [-]更新检查应尊重 npm registry 配置,避免企业环境中的 Windows Security 提醒[/-][+]Update checks should respect npm registry configuration to avoid Windows Security warnings in enterprise environments[/+]on Oct 14, 2026
I would like to work on this. Before I write code, can a maintainer confirm the approach?
Proposal: skip the update check when a custom registry is configured for @playwright/cli.
Read the registry from the same places npm does, in npm's precedence order:
environment: npm_config_@playwright:registry / npm_config_registry (any case), which npm sets when the CLI runs through npx or an npm script;
project .npmrc (nearest directory with package.json), user .npmrc (NPM_CONFIG_USERCONFIG or ~/.npmrc), global npmrc.
The scoped @playwright:registry wins over registry.
If the result is not https://registry.npmjs.org/, return early. No request is sent.
Otherwise keep the current behavior: the same 1.5 s timeout, daily cache, and NO_UPDATE_NOTIFIER / CI opt-out.
Only the registry keys are read, so auth tokens are never read or logged. No subprocess is started.
Why not query the custom registry or run npm view:
Enterprise registries usually need auth, so an unauthenticated fetch fails anyway.
npm view @playwright/cli version takes about 750 ms on my Windows machine, which is half of the 1.5 s budget, and it needs shell: true for npm.cmd.
Trade-off: users with a custom registry do not get the update notice. If you prefer to query the configured registry instead, I can do that.
Tests: integration tests in tests/integration.spec.ts that use a local HTTP server as the default registry (through a test-only override) and .npmrc files in the test output directory. They will check that no request is sent when a custom or scoped registry is set, and that the notice still appears when none is set.
Activity
[-]更新检查应尊重 npm registry 配置,避免企业环境中的 Windows Security 提醒[/-][+]Update checks should respect npm registry configuration to avoid Windows Security warnings in enterprise environments[/+]chiarorosa commentedon Oct 16, 2026
I would like to work on this. Before I write code, can a maintainer confirm the approach?
Proposal: skip the update check when a custom registry is configured for
@playwright/cli.npm_config_@playwright:registry/npm_config_registry(any case), which npm sets when the CLI runs throughnpxor an npm script;.npmrc(nearest directory withpackage.json), user.npmrc(NPM_CONFIG_USERCONFIGor~/.npmrc), globalnpmrc.@playwright:registrywins overregistry.https://registry.npmjs.org/, return early. No request is sent.NO_UPDATE_NOTIFIER/CIopt-out.Only the
registrykeys are read, so auth tokens are never read or logged. No subprocess is started.Why not query the custom registry or run
npm view:npm view @playwright/cli versiontakes about 750 ms on my Windows machine, which is half of the 1.5 s budget, and it needsshell: truefornpm.cmd.Trade-off: users with a custom registry do not get the update notice. If you prefer to query the configured registry instead, I can do that.
Tests: integration tests in
tests/integration.spec.tsthat use a local HTTP server as the default registry (through a test-only override) and.npmrcfiles in the test output directory. They will check that no request is sent when a custom or scoped registry is set, and that the notice still appears when none is set.fix(cli): respect npm registry config in update check (microsoft#484)