1. 安装

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

注意:如果不能用去github上找
github地地址:https://github.com/nvm-sh/nvm#installing-and-updating

2. nvm命令

  • 查看远程node版本
nvm ls-remote
  • 列出所有安装的版本
nvm ls 
  • 安装最新稳定版 node
nvm install stable
  • 安装指定版本
 nvm install <version>
  • 删除已安装的指定版本
nvm uninstall <version> 
  • 切换使用指定的版本node
nvm use <version> 
  • 改变默认的版本:
nvm alias default v4.3.0(指定版本号)

扩展

  • npm配置仓库
npm config set registry https://registry.npm.taobao.org

检验配置是否成功:

npm config get registry
  • npm安装淘宝镜像cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐