Skip to content

Browser installation fails on first run #218

@KostasDimakis

Description

@KostasDimakis

Problem Description

OS: MacOS

When running MCP Playwright for the first time after installing it, the browser installation process fails.

Reproduction Steps

  1. Fresh install of MCP Playwright on VSC using the button from the repo.
  2. No projects opened.
  3. Run the MCP server so the tools are discovered (default settings).
  4. Write "Navigate to playwright mcp github repo and star it" on copilot.
  5. Failure occurs during browser_install step.

Error message:

Error: Failed to install browser:
╔═══════════════════════════════════════════════════════════════════════════════╗
║ WARNING: It looks like you are running 'npx playwright install' without first ║
║ installing your project's dependencies.                                       ║
║                                                                               ║
║ To avoid unexpected behavior, please install your dependencies first, and     ║
║ then run Playwright's install command:                                        ║
║                                                                               ║
║     npm install                                                               ║
║     npx playwright install                                                    ║
║                                                                               ║
║ If your project does not yet depend on Playwright, first install the          ║
║ applicable npm package (most commonly @playwright/test), and                  ║
║ then run Playwright's install command to download the browsers:               ║
║                                                                               ║
║     npm install @playwright/test                                              ║
║     npx playwright install                                                    ║
║                                                                               ║
╚═══════════════════════════════════════════════════════════════════════════════╝
Switching to root user to install dependencies...
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required
Failed to install browsers
Error: Failed to install chrome

What else I've tried:

  • Installed browsers manually.
  • Tried following the steps on a fake project by installing @playwright/test first.

I'm unsure how to resolve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions