A web developer's Mac, measured: Node was installed three times
Where a web developer's disk goes: node_modules, npm caches, several Node installs, browsers and build output. Measured totals and what to clear first.
A web developer's disk fills with the same few things, in roughly the same order, whatever the framework. This is the order, with numbers from one real Mac.
The measured list
| What | Size | Guide |
|---|---|---|
| node_modules in every project | 7.7 GB | node_modules |
| Chrome, profiles and cache | 10.8 GB | Chrome |
| npm download cache | 2.5 GB | npm cache |
| npx cache | 2.4 GB | npx cache |
| Node versions under nvm | 4.5 GB | nvm |
| Global npm packages | 2.4 GB | global packages |
| Build output in projects | 4.6 GB | frontend build caches |
| Yarn and pnpm stores | 1.5 GB | Yarn and pnpm |
| Playwright browsers | 0.5 GB | Playwright |
Three Node installs
The finding worth repeating from this Mac: Node was installed three separate ways. nvm held eight versions from 10.24.1 to 24.9.0. The n version manager had put 22.14.0 in /usr/local. Homebrew had installed 23.11.0. Each keeps its own global packages, so every globally installed tool existed up to three times, and the shell only ever used one of them.
which -a node
ls ~/.nvm/versions/node 2>/dev/null
ls /usr/local/n/versions/node 2>/dev/null
brew list --versions node 2>/dev/nullPick one manager and remove the others. Version managers taking up space compares them.
The browser is a dev tool too
Chrome was the largest single app footprint on this Mac: 7.0 GB of profile data across 14 profiles and 3.8 GB of cache. Test profiles for different accounts are the usual cause. Service worker storage from local development builds is a large part of it, and the Chrome guide covers clearing it.
A monthly routine
npm cache clean --force
rm -rf ~/.npm/_npx
pnpm store prune 2>/dev/null
yarn cache clean 2>/dev/null
# node_modules in projects untouched for 90 days
find ~/Documents -name node_modules -type d -prune -mtime +90 2>/dev/nullThe broader routine is in a monthly Mac cleanup and the whole developer setup in Mac storage setup for developers.
Related: Dash docsets taking up space on Mac.
Common questions
What takes the most space on a web developer's Mac?
On the Mac measured, browser data and node_modules, followed by npm caches and multiple Node installs.
Why do I have several versions of Node installed?
Because Node can arrive through nvm, n, Homebrew and the official installer, and each keeps its own copies and global packages.
Is it safe to delete node_modules in old projects?
Yes. It is rebuilt by npm install from the lockfile when you need the project again.
How often should a web developer clean their Mac?
Monthly is enough for most. Package caches and old node_modules are where the regular gains are.