nvm管理node版本(windows+linux)

1. windows

去github 下载最新的 nvm 找到 nvm-setup.zip 点击下载

安装

2. linux

复制代码
sudo apt install curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> ~/.bashrc
source ~/.bashrc
# 验证安装
nvm --version
nvm install <version>
node --version
# 列出已安装的 Node.js 版本
nvm ls
nvm use <version>
# 更新
(
  cd "$NVM_DIR"
  git fetch --tags origin
  git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`
) && \. "$NVM_DIR/nvm.sh"
相关推荐
故渊at2 分钟前
第十二板块:Android 系统启动与初始化 | 第二十九篇:Init 进程、RC 脚本与属性服务(Property Service)
android·linux·内存映射·权限控制·init进程·rc脚本·属性服务
志栋智能4 分钟前
从云端到边缘:无处不在的超自动化巡检需求
运维·自动化
shen1213820 分钟前
【cdp】windows持久化运行cdp浏览器
windows·agent·cdp
某林21228 分钟前
ROS2 并行编译死锁与 Linux 后台声卡/提权踩坑实录:大型轮足机器人架构复盘
linux·架构·机器人·iassc
无足鸟ICT29 分钟前
【RHCA+】末行模式
linux
W优化大师29 分钟前
Windows电脑频繁弹广告怎么彻底清除?从定位来源到卸载残留的完整方法
windows·电脑
拼搏的小浣熊34 分钟前
【通用教程】Windows\+Linux\+银河麒麟系统 固定静态IP地址|解决打印机扫描IP变动、网络掉线问题
linux·网络·windows·麒麟·固定ip·麒麟系统·统信系统
小生不才yz38 分钟前
Shell脚本精读 · S02-02 | 转义、续行与注释
linux
BJ_Bonree40 分钟前
聊点技术 | 从“统一接入“到“统一调度“:重塑可观测平台的数据底座
运维·人工智能·可观测性
w32963627141 分钟前
使用 OpenCode 在 Windows 上加速安装 Playwright 的完整指南
windows·git