如果在前端开发使用 NPM 或者 YARN 下载过程中碰到网速非常慢,可以配置国内 淘宝镜像 来提升下载速度。具体方法如下
npm
1.查看当前镜像
npm config 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