19 lines
579 B
Markdown
19 lines
579 B
Markdown
|
||
安装
|
||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
|
||
|
||
|
||
3. **安装指定版本的 Node.js**:
|
||
nvm install 18.16.0 # 安装具体版本
|
||
nvm install --lts # 安装最新的LTS版本
|
||
nvm install node # 安装最新稳定版
|
||
|
||
4. **列出所有可用版本**:
|
||
nvm ls-remote # 查看远程所有版本
|
||
nvm ls # 查看本地已安装版本
|
||
|
||
5. **切换 Node.js 版本**:
|
||
|
||
nvm use 18.16.0 # 切换到指定版本
|
||
nvm use --lts # 切换到LTS版本
|
||
nvm use node # 切换到最新稳定版 |