{"record":{"id":"3b3f8d4501d88644","repo":"microsoft/playwright","slug":"invalid-installation-targets-faultyarguments-ma","errorCode":null,"errorMessage":"Invalid installation targets: ${faultyArguments.map(name => `'${name}'`).join(', ')}. Expecting one of: ${this.suggestedBrowsersToInstall()}","messagePattern":"Invalid installation targets: (.+?)'`\\)\\.join\\(', '\\)\\}\\. Expecting one of: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/server/registry/index.ts","lineNumber":1311,"sourceCode":"        executables.push(this.findExecutable('ffmpeg')!);\n    };\n\n    for (const alias of aliases) {\n      if (alias === 'chromium' || chromiumAliases.includes(alias)) {\n        if (options.shell !== 'only')\n          handleArgument('chromium');\n        if (options.shell !== 'no')\n          handleArgument('chromium-headless-shell');\n      } else {\n        handleArgument(alias);\n      }\n    }\n\n    if (process.platform === 'win32')\n      executables.push(this.findExecutable('winldd')!);\n\n    if (faultyArguments.length)\n      throw new Error(`Invalid installation targets: ${faultyArguments.map(name => `'${name}'`).join(', ')}. Expecting one of: ${this.suggestedBrowsersToInstall()}`);\n    return [...new Set(executables)];\n  }\n}\n\nexport function browserDirectoryToMarkerFilePath(browserDirectory: string): string {\n  return path.join(browserDirectory, 'INSTALLATION_COMPLETE');\n}\n\nexport function buildPlaywrightCLICommand(sdkLanguage: string, parameters: string): string {\n  switch (sdkLanguage) {\n    case 'python':\n      return `playwright ${parameters}`;\n    case 'java':\n      return `mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args=\"${parameters}\"`;\n    case 'csharp':\n      return `pwsh bin/Debug/netX/playwright.ps1 ${parameters}`;\n    default: {\n      const packageManagerCommand = getPackageManagerExecCommand();","sourceCodeStart":1293,"sourceCodeEnd":1329,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/server/registry/index.ts#L1293-L1329","documentation":"Thrown by resolveBrowsers when one or more aliases passed to 'playwright install <args...>' do not match any executable with an installable installType — findExecutable returned undefined or installType === 'none'. The message echoes the bad names and lists every valid target via suggestedBrowsersToInstall().","triggerScenarios":"Running 'npx playwright install foo' where 'foo' is not a known executable or is a detection-only entry; typo in a channel name; passing a browser name removed in the current Playwright version.","commonSituations":"Typo like 'chromuim'; using a channel alias not in chromiumAliases; referencing a browser that exists only in a different Playwright version; scripting install with a dynamic name that resolved to undefined.","solutions":["Read the 'Expecting one of:' list in the message and use one of those exact names.","Fix the typo (common: 'chromuim' -> 'chromium').","Run 'npx playwright install' with no arguments to install all defaults.","If the name comes from config, validate it against registry.executables() before passing it."],"exampleFix":"// before\n// shell: npx playwright install chromuim\n\n// after\n// shell: npx playwright install chromium","handlingStrategy":"validation","validationCode":"import { registry } from 'playwright-core/lib/server/registry';\n\nconst requested = ['chromium', 'firefx']; // from CLI args\nconst valid = requested.filter(n => {\n  const e = registry.findExecutable(n);\n  return e && e.installType !== 'none';\n});\nconst invalid = requested.filter(n => !valid.includes(n));\nif (invalid.length)\n  throw new Error(`Unknown targets: ${invalid.join(', ')}. Valid: ${registry.suggestedBrowsersToInstall()}`);","typeGuard":"function isValidInstallTarget(name: string): boolean {\n  const e = registry.findExecutable(name);\n  return !!e && e.installType !== 'none';\n}","tryCatchPattern":null,"preventionTips":["Validate install target names against registry.suggestedBrowsersToInstall() before invoking install.","Source browser names from the registry rather than hard-coding them.","Add a lint/test asserting that any configured browser names resolve to installable executables."],"tags":["install","cli","validation","registry"],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}