NVM Linux Windows nodejs 版本管理工具
阿新 • • 發佈:2021-11-24
nodejs 版本管理工具
nvm 在 Windows 安裝 直達:下載 setup.zip 解壓直接安裝
把全域性安裝的 nodejs 解除安裝
如果下載 nvm 1.18版本,目前或需要使用以管理員身份執行
使用
直接命令列 nvm 有說明,簡單明瞭
設定 映象
PS C:\WINDOWS\system32> nvm Running version 1.1.8. Usage: nvm arch : Show if node is running in 32 or 64 bit mode. nvm current : Display active version. nvminstall <version> [arch] : The version can be a specific version, "latest" for the latest current version, or "lts" for the most recent LTS 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 use "latest", "lts", or "newest". "newest" is the latest installed 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. PS C:\WINDOWS\system32> nvm node_mirror http://npm.taobao.org/mirrors/node/ PS C:\WINDOWS\system32> nvm npm_mirror http://npm.taobao.org/mirrors/npm/ PS C:\WINDOWS\system32>
node_mirror: http://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/
nvm use [version]命令使用報 exit status
類似的 exit status 1 或 5 ,都是以管理員身份執行解決。
use 成功過後,
nvm ls
出現的版本列表裡面的當前版本前面會有一個 星號
* 16.18.0 10.9.0