跳至主要內容

nvm 安装 NodeJS

Siona小于 1 分钟

nvm 包管理器安装 NodeJS (Mac)

# 列出所有的 node 版本
nvm list

# 安装 node
nvm install v18.19.0

# 使用安装的 node 版本
nvm use v18.19.0

# 查看当前 node 版本
node -v

# 没有 yarn,则使用 npm 安装 yarn
npm install -g yarn

# 查看 yarn 当前镜像源
yarn config get registry

# 设置 yarn 镜像源为淘宝镜像【最新镜像】
yarn config set registry https://registry.npmmirror.com
npm config set registry https://registry.npmmirror.com

# 将 npm 下载源恢复为官方源
npm config set registry https://registry.npmjs.org

镜像源 | npmmirror 镜像站open in new window