nvm命令-2023年6月29日
日期:2023年6月29日
- 下载安装。
https://github.com/coreybutler/nvm-windows/releases
按需下载安装:
注意选择安装位置,不要有中文,且不建议安装到C盘。
- 安装完成后,打开cmd命令行。输入
nvm -v
nvm /?
完成命令自学。
nvm arch : Show if node is running in 32 or 64 bit mode.
(翻译:查看当前node环境是版本,32位/64位)
nvm current : Display active version.
(翻译:查看当前正在运行的node版本)
nvm debug : Check the NVM4W process for known problems (troubleshooter).
(翻译:balabalabala)
nvm install <version> [arch] : The version can be a specific version, "latest" for the latest current version, or "lts" for the
most recent LTS version. Optionally specify whether to install the 32 or 64 bit version (defaults
to system arch). Set [arch] to "all" to install 32 AND 64 bit versions.
Add --insecure to the end of this command to bypass SSL validation of the remote download server.
(翻译:安装指定版本nodejs。例如:nvm install LTS 64 表示默认安装最新稳定,64位版本)
nvm list [available] : List the node.js installations. Type "available" at the end to see what can be installed. Aliased as ls.
nvm on : Enable node.js version management.
nvm off : Disable node.js version management.
nvm proxy [url] : Set a proxy to use for downloads. Leave [url] blank to see the current proxy.
Set [url] to "none" to remove the proxy.
nvm node_mirror [url] : Set the node mirror. Defaults to https://nodejs.org/dist/. Leave [url] blank to use default url.
nvm npm_mirror [url] : Set the npm mirror. Defaults to https://github.com/npm/cli/archive/. Leave [url] blank to default url.
nvm uninstall <version> : The version must be a specific version.
nvm use [version] [arch] : Switch to use the specified version. Optionally use "latest", "lts", or "newest".
"newest" is the latest installed version. Optionally specify 32/64bit architecture.
nvm use <arch> will continue using the selected version, but switch to 32/64 bit mode.
nvm root [path] : Set the directory where nvm should store different versions of node.js.
If <path> is not set, the current root will be displayed.
nvm [--]version : Displays the current running version of nvm for Windows. Aliased as v.