1、查看镜像源使用状态:
npm config get registry
2、全局切换淘宝镜像源:
npm config set registry http://registry.npm.taobao.org
3、全局切换官方镜像源:
npm config set registry https://registry.npmjs.org/
4、全局切换华为镜像源:
npm config set registry https://mirrors.huaweicloud.com/repository/npm/
npm config set disturl https://mirrors.huaweicloud.com/nodejs/
npm config set electron_mirror https://mirrors.huaweicloud.com/electron/
5、清除缓存:
npm cache clean -f
6、检查:
npm config list
查看镜像并全局切换镜像源
于 2024-01-12 09:20:06 首次发布