nodejs多版本高效切换
对于 Windows 系统:
下载 nvm-windows:
访问 nvm-windows 发布页面,下载最新的nvm-setup.exe并安装。安装并使用 Node.js 20:
安装完 nvm 后,在命令行中执行:bash
1
2
3
4
5# 安装 Node.js 20 的最新版本
nvm install 20
# 使用刚安装的 Node.js 20
nvm use 20
对于 macOS 或 Linux 系统:
安装 nvm:
通过终端运行安装脚本:bash
1
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
安装完成后,关闭并重新打开终端。
安装并使用 Node.js 20:
bash
1
2
3
4
5# 安装 Node.js 20
nvm install 20
# 使用 Node.js 20
nvm use 20
- Title: nodejs多版本高效切换
- Author: UWI
- Created at : 2025-08-26 12:14:13
- Updated at : 2025-08-26 15:41:07
- Link: https://nbwsws.github.io/2025/08/26/个人杂谈/nodejs多版本高效切换/
- License: This work is licensed under CC BY-NC-SA 4.0.
Comments