How do I completely uninstall Deno and its cached packages
Asked Answered
G

3

7

I want to uninstall Deno and all of its cached packages. Where it caches its packages? And how to make sure that all of cached packages are uninstalled before installing a new version of Deno.

Grantley answered 3/6, 2020 at 5:51 Comment(0)
G
2

So here are deno cache locations on your system if you are used default install location:

By default, DENO_DIR is located in $HOME/.deno. However, the user could also change its location by modifying the $DENO_DIR environment variable. Explicitly setting DENO_DIR is recommended in production.

Also, this is hiararchy structure:

 DIRECTORIES
gen/: Cache for files compiled to JavaScript
deps/: Cache for remote url imported files
  |__ http/: For http imports
  |__ https/: For https imports

# FILES
deno_history.txt: History of Deno REPL

So, in general I think that you can clear your deno installation with simple deleting folder $HOME/.deno on your computer. Also, you could try simple uninstall command which depends on your system and install tool you use here are info about installing deno with different tools so try use your tool and correct uninstall command https://github.com/denoland/deno_install

Grassgreen answered 3/6, 2020 at 6:47 Comment(0)
O
7

To uninstall Deno, remove the ~/.deno and ~/.cache/deno directories:

rm -rf ~/.deno ~/.cache/deno

The cache directory may be in on another location, run deno info, to figure out where it is.

To upgrade Deno to the latest version, run deno upgrade.

To reload all cached modules for your app, run deno cache --reload myapp.ts.

See also deno --help or deno <command> --help.

Ocd answered 1/6, 2022 at 21:49 Comment(0)
G
2

So here are deno cache locations on your system if you are used default install location:

By default, DENO_DIR is located in $HOME/.deno. However, the user could also change its location by modifying the $DENO_DIR environment variable. Explicitly setting DENO_DIR is recommended in production.

Also, this is hiararchy structure:

 DIRECTORIES
gen/: Cache for files compiled to JavaScript
deps/: Cache for remote url imported files
  |__ http/: For http imports
  |__ https/: For https imports

# FILES
deno_history.txt: History of Deno REPL

So, in general I think that you can clear your deno installation with simple deleting folder $HOME/.deno on your computer. Also, you could try simple uninstall command which depends on your system and install tool you use here are info about installing deno with different tools so try use your tool and correct uninstall command https://github.com/denoland/deno_install

Grassgreen answered 3/6, 2020 at 6:47 Comment(0)
T
1

Actually, you don't need to uninstall deno if you want to update it. Deno already provides a command to upgrade to an existing version of deno.

For example, at the time of writing v1.0.5 is the latest release. As specified you can just use this command to upgrade deno -

deno upgrade --version 1.0.5
Tonyatonye answered 8/6, 2020 at 6:15 Comment(1)
Thanks for your input, but does this command fix the cached packages? I need a completely fresh environment i.e., by removing all cached packages.Grantley

© 2022 - 2024 — McMap. All rights reserved.