今天要编译一个其余nodejs版本的程序,而后就去github找找看看是否是有相应的nodejs版本管理工具,而后就找到了!node
nvm-windows
: https://github.com/coreybutler/nvm-windowsgit
主要分为安装和使用两个步骤~github
下载地址
: https://github.com/coreybutler/nvm-windows/releases/npm
本次安装的为1.17版本windows
解压双击nvm-setup.exe并赞成协议
工具
选择nvm安装路径
this
安装路径不可带空格url
选择nodejs路径
3d
确认安装便可
code
安装完确认
验证
nvm version
$ nvm --help Running version 1.1.7. 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 versio n. Optionally specify whether to install the 32 or 64 bit version (defaults to s ystem 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 rem ote download server. nvm list [available] : List the node.js installations. Type "available" at the end to see what can b e 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 [u rl] 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.
##nodejs nvm node_mirror https://npm.taobao.org/mirrors/node/ ##npm nvm npm_mirror https://npm.taobao.org/mirrors/npm/
nvm ls available
nvm ls 是nvm list的简写
## 安装最新版本 nvm install latest ## 安装指定版本 nvm install 14.15.0
nvm use 15.8.0
nvm uninstall 15.8.0
C:\Users\WangYang>nvm use 14.15.0 exit status 1: 'D:\Program' �����ڲ����ⲿ���Ҳ���ǿ����еij��� ���������ļ���
由于目录路径包含空格,仓库中回复是在1.1.8版本会解决,我这里是直接卸载从新安装了。