LinuxmacOSWindows

Where Does Deno Store Cached Dependencies?

Where Deno keeps DENO_DIR with remote modules, npm packages and caches on each OS, and how to wipe it.

Last updated

Deno caches remote modules, npm tarballs, type check output and compiled artifacts in one directory called DENO_DIR: ~/.cache/deno on Linux, ~/Library/Caches/deno on macOS, %LOCALAPPDATA%\deno on Windows. Every project shares it, so disk use stays flat as repos multiply.

Setting DENO_DIR relocates everything, which teams use to vendor dependencies per project or aim the cache at fast local disks. The cache is content addressed and safe for concurrent processes, so sharing one directory across parallel CI jobs works rather than corrupts.

Where Deno stores this, by platform

Linux
~/.cache/deno

Respects $XDG_CACHE_HOME when set, falls back to ~/.deno on failure. Override per project with DENO_DIR=./deno_dir. Subfolders: deps, npm, gen, plus kv and webstorage for app data.

macOS
~/Library/Caches/deno

Same DENO_DIR override and deno clean behavior as Linux. Finder hides Library, so use Go > Go to Folder.

Windows
%LOCALAPPDATA%\deno

Paste %LOCALAPPDATA%\deno into Explorer. Same layout and overrides as other platforms.

Frequently asked questions

How do I clear the Deno cache?

Run deno clean. It empties the whole DENO_DIR safely: everything inside is refetchable or regenerable. Use --reload= URLs for surgical refreshes of single modules instead of wiping when debugging one bad import.

Where is my Deno app local data, not just modules?

Local storage, session storage, KV data and the REPL history all live inside DENO_DIR (webstorage/, kv/, repl.log). Copy the whole directory to migrate an app state, or delete those subfolders to reset app data while keeping the module cache.

Notice an outdated path? Let us know.