npm 和 yarn 更改为淘宝镜像,cnpm安装

查看registry

# npm命令
npm config get registry
# yarn命令
yarn config get registry

cnpm淘宝镜像安装

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

 

设置为淘宝镜像

# npm命令
npm config set registry http://registry.npm.taobao.org/
# yarn命令

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

设置为原镜像

# npm命令
npm config set registry http://registry.npmjs.org/

# yarn命令
yarn config set registry http://registry.npmjs.org/ 
或者
yarn config set registry https://registry.yarnpkg.com

 

参考地址1:https://www.cnblogs.com/lkc9/p/12538914.html
参考地址2:https://developer.aliyun.com/mirror/NPM?from=tnpm

posted @ 2020-06-15 14:58  zph前端  阅读(752)  评论(0编辑  收藏  举报