今天要編譯一個其餘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版本會解決,我這裏是直接卸載從新安裝了。