window 下安装 nvm

目录
[隐藏]

1. 下载 nvm window 安装包

从 nvm Github 的 releases 页面下载 setup 版本。

地址: https://github.com/coreybutler/nvm-windows/releases

下载完成后解压,执行 exe 程序进行安装。安装完成后打开 cmd 命令行,输入 nvm v,看到版本号输出,则说明安装成功。

2. nvm 使用

Usage:

  nvm arch                     : Show if node is running in 32 or 64 bit mode.
  nvm install <version> [arch] : The version can be a node.js version or "latest" for the latest stable 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.
  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 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.

3. nvm 常用命令

  • nvm install 安装指定版本的 nodejs

如安装 v8.9.4 版本:

nvm i v8.9.4
  • nvm use 使用指定版本的 node
    nvm use 8.9.4

  • nvm node_mirror 使用淘宝 node 镜像

nvm node_mirror https://npm.taobao.org/mirrors/node/
  • nvm npm_mirror 使用淘宝 npm 镜像
nvm npm_mirror https://npm.taobao.org/mirrors/npm/
  • 查看当前电脑上已经安装的 node 版本
nvm ls
  • 查看当前系统架构下可下载的 node 版本
nvm ls available
点赞 (0)

发表评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据