Skip to content

Free up disk space and delete node_modules on Windows

Developer machines fill up with folders that can be rebuilt: node_modules, dist, target, caches. Devpit finds them, shows their size, and deletes only what you tick.

Open it from the main menu with 1, or choose Free Up Disk Space.

The section opens a small menu with four rows.

Row What it does
Project Junk Looks through your projects folder for build output and dependency folders such as node_modules, dist, .next, target, bin, obj, __pycache__ and virtual environments.
Full Scan Everything in Project Junk, plus package manager caches (npm, yarn, pnpm, pip, NuGet, Gradle, Maven, Cargo, Go and more), Windows temporary files, editor caches, old Scoop versions, Docker leftovers and large files.
Choose folder… Scans a folder you pick instead of your default one.
Resume interrupted deletes Finishes anything a stopped clean left behind.

A folder only counts as junk when a marker file sits beside it. For example node_modules needs a package.json, and target needs a Cargo.toml. Devpit checks the marker again right before it deletes.

  1. Press 1 on the main menu.

  2. Choose Project Junk (or Full Scan).

  3. If you have not set a projects folder, Devpit asks. Pick a recent folder, type a path, or browse. Network paths are not allowed.

  4. Wait for the scan. You see the folders checked, the items found and the total size. The list fills in as it goes.

  5. Read the results. Devpit groups items by project and labels each one with a risk. Safe items start ticked. Tick or untick with Space.

  6. Press d. Devpit asks one question, for example “Delete 14 items (2.1 GB)?”, and shows how to get each kind back. The default answer is No. Press y to go on.

When it finishes you see a summary with the space freed, how many items went, and how long it took.

Every item has a label before you choose.

Label Meaning What happens when you delete it
Safe Rebuilds on its own, for example from a lockfile. Pre-ticked. Deleted for good. It is renamed first so an interrupted delete can be finished.
Review Safe to remove, but the next build is slower or downloads again. Moved to the Recycle Bin.
Careful May hold something you cannot get back. Never pre-ticked. Moved to the Recycle Bin, and you must type DELETE first.

Devpit never pre-ticks:

  • a project you touched in the last 7 days,
  • a folder it could not fully verify,
  • a file that only exists in the cloud (a OneDrive or Dropbox placeholder),
  • any Careful item.
Key What it does
↑ ↓ or k j Move
PgUp PgDn Move a page
Space Tick or untick the row (or a whole project)
a Tick all, or none
← → Fold or unfold a group
s Sort by size, name or age
/ Filter by text
o Show only items older than 30 days (the number can be changed in Settings)
d Delete the ticked items
r Scan again
Esc Stop a scan or delete, or go back

The mouse works here too: click a tick box, click a fold arrow, scroll with the wheel. See Keyboard and mouse for all keys.

Devpit tells you why in plain words, for example:

Couldn’t delete api\node_modules — it’s open in Code.exe. Close it and press R to retry.

  1. Close the program that has the folder open.
  2. On the summary, press R to retry the locked items.

Other reasons you may see: the item is on your never-touch list, it sits under a junction or symlink, it is on a network drive, or it no longer matches the rule that found it. Devpit never deletes through a link and never touches a drive root or the Windows folder.

If you press Esc during a delete, Devpit finishes the item it is working on and shows what was done. Nothing is left half removed. Choose Resume interrupted deletes later to finish the rest.

  • Review and Careful items: open the Recycle Bin and restore them.
  • Safe items: rebuild them. The confirmation shows how, for example run npm install for node_modules.
  • Devpit shows the last results for a folder straight away, marked “stale · rescanning”, while a fresh scan runs.
  • Settings lets you change the projects folder, the never-touch list and the “active project” window. See Settings.
  • Devpit keeps a running total of the space it has freed on your PC and shows it on this screen.
  • The full list of protections is on Safety and privacy.

Common questions

Is it safe to delete node_modules?

Yes. node_modules is rebuilt when you run npm install, pnpm install or yarn install. Devpit labels it Safe, only lists it when a package.json sits beside it, and shows the size before you confirm.

Why is one of my projects not ticked?

Devpit never pre-ticks a project you touched in the last 7 days, a folder it could not fully verify, or a cloud placeholder. You can still tick it yourself. The 7 day window can be changed in Settings.

Where do the deleted files go?

Safe items are deleted for good, after being renamed so an interrupted delete can be finished. Review and Careful items go to the Recycle Bin, so you can restore them.

What does stale, rescanning mean?

Devpit shows the results of your last scan of that folder straight away, marked stale, while a fresh scan runs. When the scan ends the list is updated.

Will Devpit delete my Docker volumes?

No, never. Devpit only offers Docker build cache, dangling images and stopped containers, and it refuses to run any Docker command that includes volumes.

How do I stop Devpit from ever touching a folder?

Add the folder to the never-touch list in Settings. Both the scanner and the deleter skip it, every time.