赞
踩
运行以下命令下载并运行 NVM 安装脚本:
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
上面的命令将安装 NVM 并在 .bashrc 文件中进行所有必需的环境设置。
激活所有设置:
source ~/.bashrc
nvm --version # 检查安装版本
nvm install node # 安装最新的 Node.js
nvm install @版本号 # 安装指定版本的 Node.js
# 如
nvm install v21.7.0
nvm install node --lts # 安装最新稳定版本的 Node.js
nvm list # 列出已安装的 Node.js 版本
nvm use @版本号 # 使用指定版本的 Node.js
nvm run @版本号 app.js 运行具有特定 Node.js 版本的 Node 应用程序
nvm uninstall @版本号 # 卸载node.js
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。