Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc: Cached files aren't in DENO_DIR #5782

Closed
LarryBattle opened this issue May 23, 2020 · 3 comments
Closed

Doc: Cached files aren't in DENO_DIR #5782

LarryBattle opened this issue May 23, 2020 · 3 comments

Comments

@LarryBattle
Copy link

LarryBattle commented May 23, 2020

Deno Version

1.0.2

OS

Linux (Ubuntu 18+)

Problem

I installed Deno today to play around with it and after running some example code, Deno told me it compiled my typescript file but didn't state where it stored it.

$ deno run --reload example.ts 
Compile file:///home/me/deno_test/example.ts
hello world

The documentation says the default deno directory is at $HOME/.deno but only the deno binary was there.

$ find $HOME/.deno -type f
/home/me/.deno/bin/deno
`DENO_DIR` defaults to `$HOME/.deno` but can be set to any path to control where
generated and cached source code is written and read to.

The code actually says it uses the OS cache directory.

// We use the OS cache dir because all files deno writes are cache files
// Once that changes we need to start using different roots if DENO_DIR
// is not set, and keep a single one if it is.
let default = dirs::cache_dir()

After more digging I finally discovered the deno info command to reveal the true location of the cached content.

Expected

$ deno info
DENO_DIR location: "/home/me/.deno"
Remote modules cache: "/home/me/.deno/deps"
TypeScript compiler cache: "/home/me/.deno/gen"

Actual

$ deno info
DENO_DIR location: "/home/me/.cache/deno"
Remote modules cache: "/home/me/.cache/deno/deps"
TypeScript compiler cache: "/home/me/.cache/deno/gen"

Possible Solutions:

To save Deno newbies time in finding the location for the cached content, could the setup_your_environment.md documentation be updated to mention that the deno info command will reveal the true location of your cached files?

Or maybe include a verbose option in the deno run command that prints out the location of the cached files. verbose logging reveals the location deno run --log-level debug --reload example.ts

@lucacasonato
Copy link
Member

As you mentioned the information in the documentation is out of date. DENO_DIR defaults to the cache directory, not ~/.deno.

@ry
Copy link
Member

ry commented May 23, 2020

Doc improvements are very welcome!

@bartlomieju
Copy link
Member

Docs updated in #5835

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants