- 输入命令
npm config set registry https://registry.npm.taobao.org
- 验证命令
npm config get registry
如果返回https://registry.npm.taobao.org
,说明镜像配置成功。
- 如果要切换回原来的源:
npm config set registry https://registry.npmjs.org
npm config set registry https://registry.npm.taobao.org
npm config get registry
如果返回https://registry.npm.taobao.org
,说明镜像配置成功。
npm config set registry https://registry.npmjs.org