一、方法一
1、查看当前镜像的配置
npm config get registry
2、切换到淘宝镜像
npm config set registry registry.npm.taobao.org
二、方法二
1、使用nrm工具切换到淘宝源
npx nrm use taobao
2、如果之后需要切换回官方源可使用
npx nrm use npm
npm config get registry
npm config set registry registry.npm.taobao.org
npx nrm use taobao
npx nrm use npm