简体   繁体   English

AWS CodeArtifact 公共 npm package 版本缺失

[英]AWS CodeArtifact public npm package version missing

I'm using AWS CodeArtifact for private npm registry.我将 AWS CodeArtifact 用于私有 npm 注册表。 Project has tons of dependencies and all those are resolved correctly.项目有大量的依赖关系,所有这些都得到了正确的解决。 We are publishing packages to our registry successfully and using them as dependencies in other projects, everything is working as expected before it was decided to introduce semantic-release and here what happened:我们正在成功地将包发布到我们的注册表并将它们用作其他项目中的依赖项,在决定引入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 

This only happens when using private registry.这仅在使用私有注册表时发生。 And if we check both upstream and downstream repositories in CodeArtifact - only one version is available/cached ( latest ) for this package, whereas public npm holdsregistry-auth-token@^3.0.1 and it is possible to install this version with public npmjs registry.如果我们检查 CodeArtifact 中的上游和下游存储库 - 此 package 只有一个版本可用/缓存(最新),而公共 npm 持有registry-auth-token@^3.0.1并且可以使用公共安装此版本npmjs 注册表。

AWS docs says AWS 文档说

  1. If my-repo contains the requested package version, it is returned to the client.如果my-repo包含请求的 package 版本,则返回给客户端。
  2. If my-repo does not contain the requested package version, CodeArtifact looks for it in my repo's upstream repositories.如果my-repo不包含请求的 package 版本,CodeArtifact 会在我的 repo 的上游存储库中查找它。
  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.如果找到 package 版本,则将其引用复制到my-repo ,并将 package 版本返回给客户端。

According to these points if version exists in public npm it will be pulled to downstream and cached and it is indeed work with other random packages I tried to install missing/old/unused versions, but registry-auth-token and registry-url are cached only with latest versions and any attempt to install other version ends up with根据这些点,如果公共registry-auth-token中存在版本,它将被拉到下游并缓存,它确实可以与其他随机包一起registry-url仅使用最新版本,并且任何安装其他版本的尝试都以

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

Why does CodeArtifact can't resolve particular packages versions and can resolve other?为什么 CodeArtifact 无法解析特定包版本而可以解析其他版本? Is it the problem with CodeArtifact or am I doing smth.是 CodeArtifact 的问题还是我在做什么? wrong?错误的?

I already tried all known ( to me ) ways to resolve such kind of problems:我已经尝试了所有已知的(对我而言)解决此类问题的方法:

  • npm ci
  • Removed package-lock.json , node_modules + npm i删除package-lock.json , node_modules + npm i
  • npm cache clean -f
  • npm -d ping ( yes it is working ) npm -d ping是的,它正在工作
  • ... ...

Any help is much appreciated.任何帮助深表感谢。

This is a known issue.这是一个已知的问题。 Till a fix is released, please download the package from another source and manually publish it to your CodeArtifact repository.在修复发布之前,请从其他来源下载 package 并将其手动发布到您的 CodeArtifact 存储库。

Edit 18/08/2020编辑 18/08/2020

Packages starting with the name "registry" had a download issue which is now resolved so the above workaround is not longer required.以名称“registry”开头的软件包有一个下载问题,现已解决,因此不再需要上述解决方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM