deno uninstall
deno uninstall is a tool that allows you to remove remote dependencies used in
your project, or an executable script from your machine.
There are two ways to use deno uninstall:
deno uninstall [PACKAGES]- remove dependencies specified indeno.jsonorpackage.jsondeno uninstall --global [SCRIPT_NAME]- uninstall executable script from you machine
deno uninstall [PACKAGES] Jump to heading
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] Jump to heading
When uninstalling a script, the installation root is determined in the following order:
--rootoptionDENO_INSTALL_ROOTenvironment variable$HOME/.deno
Examples Jump to heading
- Uninstall
serve
deno uninstall --global serve
- Uninstall
servefrom a specific installation root
deno uninstall -g --root /usr/local serve