Repository navigation
Description
playwright-cli install-browser advertises --no-shell in its own --help, but passing it
fails with Unknown option: --shell and exit code 1. Reproduced on the latest release, 0.1.21.
Because every spelling is rejected, there is currently no supported way to install Chromium
through playwright-cli without also downloading chromium-headless-shell — which is exactly
what the flag is for. That is an extra ~261 MB on disk for a setup that only ever runs headed.
The sibling flag --only-shell, on the same command, is accepted — so the failure is specific to
the negated form, not to install-browser.
Reproduction (uses --dry-run, so nothing is downloaded):
npx @playwright/[email protected] install-browser chromium --dry-run # lists Chrome Headless Shell
npx @playwright/[email protected] install-browser chromium --no-shell --dry-runExpected: --no-shell is accepted and Chromium is installed without
chromium-headless-shell, matching the help text and npx playwright install chromium --no-shell.
Actual:
$ npx @playwright/[email protected] install-browser chromium --no-shell --dry-run
Unknown option: --shell
(exit 1)
The option is listed by the command itself:
$ npx @playwright/[email protected] install-browser --help
Options:
--only-shell only install headless shell when installing chromium
--no-shell do not install chromium headless shell
A plain --dry-run confirms the shell is part of a Chromium install:
$ npx @playwright/[email protected] install-browser chromium --dry-run
Chrome for Testing 154.0.8037.0 (playwright chromium v1246)
FFmpeg (playwright ffmpeg v1011)
Chrome Headless Shell 154.0.8037.0 (playwright chromium-headless-shell v1246)
Every spelling tried on 0.1.21, each exiting 1:
| Argument | Output |
|---|---|
--no-shell |
Unknown option: --shell |
--shell=false |
Unknown option: --shell |
--noShell |
Unknown option: --noShell |
--no-shell=true |
uncaught exception (below) |
--only-shell |
accepted, exit 0 |
$ npx @playwright/[email protected] install-browser chromium --no-shell=true --dry-run
<prefix>/playwright-core/lib/tools/cli-client/minimist.js:56
throw new Error(`boolean option '--${key}' should not be passed with '=value', use '--${key}' or '--no-${key}' instead`);
^
Error: boolean option '--no-shell' should not be passed with '=value', use '--no-shell' or '--no-no-shell' instead
at minimist (<prefix>/playwright-core/lib/tools/cli-client/minimist.js:56:15)
at program (<prefix>/playwright-core/lib/tools/cli-client/program.js:64:45)
at main (<prefix>/@playwright/cli/playwright-cli.js:36:3)
That message recommends --no-shell, the spelling that fails, and surfaces as an unhandled stack
trace rather than a CLI error.
Likely cause. Both pieces are present on current main, which matches the behaviour being
identical on 0.1.19 and 0.1.21:
packages/playwright-core/src/tools/cli-daemon/commands.tsdeclares the option under the
literal key['no-shell'].packages/playwright-core/src/tools/cli-client/minimist.tsrewrites any--no-<x>argument to
key<x>with valuefalse, so--no-shellarrives as the keyshell.- Validation finds no declared
shelloption and reports it — the observedUnknown option: --shell.--only-shellis unaffected because its name carries nono-prefix.
Environment: @playwright/cli 0.1.21 (bundling playwright-core
1.64.0-alpha-1789764292000), run via npx. Also reproduced identically on 0.1.19 installed
globally. Linux (Arch-based), kernel 7.2.6, x86_64, Node v26.8.2.
Related, not duplicates:
- [Bug]: error: unknown option '--no-shell' #34487 — same error phrase on
npx playwright install, but that was v1.47.1 before the flag
existed (fixed by upgrading). Here the flag exists on the latest release,--only-shellworks,
and the rejected name comes back mangled as--shell. - why playwright-cli install-browser no useful, but use npx playwright install chrome #41631 — shows the same
install-browser --dry-runlisting that includes Chrome Headless Shell
alongside Chromium; it does not touch--no-shell.
Workaround — skip the call when the browser is already installed, so the shell is not pulled
in on repeat runs:
compgen -G "$PLAYWRIGHT_BROWSERS_PATH/chromium-*" >/dev/null ||
playwright-cli install-browser chromium
Activity
VolodymyrLinuxovich commentedon Sep 20, 2026
I reproduced this on current
mainand have a focused fix with a regression test ready. The CLI parser treats--no-shellas negatingshell, althoughinstall-browserdeclares a literalno-shellboolean option. The change recognizes declaredno-*flags while preserving ordinary negation such as--no-verbose.The dry-run CLI test passes and confirms Chromium is listed without Chrome Headless Shell. The build, TypeScript check, and ESLint check also pass. The tested branch is at https://github.com/VolodymyrLinuxovich/playwright/tree/fix/cli-install-browser-no-shell. Could a maintainer approve this for community contribution or assign #42804 to me? I can open the PR after approval, as requested in
CONTRIBUTING.md.chore: mark v0.1.22 (#473)