Playwright and Puppeteer leave a whole browser behind every upgrade
Test browsers live outside Applications, one folder per build number, and upgrading pins a new one without removing the old. How to find and remove them safely.
If any project you have run tests in uses Playwright or Puppeteer, there is at least one complete browser on your disk that does not appear in Applications, does not appear in any menu, and was never mentioned to you.
du -sh ~/Library/Caches/ms-playwright ~/.cache/puppeteer 2>/dev/nullOn the Mac this guide was written on, with exactly one Playwright version ever installed, that is 539 MB:
| Folder | Size | What it is |
|---|---|---|
chromium-1228 | 344 MB | The full browser, used for headed runs |
chromium_headless_shell-1228 | 192 MB | A second, stripped build used for headless runs |
ffmpeg-1011 | 2.5 MB | Used to record videos of test runs |
Two browsers, for one version, because headed and headless are separate downloads. Add Firefox and WebKit, which a project installs if its config asks for them, and one version is comfortably past a gigabyte.
The number after the name is why it grows
Those folders are named by browser build number, and each Playwright release pins a specific build. Upgrading Playwright downloads the new build and leaves the old one exactly where it is, because an older project on the previous version still needs it.
That is sensible behaviour and it has an obvious consequence: three or four Playwright upgrades over a year means three or four full browser sets, and nothing ever decides that the oldest is no longer wanted.
The good news is that the folder is shared. Ten projects on the same Playwright version share one download, so the count grows with versions, not with projects.
Removing them
Playwright has a command for this, and it has two scopes that are easy to confuse.
# Only the browsers this project's version uses
npx playwright uninstall
# Every browser any Playwright install has ever downloaded
npx playwright uninstall --allThe second is the one that reclaims the accumulated years. Both are safe: the next npx playwright install, and most CI and test scripts run one, downloads what that version needs again.
If you would rather look before you act, the folder names are readable and you can delete individual build numbers by hand. Anything with a build number lower than the one your current projects use is dead weight.
ls -1 ~/Library/Caches/ms-playwrightPuppeteer keeps its own, in a different place
Puppeteer downloads to ~/.cache/puppeteer, with a folder per browser revision under it. It follows the same pattern for the same reason: the revision is pinned to the Puppeteer version, and upgrading adds a folder rather than replacing one.
Removing a revision folder is safe in the same way. The next install or first run downloads the revision that version expects.
Where this sits against everything else
Half a gigabyte per version is not the biggest thing on a developer's disk, and it is one of the most invisible, which is why it survives every cleanup. It is worth checking in the same pass as the node_modules folders and the package caches that never prune themselves, since all three are reclaimed the same way and none of them are in a project you would think to look at.
Common questions
Where does Playwright install browsers on a Mac?
In ~/Library/Caches/ms-playwright, with one folder per browser build number. They are not in the Applications folder and are not the Chrome or Safari you use day to day, so removing them affects nothing but tests.
Is it safe to delete the ms-playwright folder?
Yes. The browsers are redownloaded by npx playwright install, which test setups run anyway. The only cost is the download time on the next test run, and npx playwright uninstall --all is the tidier way to do the same thing.
Why are there two chromium folders?
Playwright ships a full Chromium for headed runs and a separate, smaller headless shell for headless runs. They are separate downloads of the same version, which is why one Playwright version can take over 500 MB before Firefox or WebKit are added.