# What fills a web developer’s Mac, from node_modules to Docker

Who it’s for · Updated 21 November 2026. By Mohit Nippanikar, who makes SiftMac.

## The short answer

- **Dependencies and Docker, mostly.** A web developer’s Mac fills with a `node_modules` folder in every project ever cloned, package-manager caches, browsers downloaded by test runners, old Node versions and Docker’s disk image.
- **What it costs you:** one install per project you come back to, and a download the next time a test runner or image needs it.
- **Keep:** lockfiles, `.env` files, Docker volumes holding local databases, and anything you haven’t pushed.

## 1. What fills a web developer’s Mac

Node keeps a full copy of each project’s dependencies inside the project, and every tool around it keeps a cache of its own. The usual list:

| What | Where it lives | Comes back? | More |
| --- | --- | --- | --- |
| `node_modules` in old projects | Inside each project | Yes, from the lockfile with `npm ci`, `pnpm install`, `yarn` or `bun install` | [node_modules](https://siftmac.com/safe-to-delete/node-modules) |
| Framework build caches | `.next`, `.nuxt`, `.svelte-kit`, `.turbo`, `.parcel-cache`, `.angular` | Yes, on the next build or dev run | [Next.js .next](https://siftmac.com/safe-to-delete/nextjs-cache) |
| npm’s cache | `~/.npm` | Yes | [npm cache](https://siftmac.com/safe-to-delete/npm-cache) |
| pnpm, Yarn and Bun caches | pnpm’s store (`pnpm store path` prints it), `~/Library/Caches/Yarn`, `~/.bun` | Yes | [pnpm](https://siftmac.com/safe-to-delete/pnpm-store), [Yarn](https://siftmac.com/safe-to-delete/yarn-cache), [Bun](https://siftmac.com/safe-to-delete/bun-cache) |
| Browsers for tests | `~/Library/Caches/ms-playwright`, `~/Library/Caches/Cypress` | Yes, installed again by the test runner | — |
| Node versions | `~/.nvm/versions/node`, or your version manager’s folder | Only by installing them again | — |
| Docker images, build cache and containers | `Docker.raw`, inside Docker Desktop’s container | Images pull again; volumes don’t | [Docker.raw](https://siftmac.com/safe-to-delete/docker-raw) |
| Browser caches | Chrome, Firefox and Safari cache folders | Yes | [Chrome](https://siftmac.com/safe-to-delete/chrome-cache), [Firefox](https://siftmac.com/safe-to-delete/firefox-cache), [Safari](https://siftmac.com/safe-to-delete/safari-cache) |
| Editor caches and installed updates | VS Code’s and Cursor’s folders, `~/Library/Caches/<app ID>.ShipIt` | Yes | [VS Code](https://siftmac.com/safe-to-delete/vs-code-cache), [Cursor](https://siftmac.com/safe-to-delete/cursor-update-cache) |
| Electron build downloads | `~/Library/Caches/electron`, `~/Library/Caches/electron-builder` | Yes | — |

Measure the shared caches, biggest last:

```
du -sh ~/.npm ~/.bun ~/.nvm ~/Library/Caches/Yarn ~/Library/Caches/pnpm ~/Library/Caches/ms-playwright ~/Library/Caches/Cypress ~/Library/Caches/electron 2>/dev/null | sort -h
```

Then every `node_modules` under your projects folder (change `~/code`), and what Docker could give back:

```
find ~/code -name node_modules -type d -prune -exec du -sh {} + 2>/dev/null | sort -h | tail -20
docker system df
```

## 2. What’s safe to clear, and what to keep

### Clear with each tool’s command

- **npm:** `npm cache clean --force`. npm never trims its cache by itself; it grows with every new package. `npm cache verify` is gentler: it garbage-collects data nothing needs and checks the rest.
- **pnpm:** `pnpm store prune` removes packages no project on the Mac references. Projects aren’t affected, and anything removed downloads again on the next install.
- **Yarn and Bun:** `yarn cache clean` and `bun pm cache rm`.
- **Playwright:** it already deletes browser versions no install uses; `npx playwright uninstall --all` removes the rest.
- **Cypress:** `npx cypress cache prune` keeps only the version in use, and `npx cypress cache clear` removes every cached binary.
- **Framework caches:** delete `.next`, `.nuxt`, `.svelte-kit` or `.turbo` in projects you’re not running.
- **Node versions:** `nvm ls`, then `nvm uninstall <version>` for any version no project pins.

### Docker: free space from inside

Docker Desktop keeps every image, container, volume and build layer in one disk image, so deleting files in Finder can’t shrink it. `docker system prune` removes stopped containers, networks no container uses, dangling images and unused build cache; `-a` also removes every image no container uses, and volumes stay unless you add `--volumes`. `docker builder prune` clears the build cache on its own. To cap the disk image, lower the disk usage limit in Docker Desktop’s Resources settings, where you can also move the image to another drive.

### Keep

- Lockfiles (`package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`, `bun.lock`): they’re how `node_modules` comes back the same.
- `.env` files and local certificates. They’re usually not in git, so deleting a project folder takes them with it.
- Docker volumes, unless you know they’re throwaway. `docker volume ls` lists them; a local Postgres or Redis keeps its data there.
- Unpushed work: `git status` and `git branch -vv` before deleting any project.

## 3. How SiftMac helps a web developer

SiftMac’s [developer files](https://siftmac.com/features/developer-files) list `node_modules` and the caches of Next.js, Nuxt, SvelteKit, Parcel, Turborepo and Angular only where a `package.json` sits beside them, and only in projects you haven’t changed for 1, 3 or 6 months. A monorepo counts as one project: if any package in it changed recently, none of its folders is listed.

- Caches for Yarn, pnpm, node-gyp, TypeScript, Playwright, Cypress and Electron in `~/Library/Caches` get the verdict **Rebuilds**. pnpm’s store itself is left to `pnpm store prune`.
- Browser caches are app caches: cleared only while that browser is closed, and checked again right before cleaning ([in use](https://siftmac.com/features/in-use-protection)).
- With Docker turned on in Settings, SiftMac asks Docker what it can reclaim and uses its prune commands for unused images, build cache and stopped containers (a You decide item). Volumes are never touched, and [System Data](https://siftmac.com/features/system-data) shows the disk image’s total.
- Nothing here is ticked until you tick it.

npm’s `~/.npm`, `~/.bun` and `~/.nvm` live outside `~/Library/Caches`, and SiftMac doesn’t clean them. The [space map](https://siftmac.com/features/space-map) shows their size, so you can clear them with the commands above.

## 4. A cleanup routine for a web developer’s Mac

1. Push your work and list the projects you’re in this month.
2. Run `docker system df`, then prune what’s reclaimable; keep volumes.
3. In old projects, delete `node_modules` and framework caches, or run `npx npkill` to pick them from a list.
4. Clear package caches: `npm cache verify` (or `npm cache clean --force`), `pnpm store prune`, `yarn cache clean`, `bun pm cache rm`.
5. Prune test browsers with Playwright’s and Cypress’s own commands.
6. Remove Node versions you don’t use.
7. Open your current project, install, and start the dev server once to check it still builds.

## Questions

### Is it safe to delete node_modules?

Yes, in any project with a lockfile. `npm ci` (or `pnpm install`, `yarn`, `bun install`) recreates it with the same versions. Without a lockfile you may get newer versions than before, so commit one first.

### Why didn’t Docker.raw get smaller when I deleted images?

`Docker.raw` is a sparse disk image: Finder shows its maximum size, while `du -h` shows what it really uses. Free space with `docker system prune` or `docker image prune -a`, and lower the disk usage limit in Docker Desktop if you want a hard cap.

### Does npm cache clean slow anything down?

Only the next installs, which download packages again instead of copying them from the cache. Nothing in your projects changes.

## How SiftMac handles it

SiftMac lists `node_modules` and framework build caches only in projects you haven’t changed for months and only next to a `package.json`, and frees Docker space with Docker’s own prune commands when you turn that on, never touching volumes.

Download: https://siftmac.com/SiftMac.dmg (scanning is free, and so is the first 2 GB of cleaning).

## Sources

- [npm: npm cache](https://docs.npmjs.com/cli/commands/npm-cache)
- [pnpm: pnpm store prune](https://pnpm.io/cli/store)
- [Playwright: managing browser binaries](https://playwright.dev/docs/browsers)
- [Cypress: advanced installation and the binary cache](https://docs.cypress.io/app/references/advanced-installation)
- [Docker: docker system prune](https://docs.docker.com/reference/cli/docker/system/prune/)
- [Docker Desktop: settings (disk usage limit, disk image location)](https://docs.docker.com/desktop/settings-and-maintenance/settings/)

## Related

- [Is it safe to delete node_modules?](https://siftmac.com/safe-to-delete/node-modules)
- [Is it safe to delete Docker.raw?](https://siftmac.com/safe-to-delete/docker-raw)
- [Xcode DerivedData, node_modules and Docker: what’s safe to delete on a developer’s Mac](https://siftmac.com/guides/developer-files-on-mac)
- [What fills a developer’s Mac, and what’s safe to delete](https://siftmac.com/for/developers)
- [Developer files: what SiftMac clears, and how it knows it comes back](https://siftmac.com/features/developer-files)

Canonical: https://siftmac.com/for/web-developers
