一个伪linux粉丝的blog

  1. 首页
  2. network
  3. 正文

npm-group 500 with

18 11 月, 2020 861点热度 0人点赞 0条评论

客户反馈,nexus仓库下npm拖包,当使用npm-group时,报错500,无法下载,直接使用npm-proxy时,反而顺利拖包。

这简直不符合常理,一般group含的源要多于单独的proxy。

检查发现npm-proxy实际仅有 官网地址http://registry.npmjs.org/。

一边开启nexus日志详细模式,

  • 更改 nexus 日志级别,org.sonatype.nexus.repository 从 info 设置为 debug

一边拖包时加上详情参数,然后做了几组实验。

先说第一个结论, registry.npm.taobao.org这边的问题,当npm-group含了 registry.npm.taobao.org ,拖包会报错。

  • 当前 registry.npm.taobao.org 是从 r.cnpmjs.org 进行全量同步的.
  • 修改为r.cnpmjs.org 或去掉 taobao的这个npm源,都正常。

客户新疑问来了,npm-group里面含了 私有库地址 abc、官网 http://registry.npmjs.org/,  最后才是 taobao地址 ,按照通用逻辑,优先级别依次往下。

实际上,我后来在官网找到了这段说明,顺序是有优先级别意义的。
https://help.sonatype.com/repomanager3/repository-management?_ga=2.116980102.1037975644.1605598044-1818828394.1605598044#RepositoryManagement-RepositoryGroup

Note that the order of the repositories listed in the Member section is important. When the repository manage searches for a component in a repository group, it will return the first match. To reorder a repository in this list, click and the drag the repositories and groups in the Members list or use the arrow buttons between the Available and Members list. These arrows can be used to add and remove repositories as well.

后来找到网友的测试 https://my.oschina.net/polly/blog/2120650

https://swenfang.github.io/2018/06/03/Maven-Priority/

最终结论
settings_mirror 的优先级高于 central
settings_profile_repo 优先级高于 settings_mirror
settings_profile_repo 优先级高于 pom_repositories
settings_profile_repo 优先级高于 pom_profile_repo
pom_profile_repo 优先级高于 pom_repositories
pom_repositories 优先级高于 settings_mirror
通过上面的比较得出完整的搜索链:

local_repo > settings_profile_repo > pom_profile_repo > pom_repositories > settings_mirror > central

也就是这段优先级别符合实际情况一点,有机会再研究这个吧。

 

相关文章:

  1. nexus and squid
  2. Google Nexus one
  3. 二维码识别Nexus One
  4. 怒了,请问马云同学:淘宝什么时候关门
标签: nexus npm
最后更新:18 11 月, 2020

wanjie

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

This site uses Akismet to reduce spam. Learn how your comment data is processed.

归档
分类
  • network / 332篇
  • Uncategorized / 116篇
  • unix/linux / 121篇
  • 业界资讯 / 38篇
  • 公司杂事 / 11篇
  • 数码影像 / 12篇
  • 美剧 / 3篇
  • 美图共赏 / 21篇
  • 英语学习 / 3篇
标签聚合
Nginx jira gitlab squid nexus k8s openssl ssh dreamhost空间 Google Voice kernel ldap 天翼live 泰国 Google postgres 邮件归档 docker google-chrome 浏览器 dreamhost d90 网站运营 deepseek debian wget kubectl 虚拟主机 VPS Ubuntu

COPYRIGHT © 2008-2025 wanjie.info. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang