Developer Tools
Clear Node.js / npm Cache on Mac
Clearing the Node.js / npm cache is safe, because npm refills it the next time you install something. You can do it with two commands in Terminal, and your projects and global packages stay as they are.
Clear the Node.js / npm cache without guessing
Node.js / npm data usually takes 500 MB – 20 GB on a Mac. The free scan shows the exact size on your Mac before you change anything.
Free scan · No account · Nothing is deleted without your OK · Moves to the Trash first · macOS 14+
OptiClear is a Mac app. Copy this page's link and open it on your Mac.
Email me the link- Application
- Node.js / npm
- Typical data size
- 500 MB – 20 GB
- Category
- Developer Tools
- File Location
~/.npm
Clear it from inside Node.js / npm first
The safest way is the option built into the app: npm cache verify checks and trims the cache and npm cache clean --force empties it; neither touches node_modules in your projects or global packages.
Node.js / npm cache folders you can clear
These folders are rebuilt automatically, so removing them does not touch your own files.
Locations checked on a Mac with Node.js / npm installed.
What the Node.js / npm cache holds
Specific to Node.js / npm
The cache lives in the ~/.npm folder and holds downloaded packages, packages fetched by npx, and debug logs from npm commands. Everything in it is a copy that npm can download again, so none of it is your own work. Clearing it helps when that folder has grown to several gigabytes, or when installs fail with integrity or EINTEGRITY errors. The largest space user is usually the node_modules folder inside each project, which the cache does not touch. Global packages and your npm sign-in token are stored elsewhere and are not part of the cache.
What happens after you clear Node.js / npm cache
Run npm cache verify first to check and trim the cache, or npm cache clean --force to empty it completely. Neither command touches node_modules in your projects or your global packages. npm rebuilds the cache automatically, so your next install takes longer while it downloads packages again. You do not need to sign in again, because an npm account is only needed to publish packages and your token stays in place.
0 of 4 done
- Account and sync
- An npm account is only needed to publish packages; the token is stored in ~/.npmrc.
Try it without risk
- Download and scan for freeSee every Node.js / npm file and its size. No account needed.
- Clean free for 7 daysStart the 7-day free trial of the yearly plan inside the app.
- Keep it or cancelCancel in your App Store settings at least 24 hours before the trial ends and you won't be charged.
After the free trial, Pro costs $39.99 per year in your country's App Store; cancel any time.