Skip to main content
On this page

deno 升级

Command line usage:
deno upgrade [OPTIONS] [VERSION]...

Upgrade deno executable to the given version.

Latest Jump to heading

deno upgrade

Specific version Jump to heading

deno upgrade 1.45.0
deno upgrade 1.46.0-rc.1
deno upgrade 9bc2dd29ad6ba334fd57a20114e367d3c04763d4

Channel Jump to heading

deno upgrade stable
deno upgrade rc
deno upgrade canary

The version is downloaded from https://dl.deno.land and is used to replace the current executable.

If you want to not replace the current Deno executable but instead download an update to a different location, use the --output flag:

deno upgrade --output $HOME/my_deno

Upgrade options Jump to heading

--dry-run Jump to heading

Perform all checks without replacing old exe.

--force Jump to heading

Short flag: -f

Replace current exe even if not out-of-date.

--output Jump to heading

The path to output the updated version to.

Options Jump to heading

--cert Jump to heading

Load certificate authority from PEM encoded file.

示例 Jump to heading

升级到最新版本 Jump to heading

使用此命令且不带任何选项即可将 Deno 升级到可用的最新版本:

$ deno upgrade
Checking for latest version
Version has been found
Deno is upgrading to version 1.38.5
downloading https://github.com/denoland/deno/releases/download/v1.38.5/deno-x86_64-apple-darwin.zip
downloading 100%
Upgrade done successfully

升级到指定版本 Jump to heading

你可以指定要升级到的特定版本:

$ deno upgrade --version 1.37.0
Checking for version 1.37.0
Version has been found
Deno is upgrading to version 1.37.0
downloading https://github.com/denoland/deno/releases/download/v1.37.0/deno-x86_64-apple-darwin.zip
downloading 100%
Upgrade done successfully

检查可用升级但不安装 Jump to heading

使用 --dry-run 标志可以查看将会升级到哪个版本,而不实际进行升级:

$ deno upgrade --dry-run
Checking for latest version
Version has been found
Would upgrade to version 1.38.5

--quiet 标志 Jump to heading

--quiet 标志在升级过程中抑制诊断输出。用在 deno upgrade 时,它将隐藏进度指示、下载信息和成功消息。

$ deno upgrade --quiet

这对于脚本环境或在 CI 流水线中想要更简洁的输出非常有用。

Canary 构建 Jump to heading

默认情况下,Deno 会从官方的 GitHub 发行版升级。你可以使用 --canary 构建标志来升级到最新的 canary 版本:

# 升级到最新的 canary 构建
$ deno upgrade --canary

你找到了你需要的东西吗?

编辑此页面
隐私政策