How to Uninstall a Browser with Puppeteer
Remove Puppeteer’s downloaded browsers, trim old cache entries, or uninstall the project dependency. Learn which cleanup option fits and what it removes.
To remove every browser binary managed by Puppeteer’s browser cache, run npx @puppeteer/browsers clear. To remove only cached Chrome and Firefox versions that are no longer current, use Puppeteer’s trimCache() API. Removing the puppeteer package from a project is a separate package-manager task; clearing the browser cache does not uninstall that dependency.
First decide what you want to uninstall
Puppeteer and its downloaded browsers are separate things. The puppeteer package normally downloads Chrome for Testing and chrome-headless-shell. Starting with Puppeteer v19, its default browser cache is $HOME/.cache/puppeteer, unless your configuration changes it. See the official installation guide.
| Goal | Use | What it removes |
|---|---|---|
| Remove all browser binaries managed by the browsers CLI | npx @puppeteer/browsers clear |
All installed browsers in the cache managed by that CLI |
| Keep current browser versions but clean old ones | trimCache() |
Non-current Chrome and Firefox binaries in the configured cache |
| Stop depending on Puppeteer in this project | Your package manager’s uninstall or remove operation | The project dependency; browser-cache cleanup is separate |
Clear all Puppeteer-managed browser downloads
The browser-management CLI provides a list command to inspect installed browsers and a clear command to remove all installed browsers it manages. Run these commands from a terminal:
npx @puppeteer/browsers list
npx @puppeteer/browsers clear
The first command is optional. Use it to inspect the cache before clearing it. The second is the direct cleanup operation when you want all managed browser installations removed. See the Puppeteer browsers API and CLI documentation.
What to expect afterward
- Your project’s Puppeteer dependency remains installed.
- A later launch that requires one of the removed local browsers may fail until you install a browser again.
- Other files in your project and browsers installed outside the cache managed by this CLI are not the target of this command.
- If you use a customized cache directory, make sure the command is operating on the cache you intend to clean.
Trim old browser versions and keep the current ones
trimCache() is for cache housekeeping when you still need Puppeteer’s current browser versions. It removes non-current Chrome and Firefox binaries from the configured cache. The API is exposed by @puppeteer/browsers:
import { trimCache } from '@puppeteer/browsers';
await trimCache();
Run this in an environment where @puppeteer/browsers is installed and configured to use the cache you intend to trim. The operation does not check whether other Puppeteer versions sharing that cache still need the binaries it removes. If projects use different Puppeteer versions but share one cache, clearing or trimming it can make another project’s expected browser unavailable. Review the API documentation before using this for shared-cache maintenance.
Find the browser cache before manual cleanup
Puppeteer’s documented default cache path is $HOME/.cache/puppeteer from v19.0.0 onward. The configured cacheDirectory or PUPPETEER_CACHE_DIR environment variable can override that location. Check your project and runtime configuration before assuming the default applies. The configuration guide describes these settings.
Prefer the documented CLI or API when possible. If you inspect or remove cache files manually, first verify the resolved directory and confirm no other Puppeteer version or project depends on it. A custom cache path can explain why clearing a presumed default directory did not free the space you expected.
Remove the Puppeteer package from your project
If by “uninstall a browser with Puppeteer” you mean removing Puppeteer itself, use the package manager that owns the dependency in your project. The browser CLI command clears downloaded browser binaries; it does not remove the package dependency. Conversely, removing a dependency should not be treated as a documented browser-cache cleanup operation.
Check whether puppeteer is a direct dependency or part of a larger workspace, then use that package manager’s normal remove or uninstall command. The research-backed documentation does not establish one universal package-removal command across package managers and workspace layouts, so use the command appropriate to your project.
Keep automation without a local browser download
If you want to continue browser automation but avoid Puppeteer managing a local browser download, Puppeteer documents puppeteer-core for remote browser connections or separately managed browsers. You can provide a locally managed executable explicitly when launching. Puppeteer says its downloaded browser is the one it works best with and does not guarantee identical behavior with other browser versions; check compatibility for your setup. See the installation guide.
Or skip the browser setup
For website screenshots, ScreenshotNeo is a website screenshot API and MCP server from Yorker Media. One GET request returns a PNG, JPEG, WebP, or PDF. Use it when your task is capturing a page rather than running general-purpose browser automation. The ScreenshotNeo docs describe the API and its options.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Cookie and consent banners, newsletter popups, and chat widgets are removed before the shot. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing; each response identifies the page verdict and billing status in headers. An MCP server lets AI agents use the take_screenshot, get_page_info, and capture_pdf tools. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots.
Sign up for 1,000 free screenshots a month, with no card required.
Troubleshooting
The clear command does not remove the cache I expected
Cause: The cache may be in a custom location set through cacheDirectory or PUPPETEER_CACHE_DIR, or the command may be using a different configuration than your project.
Fix: Inspect the project’s Puppeteer configuration and environment, then list the browsers managed by the CLI in the same environment before clearing.
Puppeteer cannot launch after cleanup
Cause: The browser binary required by the project was removed.
Fix: Install the browser version configured for that Puppeteer setup again, or connect to a separately managed or remote browser as appropriate. Puppeteer’s own downloaded browser is the version it recommends for best compatibility.
Another project stopped launching after trimming the cache
Cause: Multiple Puppeteer versions or projects share a cache, and trimCache() does not determine whether another version needs a removed binary.
Fix: Restore or reinstall the browser version required by that project. For future cleanup, account for all versions sharing the cache before trimming it.
Removing the package did not reclaim the browser files
Cause: The package dependency and downloaded browser cache are distinct cleanup targets.
Fix: Remove the dependency with your package manager, then use the browsers CLI to list and clear the managed browser cache if that is also your goal.
The cache is smaller than expected after trimming
Cause: trimCache() removes non-current Chrome and Firefox binaries; it is not the documented command for clearing every installed browser.
Fix: If you intend to remove all browsers managed by the CLI, use npx @puppeteer/browsers clear after confirming the relevant cache configuration.
Performance, reliability, and cost considerations
- Disk space: Puppeteer’s installation guide estimates Chrome for Testing downloads at about 170 MB on macOS, 282 MB on Linux, and 280 MB on Windows. These are download-size estimates; actual disk use depends on installed browsers and cache contents. Source: Puppeteer installation guide.
- Setup time: Removing a browser can reduce local disk use, but a future run may need to download or provision a browser again. Keep the required browser available in build or deployment environments that launch Puppeteer.
- Reliability: A shared cache makes cleanup affect multiple projects. Check each project’s Puppeteer version and browser requirements before trimming or clearing shared binaries.
- Compatibility: A separately managed browser can avoid Puppeteer’s local download, but Puppeteer does not guarantee the same behavior across arbitrary browser versions.
- Cost: The cleanup CLI and API manage local browser files; the cited documentation does not state a service fee for these operations. If replacing local screenshot capture with a hosted screenshot API, compare the service’s plan and request accounting with your workload.
Frequently asked questions
Does uninstalling Puppeteer delete Chrome?
Do not assume package removal also clears Puppeteer’s downloaded browser cache. Treat the dependency and browser binaries as separate cleanup tasks, and use the browser-management CLI for the cache.
Can I remove only one installed browser?
The browser API exposes uninstall(options) for browser removal. Consult the API documentation for the required options and the specific browser installation you want to remove.
Is trimCache() the same as clearing the cache?
No. It removes non-current Chrome and Firefox binaries while retaining current versions according to the configured cache. Use the CLI clear command when you intend to remove all browsers managed by that CLI.
Will Puppeteer work with any browser version after cleanup?
No such guarantee is documented. Puppeteer works best with its downloaded browser and does not guarantee identical behavior with other versions.


