Windows
MSI 包安装
- Node-LTS-14.15.3
- Node-Latest-15.4.0
-
Scoop 安装
-
nvm-windows 包管理器
nvm-windows和Linux下的nvm不是一个项目
scoop install nvm
nvm list available
查看可安装版本-
nvm-windows 常见用法
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 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 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.
Linux
nvm 包管理器
```shell
下载
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
配置zsh
export NVM_DIR=”$([ -z “${XDG_CONFIG_HOME-}” ] && printf %s “${HOME}/.nvm” || printf %s “${XDG_CONFIG_HOME}/nvm”)” [ -s “$NVM_DIR/nvm.sh” ] && . “$NVM_DIR/nvm.sh” # This loads nvm
<a name="U5sxz"></a>
#### nvm 常见用法
```shell
- Install a specific version of Node.js:
nvm install node_version
- Use a specific version of Node.js in the current shell:
nvm use node_version
- Set the default Node.js version:
nvm alias default node_version
- List all available Node.js versions and highlight the default one:
nvm list
- Uninstall a given Node.js version:
nvm uninstall node_version
- Launch the REPL of a specific version of Node.js:
nvm run node_version --version
- Execute a script in a specific version of Node.js:
nvm exec node_version node app.js
更多用法查看nvm 官网