How to find and delete all node_modules folders on a Mac

Last updated June 14, 2026

node_modules folders are fully rebuildable from package.json, so deleting them is safe — a reinstall restores them. Find them with `find . -name node_modules -type d -prune`, and delete only stale ones (untouched 90+ days) to avoid breaking active projects. Tokki Clean does this as a GUI, sizing each before you trash it.

Find them, then delete safely

List first so you see what you're about to remove; -prune stops it from descending into nested copies:

Find (and size)

Delete only stale (90+ days)

Safe to delete

**/node_modules

Rebuildable from package.json via `npm/pnpm/yarn install`. Prefer deleting stale (90+ day) ones.

Do it in one click

Tokki Clean finds node_modules for you, sizes it, shows an itemized preview, and sends removals to the Trash — free, native, nothing leaves your Mac.

Download free for macOS

Apple silicon · macOS 12+ · no account

Frequently asked questions

Is it safe to delete node_modules?

Yes — it's generated from package.json. Run your package manager's install command to recreate it whenever you next work on the project.

How do I delete all node_modules folders at once?

From a parent directory: `find . -name node_modules -type d -prune -exec rm -rf {} +`. Add `-mtime +90` to limit it to stale projects.

More cleanup guides

Tokki Earn — coming soon

A tiny native macOS app. Opt in, keep 50% of every sponsored impression, cash out real money.

Apple silicon & Intel · off by default