October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

Puppeteer Browsers CLI Constructor: Options and Setup

Use Puppeteer's browser CLI from npx for routine installs, or instantiate its public CLI class when embedding the command interface. Constructor options, browser selection, caches and troubleshooting explained.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For most tasks, use the shell interface: run npx @puppeteer/browsers --help, then use its install, launch, list or clear commands. Instantiate the public CLI class only when embedding the command-line interface in another program or customizing its defaults. The constructor accepts either a cache-path string or an options object; it is not the same as the internal InstalledBrowser constructor.

Use the CLI from a shell

The standalone @puppeteer/browsers package is the simplest starting point. npx uses the project-installed copy when available; otherwise it installs and runs the package. To keep a version fixed, include it in the package specifier.

npx @puppeteer/browsers --help
npx @puppeteer/[email protected] --help
npx @puppeteer/browsers install --help
npx @puppeteer/browsers launch --help
npx @puppeteer/browsers list --help
npx @puppeteer/browsers clear --help

The official guide documents these example commands: Puppeteer Browsers.

npx @puppeteer/browsers install chrome@stable
npx @puppeteer/browsers install chrome@117
npx @puppeteer/browsers install chromedriver@canary
npx @puppeteer/browsers list
npx @puppeteer/browsers clear

Browser identifiers take browser-specific build IDs, versions, milestones or channels. A documentation example such as chrome@117 illustrates the syntax; it does not guarantee that a particular build remains available. Check the current command help and choose a channel for a moving release or a specific build when reproducibility matters.

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

Standalone CLI or Puppeteer’s wrapper

The standalone invocation is npx @puppeteer/browsers. Puppeteer also documents a wrapper command, npx puppeteer browsers, for operations such as installing a browser alongside required dependencies. Do not assume every option applies identically across wrappers, browsers and platforms; follow the help for the command you are running.

Install Chrome system dependencies on Ubuntu or Debian

For Chrome on Ubuntu or Debian, Puppeteer documents:

npx puppeteer browsers install chrome --install-deps

This option is limited to the documented Chrome-on-Ubuntu/Debian case and requires root privileges. It is not a general-purpose dependency installer for other operating systems or browser products.

Rank #2
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

Instantiate the public CLI class

Direct construction is useful when a Node.js program needs to embed or customize the CLI. The documented constructor takes an optional first argument—a cache path string or an options object—and an optional second readline.Interface. Use the exports and type definitions from the exact package release installed in your project: the implementation on the moving main branch can change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import {CLI} from '@puppeteer/browsers';

const cli = new CLI({
  cachePath: '/tmp/browser-cache',
  scriptName: 'my-browser-tool',
});

The path-only shorthand is new CLI('/tmp/browser-cache'). These examples show the documented constructor shape; they are not a guarantee that other package versions expose identical types.

Constructor options

Argument or field Type Meaning and default
First argument as a string string Shorthand for the browser cache path.
cachePath string Browser cache directory. Defaults to process.cwd() when omitted from the constructor options.
scriptName string Name presented for the command. Defaults to @puppeteer/browsers.
version string CLI version value. Defaults to the package’s compiled version.
prefixCommand {cmd: string; description: string} Customizes or prefixes the command presentation.
allowCachePathOverride boolean Whether the CLI may override the configured cache path. Defaults to true.
pinnedBrowsers Partial<Record<Browser, {buildId: string; skipDownload: boolean}>> Defines browser build IDs and skip-download flags for the CLI’s pinned-browser workflow.
Second argument: rl readline.Interface Optional readline interface. The options object may also include rl.

These constructor details are documented in the CLI implementation. Since that URL tracks main, confirm the installed package’s API before relying on a field in production.

Choose a browser version and cache location

Channel versus pinned build

A channel such as stable expresses intent to use that release channel, while an explicit build ID or version is more suitable when you need a fixed browser build. Browser names and accepted build identifiers are browser-specific, and availability can change; consult the current command help and Puppeteer’s supported browser information rather than assuming Chrome, Firefox and driver identifiers behave alike.

Default cache versus custom cache

The constructor’s cachePath default is the current working directory. Separately, Puppeteer’s configuration guide says Puppeteer has stored downloaded browsers in ~/.cache/puppeteer since v19.0.0 and documents configuring a different directory. These are distinct contexts: a direct CLI instance’s default and Puppeteer’s package-managed download configuration should not be conflated.

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.

Puppeteer recommends configuration files to customize defaults. Supported file locations and formats, environment overrides, and download settings are described in its configuration guide. Proxy settings HTTP_PROXY, HTTPS_PROXY and NO_PROXY are environment-only; proxy downloads require the optional proxy-agent peer dependency. Puppeteer configuration files and environment variables are ignored by puppeteer-core. If a configuration change affects browser download options, rerun the install/postinstall step using the documented command npx puppeteer browsers install.

Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

Downloaded browser versus system browser

A Puppeteer-managed download gives the package a browser build associated with its release and configuration. Using a system-installed browser is a separate setup choice where supported; the documented CLI install examples do not establish that all system browsers or browser/platform combinations are interchangeable. Check the relevant Puppeteer API and browser support mapping for the version you use.

Keep Puppeteer and its browser compatible

Puppeteer’s supported-browser page says v20.0.0 and later use Chrome for Testing, and v23.0.0 and later download and work with stable Firefox. It provides a version mapping and specifies that if an exact Puppeteer version is absent, the supported browser version is the one listed for the immediately prior Puppeteer version. Check the mapping for your actual release rather than treating these milestone statements as a current exact version pair: Supported browsers.

Do not construct InstalledBrowser directly

CLI is the public command-line interface class discussed above. InstalledBrowser represents a different part of the browser API, and its constructor is marked internal. The Puppeteer API documentation warns: “Third-party code should not call the constructor directly or create subclasses that extend the InstalledBrowser class.” Use the documented public API instead: Puppeteer Browsers API.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting

  • The command is missing or uses an unexpected version: Check whether the project has a local @puppeteer/browsers install. Use an explicit package version with npx @puppeteer/browsers@VERSION --help when you need a reproducible CLI version.
  • A browser build cannot be installed: Confirm the browser identifier and build ID/channel are valid for that browser, and verify current availability with command-specific help. A documentation example is not a promise of continuing availability.
  • Downloaded browser is not where expected: Distinguish the direct CLI constructor’s cachePath default (process.cwd()) from Puppeteer’s configured download cache, whose documented default since v19.0.0 is ~/.cache/puppeteer.
  • Proxy downloads fail: Verify the relevant proxy environment variables and, for proxy downloads, that the optional proxy-agent peer dependency is installed.
  • Changing configuration did not change the browser download: Rerun the browser install/postinstall operation after changing browser download options; Puppeteer’s guide documents npx puppeteer browsers install.
  • System dependency installation fails: The documented --install-deps path is for Chrome on Ubuntu/Debian and needs root privileges. It is not a cross-platform flag.
  • The browser and Puppeteer disagree: Check the supported-browser mapping for the exact Puppeteer release and select a compatible browser build.
  • Your constructor code no longer type-checks: Inspect the exports and type definitions in the installed package version; the implementation reference on main is rolling.

Or skip the browser setup

If your goal is simply to capture a website screenshot rather than run Puppeteer locally, ScreenshotNeo provides a screenshot API. Its one-call cURL example is:

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

See the ScreenshotNeo documentation for request options. It accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups and chat widgets before capture; each step can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and responses identify the page verdict and billing status in headers. An MCP server provides take_screenshot, get_page_info and capture_pdf for AI agents and MCP clients. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots. Sign up for 1,000 free screenshots a month with no card.

Frequently Asked Questions

Can I use `CLI` without installing a browser first?

The class exposes CLI behavior, but browser installation and availability depend on the command and browser build you choose; use the command help for the operation you need.

Does `cachePath` change Puppeteer’s configuration-file cache automatically?

No. The constructor option belongs to a directly instantiated `CLI`; Puppeteer’s managed downloads are configured separately through Puppeteer configuration.

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

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.