Skip to content
官方QQ交流群
技术交流1:87208295   点此加入
技术交流2:787747122   点此加入
官网
云控制台
开放平台
关注微信公众号
代码仓库: 码云

npm管理

  • npm配置
  • npm镜像源配置

npm 镜像源

镜像源地址
官方https://registry.npmjs.org/
淘宝https://registry.npmmirror.com
阿里云https://npm.aliyun.com
腾讯云https://mirrors.cloud.tencent.com/npm/
华为云https://mirrors.huaweicloud.com/repository/npm/
网易https://mirrors.163.com/npm/
中科院大学http://mirrors.ustc.edu.cn/
清华大学https://mirrors.tuna.tsinghua.edu.cn/

腾讯,华为,阿里的镜像站基本上比较全

修改镜像源

sh

#
# 1. 查看镜像库地址
#
# 查看配置,找到 registry
npm config list  
# 或者直接
npm config get registry


#
# 2. 选择镜像源
#

#
# 3. 修改镜像源
#

# 3.1. 临时使用
npm install <PACKAGE_NAME> --registry https://registry.npmmirror.com/

# 3.2. 持久使用
npm config set registry https://registry.npmmirror.com/

# 全局设置国内源:
npm -g config set registry https://registry.npmmirror.com//  
# 全局设置原始源:
npm -g config set registry https://registry.npmjs.org/

其他配置

  • npm install 的时候不显示进度
sh
npm config set loglevel=error
npm config set silent true

npm共用

https://www.jianshu.com/p/b1eff504f218

Copyright © 2017 10yun.com | 十云提供计算服务-IPV6 | ctocode组开发