在哪里可以看到deno下载的软件包? [英] Where can I see deno downloaded packages?

查看:418
本文介绍了在哪里可以看到deno下载的软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 deno 的新手,目前正在探索deno的最低可行项目.我想让npm在文件夹node_modules中下载npm软件包,类似地,我想在目录中看到 deno软件包.在我当前的项目中,我看不到任何下载的软件包.请建议我在哪里寻找deno包裹.如果我写dep.ts文件提到所有Deno软件包,是否可以将相同Deno软件包用于其他项目.我的问题与Java处理中的MavenGradle有点类似.这意味着我想知道deno是否在OS中维护一个文件夹,以便所有软件包都可以下载并在许多项目中使用.我想检查Windows 10中包含deno软件包的目录.

I am new to deno and currently exploring for a minimum viable project in deno. I want to like npm which downloads the npm packages inside the folder node_modules, similarly I want to see the deno packages in a directory. In my current project I do not see any downloaded packages. Please suggest me where to look for deno packages. If I write dep.ts file to mention all the deno packages, can I use the same deno packages for some other projects. My question is bit similar to what Maven or Gradle in java handles. It means I want to know whether deno maintains a single folder in OS so that all the packages are downloaded and used in many projects. I want to check the directory containing the deno packages in windows 10.

推荐答案

导入内容缓存在$DENO_DIR

来自文档:

Deno将远程导入缓存在由 $DENO_DIR环境变量.它默认为系统的缓存 如果未指定$DENO_DIR,则为目录.下次您运行 程序,将不会进行下载.如果程序没有更改, 也不会重新编译.默认目录为:

Deno caches remote imports in a special directory specified by the $DENO_DIR environmental variable. It defaults to the system's cache directory if $DENO_DIR is not specified. The next time you run the program, no downloads will be made. If the program hasn't changed, it won't be recompiled either. The default directory is:

  • 在Linux/Redox上:$XDG_CACHE_HOME/deno$HOME/.cache/deno
  • 在Windows上:%LOCALAPPDATA%/deno(%LOCALAPPDATA% = FOLDERID_LocalAppData)
  • 在macOS上:$HOME/Library/Caches/deno如果出现故障,则回退至 $HOME/.deno
  • On Linux/Redox: $XDG_CACHE_HOME/deno or $HOME/.cache/deno
  • On Windows: %LOCALAPPDATA%/deno (%LOCALAPPDATA% = FOLDERID_LocalAppData)
  • On macOS: $HOME/Library/Caches/deno If something fails, it falls back to $HOME/.deno

依靠外部服务器进行开发很方便,但是却很脆弱 在生产中. 生产软件应始终捆绑其 依赖性.在Deno中,这是通过将$ DENO_DIR签入您的来完成的 源代码管理系统,并将该路径指定为$ DENO_DIR 运行时环境变量.

Relying on external servers is convenient for development but brittle in production. Production software should always bundle its dependencies. In Deno this is done by checking the $DENO_DIR into your source control system, and specifying that path as the $DENO_DIR environmental variable at runtime.


什么是deno命令,用于安装本文档中提到的所有依赖项 dep.ts文件

what is the deno command to install all the dependencies mentioned in dep.ts file

要仅安装导入dep.ts 在您的一个文件中并运行:

To install just import dep.ts in one of your files and run:

deno run index.js

这篇关于在哪里可以看到deno下载的软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆