瞎幾把前言:mac上能夠用n來管理node版本,私覺得n很好用。家裏的win7臺式機一直沒有安裝過任何管理工具,今天來給家裏電腦安裝一下nvw-windows,一個用於windows系統的node版本工具。node
電腦系統:系統win7 64位:git
nvw-windows的官網:https://github.com/coreybutler/nvm-windows/releasesgithub
首先從官網下載安裝包 https://github.com/coreybutler/nvm-windows/releases,我下了一個setup版本的,下下來是個壓縮包,解壓后里面是一個exe,安裝方式就如同一個常見的exe安裝包,雙擊運行便可:web
1.雙擊exe開始安裝:npm
2.下面這一步:配置nvm的安裝位置,任意一個你喜歡的位置均可以。windows
3.設置node的symlink文件夾位置。這個文件夾的名字必定不能含有中文或空格!ide
4.若是在安裝nvm以前,電腦上就已經安裝有node的,會看到以下圖,詢問你是否用nvm管理已經存在的node版本。必定要選‘是’,這個彈窗可能會出現好幾回,都點是。工具
5.安裝完成。看到以下圖:url
使用管理員權限打開一個命令行。輸入nvm v,會顯示nvm的版本號,有則表示安裝成功。spa
nvm arch [32|64]
: Show if node is running in 32 or 64 bit mode. Specify 32 or 64 to override the default architecture.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.nvm list [available]
: List the node.js installations. Type available
at the end to show a list of versions available for download.nvm on
: Enable node.js version management.nvm off
: Disable node.js version management (does not uninstall anything).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 uninstall <version>
: Uninstall 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 based on the value supplied to <arch>
. For information about using use
in a specific directory (or using .nvmrc
), please refer to issue #16.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.nvm node_mirror <node_mirror_url>
: Set the node mirror.People in China can use https://npm.taobao.org/mirrors/node/nvm npm_mirror <npm_mirror_url>
: Set the npm mirror.People in China can use https://npm.taobao.org/mirrors/npm/
好比安裝8.9.3:
nvm install 8.9.3
好比使用8.9.3:
nvm use 8.9.3
nvm node_mirror https://npm.taobao.org/mirrors/node/
nvm npm_mirror https://npm.taobao.org/mirrors/npm/
nvm ls
nvm ls available
(一)、nvm use 出現exit status 1