← Back to microsoft/playwright
microsoft / playwright · Issue No. 42804
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/cli@0.1.21 install-browser chromium --dry-run # lists Chrome Headless Shell
npx @playwright/cli@0.1.21 install-browser chromium --no-shell --dry-run
Expected: --no-shell is accepted and Chromium is installed withoutchromium-headless-shell, matching the help text and npx playwright install chromium --no-shell.
Actual:
$ npx @playwright/cli@0.1.21 install-browser chromium --no-shell --dry-run
Unknown option: --shell
(exit 1)
The option is listed by the command itself:
$ npx @playwright/cli@0.1.21 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/cli@0.1.21 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/cli@0.1.21 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.ts declares the option under the['no-shell'].packages/playwright-core/src/tools/cli-client/minimist.ts rewrites any --no-<x> argument to<x> with value false, so --no-shell arrives as the key shell.shell option and reports it — the observed Unknown option: --shell. --only-shell is unaffected because its name carries no no- 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:
npx playwright install, but that was v1.47.1 before the flag--only-shell works,--shell.install-browser --dry-run listing that includes Chrome Headless Shell--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
Relay reads this issue against the repository's contribution signals: the files it is likely to touch, how the maintainers triage work this size, and what the first contribution would exercise.
The full analysis for this issue is still being assembled. Until then, the description above and the thread on GitHub are the most reliable context.