2

I'm using AWS CodeArtifact for private npm registry. 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:

$ 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 holds registry-auth-token@^3.0.1 and it is possible to install this version with public npmjs registry.

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.

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

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? Is it the problem with CodeArtifact or am I doing smth. 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
  • npm cache clean -f
  • npm -d ping (yes it is working)
  • ...

Any help is much appreciated.

Paul T. Rawkeen
  • 3,994
  • 3
  • 35
  • 51

1 Answers1

1

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.

Edit 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.

shariqmaws
  • 8,152
  • 1
  • 16
  • 35
  • 2
    Thanks Shariq! I tried to search this as an issue at first, but seems had no luck finding relevant info or similar reports, could you please post a link if it exists. I would like to track it. – Paul T. Rawkeen Jul 28 '20 at 15:03
  • This should be fixed. Can you retry now and feedback. Thanks – shariqmaws Aug 06 '20 at 13:54
  • Will check these days and report. Thanks! – Paul T. Rawkeen Aug 06 '20 at 19:05
  • I'm still getting this issue and had to manually add those packages to get it to install.. oddly enough it's only those two packages that both start with "registry". – Pete Aug 12 '20 at 14:09
  • Finally I tested the installation of all packages mentioned in question (_each separately and as deps + particular version install_). Its all working for me now. Thank you for keeping up to date @shariqmaws. – Paul T. Rawkeen Aug 17 '20 at 16:03
  • We are getting the same issue attempting to pull https://www.npmjs.com/package/knex We were able to get knex@^0.95.11, but not 0.95.12. There are other packages that we are having trouble pulling as well. – mccartjm Oct 28 '21 at 20:31