{"record":{"id":"d2cd373d09b8263c","repo":"microsoft/playwright","slug":"failed-to-install-channel","errorCode":null,"errorMessage":"Failed to install ${channel}","messagePattern":"Failed to install (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/server/registry/index.ts","lineNumber":1169,"sourceCode":"    }\n    await this._installChromiumChannel(channel, scripts, scriptArgs);\n  }\n\n  private async _installChromiumChannel(channel: string, scripts: Record<'linux' | 'darwin' | 'win32', string>, scriptArgs: string[] = []) {\n    const scriptName = scripts[process.platform as 'linux' | 'darwin' | 'win32'];\n    if (!scriptName)\n      throw new Error(`Cannot install ${channel} on ${process.platform}`);\n    const cwd = BIN_PATH;\n    const isPowerShell = scriptName.endsWith('.ps1');\n    if (isPowerShell) {\n      const args = [\n        '-ExecutionPolicy', 'Bypass', '-File',\n        path.join(BIN_PATH, scriptName),\n        ...scriptArgs\n      ];\n      const { code } = await spawnAsync('powershell.exe', args, { cwd, stdio: 'inherit' });\n      if (code !== 0)\n        throw new Error(`Failed to install ${channel}`);\n    } else {\n      const shellArgs = scriptArgs.map(a => `'${a.replace(/'/g, `'\\\\''`)}'`).join(' ');\n      const { command, args, elevatedPermissions } = await transformCommandsForRoot([`bash \"${path.join(BIN_PATH, scriptName)}\" ${shellArgs}`]);\n      if (elevatedPermissions)\n        console.log('Switching to root user to install dependencies...'); // eslint-disable-line no-console\n      const { code } = await spawnAsync(command, args, { cwd, stdio: 'inherit' });\n      if (code !== 0)\n        throw new Error(`Failed to install ${channel}`);\n    }\n  }\n\n  async listInstalledBrowsers() {\n    const linksDir = path.join(registryDirectory, '.links');\n    const { browsers } = await this._traverseBrowserInstallations(linksDir);\n    return browsers.filter(browser => fs.existsSync(browser.browserPath));\n  }\n\n  private async _validateInstallationCache(linksDir: string) {","sourceCodeStart":1151,"sourceCodeEnd":1187,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/server/registry/index.ts#L1151-L1187","documentation":"Thrown by _installChromiumChannel in the PowerShell branch (Windows) after spawnAsync('powershell.exe', ...) returns a non-zero exit code. The install script (e.g. install_media.ps1) ran but failed, so the channel did not install successfully.","triggerScenarios":"Running 'playwright install <chromium-channel>' on Windows where the bundled .ps1 installer exits non-zero — elevation denied, the download URL it was given 404'd, a step in the script errored, or the process was interrupted.","commonSituations":"Windows CI without admin/elevation rights; the artifact URL passed to the script is stale or unreachable; partial download left a corrupted installer; execution policy blocked the script despite -ExecutionPolicy Bypass.","solutions":["Re-run with elevated permissions (Administrator) so the PowerShell installer can write system paths.","Inspect the PowerShell output above the error for the specific failing step and address it.","Install the browser manually from the vendor site, then launch with the channel.","Retry — transient network failures during the scripted download can cause non-zero exit."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await runInstall([channel]);\n} catch (e) {\n  if (/Failed to install/.test(e.message))\n    throw new Error(`Channel ${channel} install failed; run an elevated shell and retry`);\n  else throw e;\n}","preventionTips":["Run the install from an elevated (Administrator) terminal on Windows.","Inspect the full PowerShell output to find the failing step before retrying.","Pre-install the browser manually to bypass the scripted installer."],"tags":["chromium-channel","install","windows","powershell","exit-code"],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}