1.在终端修改:
npm config get registry //查看当前源地址
修改指令:
npm config set registry <要修改的原地址>
如下:
npm config set registry https://registry.npm.taobao.org //换位淘宝
npm config set registry https://mirrors.huaweicloud.com/repository/npm //换位华为
2.粗暴的方法,在源文件编辑【一般文件地址在电脑的用户下的叫.npmrc里面】
3.使用nrm管理registry地址
npm install -g nrm //安装nrm
nrm ls //查看镜像列表
nrm use taobao//切换