Skip to main content
On this page

deno remove 会从你的项目配置文件中移除依赖。它与 deno add 相反。

基本用法 Jump to heading

移除一个包:

›_
deno remove @std/path

一次移除多个包:

›_
deno remove @std/path @std/assert npm:express

从哪里移除依赖 Jump to heading

deno remove 会查看 deno.jsonpackage.json(如果 存在),并从它所在的文件中移除匹配的依赖项。

移除依赖不会将其从全局缓存中删除。若要回收磁盘 空间,请参见 deno clean

移除全局可执行文件 Jump to heading

传入 --global(或 -g)来移除全局安装的可执行脚本,与 deno uninstall --global 的作用相同:

›_
deno remove --global serve

全局移除只针对单个可执行文件,因此不能将 --global 与多个名称一起使用。使用 --root 来指定自定义安装根目录。

Command line usage:
deno remove [OPTIONS] [packages]...

Remove dependencies from the configuration file.

deno remove @std/path

You can remove multiple dependencies at once:

deno remove @std/path @std/assert

With the --global flag, this is an alias for deno uninstall --global and removes a globally installed executable script:

deno remove --global file_server

Options Jump to heading

--global, -g
Jump to heading

Remove globally installed package or module.

--lockfile-only
Jump to heading

Install only updating the lockfile.

--package-json
Jump to heading

Force using package.json for dependency management instead of deno.json.

--root<root>
Jump to heading

Installation root.

Dependency management options Jump to heading

--frozen<BOOLEAN>optional
Jump to heading

Error out if lockfile is out of date.

--lock<FILE>optional
Jump to heading

Check the specified lock file. (If value is not provided, defaults to "./deno.lock").

Disable auto discovery of the lock file.

Last updated on

Did you find what you needed?

编辑此页面
Privacy policy