① 设置镜像源
npm config set registry https://mirrors.huaweicloud.com/repository/npm/
② 验证是否生效
npm config get registry
③ 恢复默认镜像源
npm config set registry https://registry.npmjs.org
npm config set registry https://mirrors.huaweicloud.com/repository/npm/
npm config get registry
npm config set registry https://registry.npmjs.org
回顶部