Global npm packages were 2.3 GB, split across two Node installs
npm install -g puts packages in a folder most people never look at. Measured at 2.27 GB, with a second global folder from a second Node install.
Global packages do not live in a project, so they never show up when you clean projects. They live in one folder per Node installation, and a Mac that has had Node installed more than one way has more than one of those folders.
The biggest ones
| Package | Size |
|---|---|
openclaw | 362 MB |
cline | 322 MB |
@openai (Codex CLI) | 310 MB |
expo-cli | 209 MB |
firebase-tools | 154 MB |
vercel | 148 MB |
AI coding agents are the new heavyweights here. Each bundles its own runtime pieces, and three of them together outweigh everything else in the folder.
Find your global folders
npm root -g
npm ls -g --depth=0
# Every global folder on the machine, whichever Node put it there
ls -d /usr/local/lib/node_modules /opt/homebrew/lib/node_modules ~/.nvm/versions/node/*/lib/node_modules 2>/dev/null
du -sh "$(npm root -g)"/* | sort -h | tailnpm root -g only reports the folder for the Node that is first on your PATH. The ls line catches the others, which is where the surprise usually is.
Removing what you no longer use
npm uninstall -g expo-cliexpo-cliis a good first candidate. The global CLI was retired in favour ofnpx expo, so a copy installed years ago is dead weight.- If you run two Node installs, pick one. Each has its own global folder, and removing a version manager's Node takes its globals with it. See version managers taking up space.
- Tools you only run occasionally are better through
npx, with the caveat in the npx cache.
Common questions
Where are global npm packages stored on a Mac?
In the lib/node_modules folder of whichever Node is active. That is /usr/local/lib/node_modules for the official installer or n, /opt/homebrew/lib/node_modules for Homebrew, and inside ~/.nvm for nvm.
How do I list global npm packages?
Run npm ls -g --depth=0. It lists packages for the Node currently on your PATH only, so check other Node installs separately.
Why do I have two global node_modules folders?
Because Node is installed more than once, for example through Homebrew and through a version manager. Each install keeps its own global packages.
Is it safe to delete global npm packages?
Yes. Uninstalling one only removes that command-line tool. Your projects keep their own dependencies.