一、查看npm的当前源 npm config get registry 效果如下: 二、查看yarn的当前源 yarnconfig get registry 效果如下: 三、切换npm源为淘宝源的方法 npm config set registry https://registry.npm.taobao.org npm config set disturl https://npm.taobao.org/dist