Bottom Line: It is 100% safe to delete the ms-playwright browser cache folder. Running npx playwright install will re-download fresh browser binaries anytime you need them.
What is the ms-playwright Cache Folder?
Located at ~/.cache/ms-playwright on Linux/macOS (and %LocalAppData%\ms-playwright on Windows), this folder is created by Microsoft Playwright (the web automation and E2E testing framework).
To run cross-browser tests, Playwright downloads custom headless builds of:
- Chromium: Headless Chrome browser binary (~280 MB).
- Firefox: Headless Firefox build (~250 MB).
- WebKit: Headless Safari engine build (~180 MB).
When updating @playwright/test across multiple projects, old browser binary builds accumulate, taking up 4 GB to 15 GB+.
Can You Delete ms-playwright Cache?
✅ Yes, it is completely safe to delete.
- No test script loss: Your test specs (
tests/*.spec.ts) and configuration files are 100% safe. - Auto-downloaded: Running
npx playwright installre-fetches the current browser binaries in one command.
How to Safely Clean Up Playwright Cache
Method 1: Delete via Terminal Command
# macOS / Linux
rm -rf ~/.cache/ms-playwright
# Windows (PowerShell)
Remove-Item -Recurse -Force $env:LocalAppData\ms-playwright
Method 2: Reinstall Fresh Playwright Browsers
npx playwright install
Related Guides
- Learn about deleting Cypress binary cache.
- How to clean up Chrome Code Cache.
- Check if you can clean npm cache.
Discussion
Loading authentication...