A much more efficient and no-reinstall way to clean up cache files, trash, and build artifacts from developing applications using VS Code, Bun, Yarn, npm, etc. This often causes the C: folder to be full even though it doesn't store many personal files.
Here are the steps to clean up storage without reinstalling, but still produce a "like new" effect in the development environment:
bun pm cache cleanOr delete manually:
%USERPROFILE%\AppData\Local\bun\yarn cache cleanOr delete manually:
%LOCALAPPDATA%\Yarn\Cachenpm cache clean --forceOr delete manually:
%APPDATA%\npm-cacheFind and delete all build result & dependencies folders: Run in project root folder.
Get-ChildItem -Recurse -Include "node_modules", ".next", "dist", "build" | Remove-Item -Recurse -ForceOr manually:
- Open project folders one by one
- Delete:
node_modules.next,build,distbun.lockb,package-lock.json,yarn.lock(if you want to clean install later)
VSCode stores a lot of cache, history, and extensions:
%APPDATA%\Code\Cache
%APPDATA%\Code\CachedData
%APPDATA%\Code\User\workspaceStorageIf you don't mind losing your workspace history, you can delete it all.
Open Disk Cleanup:
- Press
Win + R, type%temp%, Enter- Delete all contents of the
tempfolder.
- Delete all contents of the
- Press
Win + R, typecleanmgr /low disk, Enter- Select
C: - Check all except
"Downloads" - Click
"OK"
- Select
Download WinDirStat, then:
- Run, select Local Disk (
C:) - Wait for scanning to complete
- Find folders with large block colors (usually
.cache,.npm,.bun, etc.) - Delete unimportant caches/deps
Windows has a Storage Sense feature that can automatically clear the cache:
Settings→System→Storage- Enable
Storage Sense - Click
Configure Storage Sense or run it now - Check:
- Temporary files
- Unused apps
- Downloads (optional)
- Run manually or set a schedule
If C: is small but you have a large D:, you can symlink node_modules or .bun to D: by default.
Example:
# Move npm cache to D
npm config set cache "D:\npm-cache" --global
# For buns (if using)
setx BUN_INSTALL "D:\bun"| Steps | Effects | Safe? |
|---|---|---|
| Clear Bun/Yarn/npm cache | 💥 Large | ✅ Safe |
Clear node_modules and build output |
💥 Large | ✅ Safe |
| Clean VSCode workspace & cache | ✅ Safe | |
| Disk Cleanup & %TEMP% | 💥 Large | ✅ Safe |
| Use WinDirStat | 🎯 Accurate Target | ✅ Safe |
| Enable Storage Sense | 🌀 Automatic | ✅ Safe |