Find and delete node_modules and build folders safely

Akichi is a disk space analyzer and cleaner for macOS and Windows, for developers whose project folders have filled the disk. It lists node_modules, Rust target, Python .venv, build folders and package caches under Can be rebuilt, with each item’s size and a reason. Nothing is deleted permanently.

One forgotten project can hold a gigabyte of dependencies, and a dozen of them can fill a laptop. Most of it is generated, so it can be rebuilt. Here is how to tell, and how to delete without regret.

Akichi: Clean Up with a reason for each suggestion and a note from Laya

Why these folders are safe to remove

A folder is safe to delete when a tool can regenerate it from something you keep. For node_modules, that is package.json and a lockfile. For a build folder, it is your source code. The cost is time: the next install or build runs again.

What to look for, and how to rebuild it

node_modulesRebuild with npm ci, pnpm install or yarn install.
dist, build, .nextRebuild with the project’s build command.
Rust targetcargo build recreates it. cargo clean removes it.
Python .venvRecreate with python -m venv .venv and install from your requirements file.
CocoaPods Podspod install.
Xcode DerivedDataXcode rebuilds it on the next build.
Package cachesnpm, pip, Gradle, Cargo and Homebrew refill their caches when needed.

When to stop and check first

Find them by hand

On Mac or Linux, list every node_modules below the current folder without descending into them:

find . -name node_modules -type d -prune -exec du -sh  +

On Windows PowerShell:

Get-ChildItem -Recurse -Directory -Filter node_modules -ErrorAction SilentlyContinue |
  Select-Object FullName

This tells you where they are. It does not tell you which projects you still use, so you still need to look at each one.

How Akichi helps

Akichi is a disk space analyzer and cleaner for macOS and Windows. A scan maps the whole disk, and Clean Up lists these developer leftovers under Can be rebuilt: node_modules, Rust target folders, Python .venv, Xcode DerivedData, CocoaPods Pods, build and .next folders, and the npm, pip, Gradle, Cargo and Homebrew caches.

Every item shows its size and a plain reason, such as which project it belongs to and that your tools can recreate it. You select what you want, and Move to Trash asks first and shows the files. After that you get Undo, and Put Back in History returns a folder to where it was, so a wrong guess costs one click.

Scanning and the explanations run on your computer. Akichi does not upload your file names or your code.

Questions

Is it safe to delete node_modules?
Yes, as long as the project has a package.json and ideally a lockfile. node_modules is generated by npm, pnpm or yarn, and running an install recreates it. Do not delete it if you edited files inside it by hand or the project has no way to reinstall, for example offline.
Will I lose anything if I delete a build folder like dist, build or .next?
Normally not. They hold generated output that your build command recreates. Check that the folder is not committed to git, and that nothing in it is hand-written, before you delete it.
How do I find the biggest node_modules folders?
Use a disk map or a command. On Mac or Linux, find . -name node_modules -type d -prune lists them, and du -sh on each shows the size. Akichi finds them for you during a scan and lists them under Can be rebuilt with their sizes.
Does Akichi delete anything permanently?
No. Akichi moves items to the Trash, shows Undo, and keeps Put Back in History. You decide when to empty the Trash.
Which developer folders does Akichi recognise?
node_modules, Rust target folders, Python .venv, Xcode DerivedData, CocoaPods Pods, build folders and .next, plus npm, pip, Gradle, Cargo and Homebrew caches.