配置镜像源
- 腾讯云
http://mirrors.cloud.tencent.com/npm/
- 阿里云
https://registry.npmmirror.com
- 华为云
https://mirrors.huaweicloud.com/repository/npm/
设置镜像源: npm config set registry https://registry.npmmirror.com
验证命令: npm config get registry
如果返回 https://registry.npmmirror.com,
说明镜像配置成功。
npm 命令
npm -v
查看当前版本
sudo npm install npm@6.4.1 -g
安装指定版本(切换指定版本)(Tip:在单独项目中安装指定版本 不使用全局npm)