On this page
deno clean
deno clean 会移除 Deno 的全局模块缓存目录。有关 Deno
如何缓存依赖的更多信息,请参阅
模块。
基本用法 Jump to heading
deno clean
试运行 Jump to heading
在不实际删除任何内容的情况下预览将要删除的内容:
deno clean --dry-run
保留项目仍需要的内容 Jump to heading
使用一个或多个入口点与 --except 一起,移除缓存中的所有内容,
但保留这些文件所需的数据:
deno clean --except main.ts
何时使用此命令 Jump to heading
在以下情况下使用 deno clean:
- 解决由损坏或过期的缓存模块引起的问题
- 释放缓存依赖占用的磁盘空间
deno clean [OPTIONS] [except-paths]...Remove the cache directory ($DENO_DIR)
Options Jump to heading
--dry-runShow what would be removed without performing any actions.
--except, -eRetain cache data needed by the given files.
Dependency management options Jump to heading
--node-modules-dir<MODE>optionalSelects 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>Sets the linker mode for npm packages (isolated or hoisted).
--vendor<vendor>optionalToggles local vendor folder usage for remote modules and a node_modules folder for npm packages.
Last updated on