deno clean | Deno DocsSkip to main content
On this page

deno clean

deno clean removes Deno's global module cache directory. See Modules for more information about how Deno caches dependencies.

Basic usage Jump to heading

>_
deno clean

Dry run Jump to heading

Preview what would be deleted without actually removing anything:

>_
deno clean --dry-run

Keeping what a project still needs Jump to heading

Use --except with one or more entry points to remove everything from the cache except the data those files need:

>_
deno clean --except main.ts

When to use this Jump to heading

Use deno clean when you need to:

  • Resolve issues caused by corrupted or stale cached modules
  • Free disk space used by cached dependencies
Command line usage:
deno clean [OPTIONS] [except-paths]...

Remove the cache directory ($DENO_DIR)

Options Jump to heading

Show what would be removed without performing any actions.

--except, -e
Jump to heading

Retain cache data needed by the given files.

Dependency management options Jump to heading

--node-modules-dir<MODE>optional
Jump to heading

Selects the node_modules directory mode for npm packages (not a path). One of: auto (create a local node_modules directory and install npm packages into it), manual (use the existing local node_modules directory, do not modify it), none (do not use a local node_modules directory; resolve npm packages from the global cache). Defaults to auto when the flag is passed without a value.

--node-modules-linker<MODE>
Jump to heading

Sets the linker mode for npm packages (isolated or hoisted).

--vendor<vendor>optional
Jump to heading

Toggles local vendor folder usage for remote modules and a node_modules folder for npm packages.

Last updated on

Did you find what you needed?

Edit this page
Privacy policy