microsoft/playwright · error · Error

Invalid installation targets: ${faultyArguments.map(name =>

Error message

Invalid installation targets: ${faultyArguments.map(name => `'${name}'`).join(', ')}. Expecting one of: ${this.suggestedBrowsersToInstall()}

What it means

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().

Source

Thrown at packages/playwright-core/src/server/registry/index.ts:1311

        executables.push(this.findExecutable('ffmpeg')!);
    };

    for (const alias of aliases) {
      if (alias === 'chromium' || chromiumAliases.includes(alias)) {
        if (options.shell !== 'only')
          handleArgument('chromium');
        if (options.shell !== 'no')
          handleArgument('chromium-headless-shell');
      } else {
        handleArgument(alias);
      }
    }

    if (process.platform === 'win32')
      executables.push(this.findExecutable('winldd')!);

    if (faultyArguments.length)
      throw new Error(`Invalid installation targets: ${faultyArguments.map(name => `'${name}'`).join(', ')}. Expecting one of: ${this.suggestedBrowsersToInstall()}`);
    return [...new Set(executables)];
  }
}

export function browserDirectoryToMarkerFilePath(browserDirectory: string): string {
  return path.join(browserDirectory, 'INSTALLATION_COMPLETE');
}

export function buildPlaywrightCLICommand(sdkLanguage: string, parameters: string): string {
  switch (sdkLanguage) {
    case 'python':
      return `playwright ${parameters}`;
    case 'java':
      return `mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="${parameters}"`;
    case 'csharp':
      return `pwsh bin/Debug/netX/playwright.ps1 ${parameters}`;
    default: {
      const packageManagerCommand = getPackageManagerExecCommand();

View on GitHub (pinned to c8fc3bf8d3)

Solutions

  1. Read the 'Expecting one of:' list in the message and use one of those exact names.
  2. Fix the typo (common: 'chromuim' -> 'chromium').
  3. Run 'npx playwright install' with no arguments to install all defaults.
  4. If the name comes from config, validate it against registry.executables() before passing it.

Example fix

// before
// shell: npx playwright install chromuim

// after
// shell: npx playwright install chromium
Defensive patterns

Strategy: validation

Validate before calling

import { registry } from 'playwright-core/lib/server/registry';

const requested = ['chromium', 'firefx']; // from CLI args
const valid = requested.filter(n => {
  const e = registry.findExecutable(n);
  return e && e.installType !== 'none';
});
const invalid = requested.filter(n => !valid.includes(n));
if (invalid.length)
  throw new Error(`Unknown targets: ${invalid.join(', ')}. Valid: ${registry.suggestedBrowsersToInstall()}`);

Type guard

function isValidInstallTarget(name: string): boolean {
  const e = registry.findExecutable(name);
  return !!e && e.installType !== 'none';
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of microsoft/playwright@c8fc3bf8d3 (2026-08-12). Data as JSON: /api/errors/3b3f8d4501d88644. Report an issue: GitHub.