windows使用nvm管理nodejs版本,安装nvm

nodejs版本管理最常使用的就是n和nvm,但是n并不支持Windows,所以需要使用nvm

nvm的Windows安装包下载地址

或者使用npm安装nvmw

npm install -g nvmw

nvm -h 显示帮助

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/npm/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.

使用nvm

nvm install v8.9.0  //安装8.9.0版本nodejs
nvm use v8.9.0 //当前命令行窗口切换nodejs到v8.9.0
nvm switch v8.9.0 //切换到8.9.0版本为默认使用版本
nvm list //显示本地已安装的nodejs版本
nvm list available//显示可安装的nodejs版本
nvm arch //查看nodejs运行为32位还是64位
nvm off //关闭nvm
nvm on //开启nvm
nvm version //nvm版本
nvm root c://nodePath //设置不同版本nodejs安装的根路径
posted @   一颗小行星-  阅读(153)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
点击右上角即可分享
微信分享提示