Spec-Zone.ru › Deno 2

deno uninstall

deno uninstall [PACKAGES]

Remove dependencies specified in deno.json or package.json:

›_
deno add npm:express
Add npm:express@5.0.0

cat deno.json
{
  "imports": {
    "express": "npm:express@5.0.0"
  }
}
›_
deno uninstall express
Removed express

cat deno.json
{
  "imports": {}
}
Tip

You can also use deno remove which is an alias to deno uninstall [PACKAGES]

You can remove multiple dependencies at once:

›_
deno add npm:express jsr:@std/http
Added npm:express@5.0.0
Added jsr:@std/http@1.0.7

cat deno.json
{
  "imports": {
    "@std/http": "jsr:@std/http@^1.0.7",
    "express": "npm:express@^5.0.0",
  }
}
›_
deno remove express @std/http
Removed express
Removed @std/http

cat deno.json
{
  "imports": {}
}
Info

While dependencies are removed from the deno.json and package.json they still persist in the global cache for future use.

If your project contains package.json, deno uninstall can work with it too:

›_
cat package.json
{
  "dependencies": {
    "express": "^5.0.0"
  }
}

deno remove express
Removed express

cat package.json
{
  "dependencies": {}
}

deno uninstall --global [SCRIPT_NAME]

Uninstall serve

›_
deno uninstall --global serve

Uninstall serve from a specific installation root

›_
deno uninstall -g --root /usr/local/bin serve
Command line usage:
deno uninstall [OPTIONS] [name-or-package] [additional-packages]...

Uninstalls dependencies or an executable script in the installation root's bin directory.

deno uninstall @std/dotenv chalk
deno uninstall --global file_server

To change the installation root, use --root flag:

deno uninstall --global --root /usr/local cowsay serve

The installation root is determined, in order of precedence:

  • --root option
  • DENO_INSTALL_ROOT environment variable
  • $HOME/.deno

Options

--global, -g

Remove globally installed packages or modules.

--lockfile-only

Install only updating the lockfile.

--package-json

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

--root<root>

Installation root.

Dependency management options

--frozen<BOOLEAN>optional

Error out if lockfile is out of date.

--lock<FILE>optional

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

--no-lock

Disable auto discovery of the lock file.

Last updated on March 10, 2025

© 2018–2025 the Deno authors
Licensed under the MIT License.
https://docs.deno.com/runtime/reference/cli/uninstall

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API