AWS CodeArtifact public 缺少 npm 包版本

AWS CodeArtifact public npm package version missing

我将 AWS CodeArtifact 用于私有 npm 注册表。项目有大量的依赖关系,所有这些都得到了正确的解决。我们正在成功地将包发布到我们的注册表并将它们用作其他项目的依赖项,在决定引入 semantic-release 之前一切都按预期工作,这里发生了什么:

$ npm i semantic-release
npm ERR! code ETARGET
npm ERR! notarget No matching version found for registry-auth-token@^3.0.1.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget 
npm ERR! notarget It was specified as a dependency of 'package-json'
npm ERR! notarget 

这仅在使用私有注册表时发生。如果我们检查 CodeArtifact 中的上游和下游存储库 - 只有一个版本是 available/cached(latest),而 public npm 持有 registry-auth-token@^3.0.1 并且可以使用 public npmjs 注册表安装此版本。

AWS docs says

  1. If my-repo contains the requested package version, it is returned to the client.
  2. If my-repo does not contain the requested package version, CodeArtifact looks for it in my repo's upstream repositories.
  3. If the package version is found, a reference to it is copied to my-repo, and the package version is returned to the client.

根据这些要点,如果 public npm 中存在版本,它将被拉到下游并缓存,它确实可以与其他随机包一起使用我尝试安装 missing/old/unused 版本,但是 registry-auth-token and registry-url 仅与最新版本一起缓存,任何安装其他版本的尝试都以

结束
error notarget No matching version found for registry-auth-token@^3.0.1.

为什么 CodeArtifact 无法解析特定的包版本而可以解析其他版本? 是 CodeArtifact 的问题还是我在做 smth。错了?

我已经尝试了所有已知的(对我来说)的方法来解决此类问题:

非常感谢任何帮助。

这是一个已知问题。在修复发布之前,请从其他来源下载包并手动将其发布到您的 CodeArtifact 存储库。

编辑 18/08/2020

以名称“registry”开头的包存在下载问题,现在已解决,因此不再需要上述解决方法。