Guides

Is it safe to delete node_modules, caches and build folders on a Mac?

One rule covers almost every case: if a tool can rebuild it from a file in your project, it's safe to delete. Updated 20 October 2026.

The rule

A folder is safe to delete when a tool recreates it from something you keep, such as package.json, Cargo.toml or Package.swift. It's not safe when it's the only copy of something, like your own files, a database, or a container's data.

Project folders

Check the folder sits next to its project file before you delete it. A folder called target or build somewhere else might be something else entirely.

Download caches

These hold packages so the next install doesn't download them again. Deleting them is safe and only costs download time. Each tool has its own clean command:

Not safe to delete blindly

Old projects first

The easy win is projects you haven't opened in months. Their node_modules and build folders can be hundreds of megabytes each, and you can rebuild them in a minute if you ever go back.

CheckMac's Suggested Cleanup sheet: a plain-language summary of what it found, then build output and package caches with their sizes and how each one is rebuilt. CheckMac's Suggested Cleanup sheet: a plain-language summary of what it found, then build output and package caches with their sizes and how each one is rebuilt.

See it on your own Mac. CheckMac maps any folder or drive as a sunburst or treemap, and Suggested Cleanup lists the caches and build output a tool can rebuild, with what each one costs you. Scanning is free, and Suggested Cleanup is free for its first three runs.

Download CheckMac See how it works

More guides