node_modules is eating your disk

A single modern JS project carries 200-800 MB of node_modules. Twenty experiments from the last two years - and that is 10-15 GB of dependencies no one will ever run again. Rust and Python do the same with target and .venv; on a dev machine build artifacts routinely out-eat photos and video.

What regenerates for free

FolderEcosystemComes back with
node_modulesJS/TSnpm install / pnpm install
targetRustcargo build
.venv, __pycache__Pythonpip install -r requirements.txt
bin, obj.NETdotnet build
build, dist, .next, .turbobundlersnext build etc.
~/.npm, ~/.cargo/registry, pip cachepackage cachesre-downloaded on demand

Everything in the table is a cache in the broad sense: deleting it loses nothing but the time of the next build of that specific project.

Finding every copy

The problem is not one folder, it is thirty scattered across old projects. On a disk map they stand out immediately: uniform mid-size sectors under each project folder. Open your projects directory in CleanMyWin - each node_modules is a click away from the Recycle Bin, including paths deeper than 260 characters, on which Explorer's own delete gives up.

Package caches are cleaned by their own tools: npm cache clean --force, pnpm store prune, cargo cache -a (needs cargo-cache), pip cache purge, docker system prune.

Keeping it from growing back

Frequently asked

Is it safe to delete node_modules?

Yes. It is fully regenerated by npm install from package.json and the lockfile. You lose only the reinstall time of that project.

How do I find all node_modules on the drive?

Scan the drive with a space analyzer and look for repeating mid-size sectors under project folders - or search the map for the heaviest directories.

Sources and official documentation: Microsoft: Free up drive space in Windows, Microsoft: Storage Sense, Microsoft: WSL disk space, DaisyDisk, WizTree, WinDirStat, TreeSize

See where your terabytes went

One scan takes a minute. The first 24 hours are free.

Download for Windows

Write to us

We answer by email, usually within one business day.

Screenshots