Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The quickest check depends on which Playwright command you mean. In a project that should contain Playwright Test, run npx --no-install playwright --version. A version number confirms that the project-local Playwright command resolved without downloading anything. The separately packaged Playwright Agent CLI is checked with playwright-cli --help (global install) or npx playwright cli --help (local install). Browser executables are a third, separate check: use npx playwright install --list.

Identify which Playwright CLI you are checking

“Playwright CLI” can refer to two different tools in the current documentation:

  • Playwright Test CLI: the project command used for tasks such as npx playwright test. It normally comes from the @playwright/test package.
  • Playwright Agent CLI: a distinct command-line tool distributed as @playwright/cli. Its global command is playwright-cli; its local-package form is npx playwright cli.

A command can be installed while browser binaries are missing. Check the package and the browser installation independently.

Check for a project-local Playwright Test installation

npm: prevent an accidental download

Open a terminal in the project directory—the directory containing its package.json—and run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
npx --no-install playwright --version

If the command prints a version, npm resolved Playwright from the project (or its local dependency tree). The --no-install flag is useful when detection is the goal: npx will not fetch a package merely to satisfy the command. If it reports that the executable cannot be found, Playwright is not available through that project’s local dependencies.

Standard version checks from the installation guide

The official Playwright installation guide also documents these forms:

npx playwright --version
yarn playwright --version
pnpm exec playwright --version

The ordinary npx form may acquire a package if one is not already available, so use the --no-install form when you need a strict local-presence test. Use the Yarn or pnpm command that matches the package manager used by the project. See the Playwright installation guide for the current setup flow.

Ask what commands are available

Version output confirms that the executable responds; help output shows the command surface:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
npx playwright --help

This is command discovery rather than a browser check. The current command list is documented in Playwright’s command-line reference.

Check the Playwright Agent CLI

Global installation

For the Agent CLI installed globally, run:

playwright-cli --help

A help page indicates that the global playwright-cli command is on your PATH. If your shell says the command is not found, install the package globally as documented:

npm install -g @playwright/cli@latest

After installation, open a new terminal if your operating system or shell has not refreshed its command path, then run playwright-cli --help again.

Local installation

If @playwright/cli is a project dependency, invoke its local command with:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
npx playwright cli --help

This path is not the same test as playwright-cli --help. A project can have the local package without exposing a global executable, or have a global executable without the package being present in the current project. The Agent CLI installation instructions cover both arrangements at Playwright Agent CLI installation.

Check whether browser binaries are installed

Playwright’s JavaScript package and its browser executables are separate. A successful version check does not prove that Chromium, Firefox, or WebKit can launch. List browser installations with:

npx playwright install --list

The output lists browsers known to the Playwright installations on that machine. If the required browser is absent, install the default set with:

npx playwright install

In CI or a restricted environment, install only the browser your tests require and ensure the process has permission to write to Playwright’s browser cache. The official browser guidance is at Playwright browsers.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A reliable diagnostic sequence

Run these checks in order when you are unsure what is missing:

  1. Change to the intended project. Confirm that the terminal is in the directory whose dependencies you want to inspect. Running npx from a parent or unrelated directory can resolve a different package.
  2. Check the local Test CLI without installation.
    npx --no-install playwright --version
  3. Inspect available Test CLI commands.
    npx playwright --help
  4. Check the Agent CLI path, if that is your target.
    playwright-cli --help
    npx playwright cli --help

    Try the command that matches your intended global or local installation.

  5. Check browser executables.
    npx playwright install --list
  6. Install only the missing layer. For a new Playwright Test project, the official initializer is npm init playwright@latest. For an existing project, add @playwright/test using its package manager. For the Agent CLI, install @playwright/cli globally or as a local development dependency.

Install the right package when the check fails

New Playwright Test project

Use the documented initializer:

npm init playwright@latest

The wizard creates the project files and adds the test dependency. Once it completes, run npx --no-install playwright --version from that project directory.

Existing project

Add the Playwright Test package as a development dependency with your chosen package manager, then repeat the local version check. Keep the package in the project that will run the tests; installing it elsewhere does not make the command available to this project.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Agent CLI

For a machine-wide command:

npm install -g @playwright/cli@latest

For a project-scoped tool, add @playwright/cli as a local development dependency and use npx playwright cli --help. Do not infer Agent CLI availability from a successful Playwright Test check: they are different packages and invocation paths.

Common errors and fixes

“command not found: playwright-cli”

The global executable is missing or its installation directory is not on PATH. Try npx playwright cli --help to test a local Agent CLI package. If you intended a global install, install @playwright/cli@latest globally and refresh the terminal’s command path.

npx says it cannot find a package with --no-install

That is the expected result when the current project does not expose Playwright locally. Check the current directory and package.json, then add the appropriate dependency. Do not remove --no-install merely to make the test pass: the ordinary npx command may download a package and hide the missing local dependency.

The version command works, but a test cannot launch a browser

The package is present but browser binaries may not be. Run npx playwright install --list; if the needed browser is absent, run npx playwright install. Also check filesystem permissions, proxy settings, and whether a CI image removes the Playwright browser cache between jobs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The command resolves the wrong project or version

Run the command from the project root and inspect the dependency lockfile. Multiple repositories, workspaces, or globally installed packages can make an unqualified command appear to work while the target project has no local dependency. The strict npx check is the clearest project-level test.

Help output differs from an example

Playwright commands and options change by release. Treat the output from your installed version as authoritative, and consult the current official references rather than copying an option from an older article.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When a screenshot is the actual goal

If you only need a rendered website image or PDF—not a locally managed Playwright browser—ScreenshotNeo provides a website screenshot API and MCP server. It accepts one GET request and can return PNG, JPEG, WebP, or PDF. Before capture it accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status.

Or skip the browser setup

Use the API instead of installing Playwright browsers. The parameter names used by other screenshot APIs also work, which can simplify migration. Full option details are in the ScreenshotNeo documentation.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

cURL

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo also supports full-page captures with lazy images loaded, CSS-selector element captures, dark mode, device presets and custom viewports, retina scale, PDF paper and page settings, custom CSS and JavaScript, pre-capture clicks, hidden selectors, selector or network-idle waits, request blocking, custom headers and cookies, user agents, Authorization, timezone and geolocation, transparent backgrounds, resizing, configurable-TTL caching, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is available on every plan, and annual billing gives two months free. Sign up free for ScreenshotNeo and get 1,000 screenshots a month without a card.

Cost, reliability, and security considerations

  • Local CLI checks cost nothing, but browser downloads consume disk space and may need to be repeated in ephemeral CI runners.
  • Pin and review versions in production projects so a package update does not silently change command behavior or browser compatibility.
  • Keep credentials out of commands and logs. If you use custom headers, cookies, or Authorization with an API or test script, supply them through protected environment variables or a secret store.
  • Separate diagnosis from execution. First prove that the intended package resolves, then verify browser binaries, then run a test or capture. This identifies the failing layer instead of masking it with an automatic install.

Frequently Asked Questions

Is `npx playwright –version` enough to prove Playwright is installed?

It proves that a Playwright command responded, but the ordinary npx form may download a package. For a strict project-local check, use `npx –no-install playwright –version`.

Is `playwright-cli` the same as `npx playwright`?

No. `npx playwright` normally refers to the Playwright Test CLI, while `playwright-cli` is the global command for the separate Playwright Agent CLI package.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Which command checks only the browsers?

Run `npx playwright install –list`. A package version check does not establish that browser executables are installed.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.