首页 > 其他 > 详细

npm使用国内镜像源

时间:2019-08-09 16:04:08      阅读:148      评论:0      收藏:0      [点我收藏+]
[toc]

一、通过配置 npm

  • 通过 config 设置

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

# 验证指令
npm config get registry
  • 命令行指定
npm --registry https://registry.npm.taobao.org
  • 编辑配置文件 ~/.npmrc 加入下面内容
registry = https://registry.npm.taobao.org

二、通过使用 cnpm


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

# 使用 cnpm 
cnpm install xxx

三、相关资料

淘宝 NPM 镜像 : https://npm.taobao.org/
建立或使用镜像,参考: https://github.com/cnpm/cnpmjs.org

npm使用国内镜像源

原文:https://blog.51cto.com/tchuairen/2427979

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!