Yarn 和 NPM 切换淘宝镜像

日期: 2020-04-04         浏览量: 4573

npm


1. 查询当前镜像



npm get registry 



2. 设置为淘宝镜像



npm config set registry https://registry.npm.taobao.org/



3. 设置为官方镜像



npm config set registry https://registry.npmjs.org/



yarn


1. 查询当前镜像



yarn config get registry



2. 设置为淘宝镜像



yarn config set registry https://registry.npm.taobao.org/



3. 设置为官方镜像



yarn config set registry https://registry.yarnpkg.com