cnpm / cnpmcore

Private NPM Registry for Enterprise
https://npmmirror.com
MIT License
607 stars 80 forks source link

下载不到老版本的npm #703

Open RiESAEX opened 2 months ago

RiESAEX commented 2 months ago

在sourceRegistry配成https://registry.npmmirror.com的时候 用nvm-windows下载node14.会下载不到npm 抓包看nvm-windows的请求 在装node14的时候最后会去请求/-/binary/npm/v6.14.15.zip 然后响应了一个{"error":"[NOT_FOUND] Binary \"npm/v6.14.15.zip\" not found"}回来

github-actions[bot] commented 2 months ago

我们已经看到你的反馈,如果是功能缺陷,可以提供一下重现该问题的方式;如果是新功能需求,我们会尽快加入讨论。同时我们非常期待你可以加入我们的贡献者行列,让项目可以长期可持续发展。

elrrrrrrr commented 2 months ago

https://registry.npmmirror.com/binary.html?path=npm/v6.14.15/

https://registry.npmmirror.com/-/binary/npm/v6.14.15/v6.14.15.zip

看着有这个文件

RiESAEX commented 2 months ago

https://registry.npmmirror.com/-/binary/npm/v6.14.15/v6.14.15.zip 有文件但是https://registry.npmmirror.com/-/binary/npm/v6.14.15.zip 会直接NOT_FOUND回来 走https://npmmirror.com/mirrors/npm/ 的话就会有两次302 https://npmmirror.com/mirrors/npm/v6.14.18.zip -> https://cdn.npmmirror.com/binaries/npm/v6.14.18.zip -> https://cdn.npmmirror.com/binaries/npm/v6.14.18/v6.14.18.zip

elrrrrrrr commented 2 months ago

image

手上没有 windows 机器,在 linux 下没有重现 🤔

RiESAEX commented 2 months ago

是的 好像只有nvm-windows会单独走一个请求去下npm,nvm和fnm看起来都是直接用node的tar包里面带的npm。

翻了一下cnpm同步的是https://github.com/cnpm/cnpmcore/blob/c1de2494454dbebc18ccc7ad2e005f59970690f8/config/binaries.ts#L559 但是nvm-windows那边默认的npm_mirror是 https://github.com/npm/cli/archive/ https://github.com/coreybutler/nvm-windows/blob/e11ee22f85c41d7807cc468bb7c882b8b39bb56f/src/web/web.go#L28 大概是这里github有区别导致的?