
Cache Cleaning Cheat Sheet
M. Zakyuddin Munziri
@zakiego
Originally written in Bahasa Indonesia.

M. Zakyuddin Munziri
@zakiego
Originally written in Bahasa Indonesia.

Fast pipelines don't eliminate shipping fear. Confidence comes from safe rollbacks, feature flags, and systems that behave predictably when things go wrong.

Debugging changed when I stopped reading logs manually and started using AI agents to correlate errors across observability data - faster root cause, fewer dead ends.

Framework debates waste team energy. Most frameworks are good enough, focus on engineering process, document tradeoffs, and stop treating tools like identity.
I really enjoy cleaning cache. It's satisfying to free up storage and ensure my development environment is as clean and efficient as possible. Over time, I've collected commands and tools to make it easier to manage and clear cache for various package managers.
Please note that you should check each command before running it and proceed at your own risk. Clearing cache can sometimes cause unexpected issues or the need to re-download packages and rebuild projects.
Despite these potential drawbacks, keeping cache clean helps maintain an efficient and organized workspace, ensuring that old or corrupted files don't interfere with development.
pnpm store prune
Ref: https://github.com/orgs/pnpm/discussions/4413
npm cache clean --force
Ref: https://www.warp.dev/terminus/clear-npm-cache
yarn cache clean
Ref: https://yarnpkg.com/cli/cache/clean
bun pm cache rm
Ref: https://bun.sh/docs/cli/pm
This tool allows you to list any node_modules directories in your system, as well as the space they take up. You can then select which ones you want to erase to free up space. Yay!
npkill
Ref: https://www.npmjs.com/package/npkill
Everything
docker system prune -a
# WARNING! This will remove:
# - all stopped containers
# - all networks not used by at least one container
# - all images without at least one container associated to them
# - all build cache
#
# Are you sure you want to continue? [y/N]
Container
docker container prune
# WARNING! This will remove all stopped containers.
# Are you sure you want to continue? [y/N]
Image
docker image prune -a
# WARNING! This will remove all dangling images.
# Are you sure you want to continue? [y/N]
The
-aflag removes all unused images, not just the dangling ones.
Volume
docker volume prune
# WARNING! This will remove anonymous local volumes not used by at least one container.
# Are you sure you want to continue? [y/N]
Build Cache
docker buildx prune
# WARNING! This will remove all dangling build cache.
# Are you sure you want to continue? [y/N]
Network
docker network prune
# WARNING! This will remove all custom networks not used by at least one container.
# Are you sure you want to continue? [y/N]
Ref:
nvm cache clear
Ref: https://github.com/nvm-sh/nvm?tab=readme-ov-file
Delete the .next folder
This command was created using ChatGPT. Do with your own risk!
find . -type d -name ".next" -exec rm -rf {} +
Delete this folder:
~/.cache/biome;C:\Users\<UserName>\AppData\Local\biomejs\biome\cache/Users/<UserName>/Library/Caches/dev.biomejs.biomeRef: https://biomejs.dev/guides/integrate-in-editor/#daemon-logs