How to Check Whether Playwright Is Installed on Mac
Use the right macOS commands to verify Playwright, its browsers, cache path, and common installation problems.
Quick answer: Open Terminal, change to the project directory, and run npx playwright --version. This checks whether the Playwright CLI can be resolved for that project. Then run npx playwright install --list to see whether Playwright’s browser binaries are installed.
These are separate checks. A project can have the Playwright package without having the browsers required to launch tests or automation.
1. Check the Playwright package and CLI
From the repository you want to inspect, run:
cd /path/to/your/project
npx playwright --version
If Playwright is available in the project’s execution context, the command prints its version, such as 1.x.x. Running it inside the project matters because npx resolves the package from that project’s dependencies and lockfile.
Package-manager equivalents
yarn playwright --version
pnpm exec playwright --version
Use the command that matches the package manager used by the project. Playwright documents these commands on its installation page.
Confirm the dependency declaration
Inspect package.json and the lockfile in the same directory:
cat package.json
ls package-lock.json yarn.lock pnpm-lock.yaml 2>/dev/null
Look for a Playwright package such as @playwright/test or playwright. The version command is the practical test of whether the CLI resolves; the manifest explains which dependency the project expects.
2. Check whether Playwright browsers are installed
Playwright manages browser binaries separately from the npm package. List the browsers currently installed with:
npx playwright install --list
This command reports the browser installations Playwright can find. If the list is empty or a required browser is missing, install the browsers with:
npx playwright install
You can also install a specific browser when your project only needs one:
npx playwright install chromium
npx playwright install firefox
npx playwright install webkit
Each Playwright version expects compatible browser binaries. Updating the package can therefore require running the install command again.
3. Inspect the macOS browser cache
On macOS, Playwright’s documented default browser cache is:
~/Library/Caches/ms-playwright
Inspect it with:
ls -la ~/Library/Caches/ms-playwright
An absent directory does not prove that browsers are missing. Playwright supports the PLAYWRIGHT_BROWSERS_PATH environment variable, which can move the cache elsewhere.
echo $PLAYWRIGHT_BROWSERS_PATH
find "$HOME/Library/Caches/ms-playwright" -maxdepth 2 -type d 2>/dev/null
If the variable prints a path, inspect that location instead. If it prints nothing, the default cache is the location to check.
4. Read the results correctly
| Check | Command | What it proves | What it does not prove |
|---|---|---|---|
| Project CLI | npx playwright --version |
The Playwright CLI resolves for this project | That browser binaries are installed |
| Browser binaries | npx playwright install --list |
Which Playwright browsers are installed and discoverable | That your test can launch successfully with every setting |
| Cache directory | ls ~/Library/Caches/ms-playwright |
Whether the default cache contains files | Whether a custom browser path is configured |
For a reliable diagnosis, run the CLI check first, then the browser listing command, then inspect the cache path only if you need to understand where files are stored.
5. A complete verification sequence
- Open Terminal.
- Change into the intended project directory.
- Run
npx playwright --version. - Run
npx playwright install --list. - Compare the listed browsers with the browsers your tests use.
- If a browser is missing, run
npx playwright install. - If the result is unexpected, inspect
package.json, the lockfile, andPLAYWRIGHT_BROWSERS_PATH.
cd /path/to/your/project
npx playwright --version
npx playwright install --list
printf 'PLAYWRIGHT_BROWSERS_PATH=%s\n' "${PLAYWRIGHT_BROWSERS_PATH:-}"
ls -la "${PLAYWRIGHT_BROWSERS_PATH:-$HOME/Library/Caches/ms-playwright}"
6. Troubleshooting common errors
npm ERR! could not determine executable to run or an equivalent resolution error
Cause: You are outside the intended project, Playwright is not declared there, or dependencies have not been installed.
Fix: Change to the repository root, inspect package.json, and run the project’s dependency installation command. For a new project, Playwright documents npm init playwright@latest as the setup path.
playwright: command not found
Cause: The binary is not on your shell PATH or the project-local executable is being bypassed.
Fix: Use npx playwright --version, yarn playwright --version, or pnpm exec playwright --version from the project directory instead of relying on a global command.
The version prints, but a test says an executable is missing
Cause: The npm package is installed but the browser binaries are not, or they belong to a different Playwright version.
Fix: Run npx playwright install --list, then npx playwright install. If you recently upgraded Playwright, reinstall the browsers for that version.
install --list shows nothing, but the cache directory exists
Cause: The project may be using a different PLAYWRIGHT_BROWSERS_PATH, a different user account, or a different Playwright installation.
Fix: Print the environment variable, run the commands from the same shell and project used by the tests, and avoid mixing global and project-local installations.
Permission denied while installing browsers
Cause: The configured browser path is not writable by your user.
Fix: Use a user-writable cache location and ensure the same variable is present when tests run. Avoid changing ownership blindly; the path used by the test process must match the path used during installation.
macOS or Node.js compatibility questions
The Playwright installation documentation accessed for this guide lists macOS 14 (Sonoma) or later and Node.js 22.x, 24.x, or 26.x. These requirements can change, so check the current official installation page before upgrading a system or CI image.
7. Performance, reliability, and cost considerations
- Run checks in the target environment. A package or browser installed for one macOS user, shell, Node version, or project is not automatically available to another.
- Pin dependencies with a lockfile. This makes the CLI version and browser requirements repeatable across machines.
- Cache browser binaries in CI. Browser downloads can be large; reuse a cache keyed to the Playwright version and operating system.
- Keep package and browser versions aligned. After dependency upgrades, rerun the browser installation command.
- There is no separate license charge for the commands. Your practical costs are download time, disk space, and the compute used by your tests or automation.
8. When you only need a screenshot
If your goal is a rendered image or PDF rather than running Playwright locally, ScreenshotNeo provides a website screenshot API and MCP server. It accepts one GET request with a URL and returns PNG, JPEG, WebP, or PDF.
Or skip the browser setup
Use the API without installing Node.js, Playwright, or browser binaries locally:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://playwright.dev/docs/intro -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://playwright.dev/docs/intro"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://playwright.dev/docs/intro' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
See the ScreenshotNeo API documentation for request options. Cookie banners, newsletter popups, and chat widgets are removed before the shot. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and response headers identify the page verdict and billing result. ScreenshotNeo also provides an MCP server for AI agents, including Claude and Cursor. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.
Create a free ScreenshotNeo account and get 1,000 screenshots each month with no card.
9. Frequently asked questions
Does npx playwright --version install Playwright?
No. It checks whether the CLI can be resolved. Install the project dependency first if it cannot be found.
Does installing Playwright automatically install browsers?
Do not assume so for an existing project. Verify with npx playwright install --list and install missing browsers explicitly.
Where are Playwright browsers stored on a Mac?
The documented default is ~/Library/Caches/ms-playwright. PLAYWRIGHT_BROWSERS_PATH can override it.
Should I install Playwright globally?
Prefer the project dependency and its package-manager command so the version is tied to the repository and lockfile.
Why does a browser work locally but fail in CI?
CI may use a different user, project directory, Node version, cache path, or browser set. Run both verification commands in CI and install or restore the matching binaries there.


