npm和yarn的镜像源的查看与修改

NPM

查询当前镜像

npm get registry

设置为淘宝镜像

npm config set registry http://registry.npm.taobao.org/

设置回默认的官方镜像

npm config set registry https://registry.npmjs.org/

 

YARN

查询当前镜像

yarn config get registry

设置为淘宝镜像

yarn config set registry http://registry.npm.taobao.org/

设置回默认的官方镜像

yarn config set registry https://registry.yarnpkg.com

设置成功都有类似下面的输出

yarn config v1.16.0
success Set "registry" to "http://registry.npm.taobao.org/".
Done in 0.05s.

安装CNPM

npm install -g cnpm --registry=https://registry.npm.taobao.org

 

 

© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享
共1条
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片
    • 头像Fitspresso Reviews0