一、切换使用淘宝镜像【临时切换、 长期切换】
①、临时切换
npm --registry https://registry.npm.taobao.org install express
yarn --registry https://registry.npm.taobao.org install express
1
②、长期切换
npm config set registry https://registry.npm.taobao.org
yarn config set registry https://registry.npm.taobao.org
1
③、切换官方镜像
npm config set registry https://registry.npmjs.org/
yarn config set registry https://registry.nlark.com/
1
④、验证是否切换成功
npm config get registry
yarn config get registry
————————————————
版权声明:本文为优快云博主「HarmonyOS体验官-春波」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.youkuaiyun.com/weixin_48337566/article/details/128779136