asdf-deno: `deno install` doesn't behave according to the manual

On the script installer manual page it says:

The installation root is determined, in order of precedence:

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

However, when installing scripts using an asdf-installed version of deno, they are installed to $ASDF_DIR/installs/deno/<CURRENT_VERSION>/.deno/bin.

I am using macOS and the DENO_INSTALL_ROOT variable is not set in my environment.

Example output:

> deno install --name denoscript main.ts
Download https://deno.land/x/semver@v1.0.0/mod.ts
Download https://deno.land/std@0.57.0/flags/mod.ts
Download https://deno.land/std@0.57.0/_util/assert.ts
Compile file:///path/redacted/for/privacy/main.ts
✅ Successfully installed denoscript
/path/redacted/for/privacy/.asdf/installs/deno/1.1.0/.deno/bin/denoscript

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 32 (22 by maintainers)

Most upvoted comments

Hello! I recently run into simular issue. Official vscode extension expects deno cache to be located at ~/Library/Caches/deno (on macOS) but with asdf-installed deno its path is ~/.asdf/installs/deno/1.4.0/.cache/deno. So all imports marked red and autocomplete does not work.

As a workaround I explitly set DENO_DIR in my rc file

source /usr/local/opt/asdf/asdf.fish
export DENO_DIR="$HOME/Library/Caches/deno"

Oh, I’m sorry. I forgot this because I had taken some exams. I will be in an area with unstable internet access until the 29th, so it will be difficult to work until the 29th. Well, I’m very positive about addressing with this.