查看修改npm地址并登录
npm config get registry
修改npm地址
npm config set registry http://******.com/**/
使用 nrm 查看和切换镜像
npm安装 nrm:
npm install -g nrm
通过nrm查看和切换镜像源(命令)
// 查看镜像源命令
nrm ls
// 切换淘宝镜像源:
nrm use taobao
npm的镜像地址有以下几个:
// 设置npm的registry配置为 淘宝镜像
npm config set registry https://registry.npm.taobao.org/
// 设置npm的registry配置为 官方镜像
npm config set registry https://registry.npmjs.org/
// 设置npm的registry配置为 cnpm镜像
npm config set registry https://r.cnpmjs.org/
// 设置npm的registry配置为 阿里云镜像
npm config set registry https://npm.aliyun.com/
// 设置npm的registry配置为 华为云镜像
npm config set registry https://mirrors.huaweicloud.com/repository/npm/
登录npm
npm login
回车
username:******
回车
password:******
回车
查看当前登录npm用户
npm whoami
发布命令
npm publish