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.
- If
my-repo
contains the requested package version, it is returned to the client.- If
my-repo
does not contain the requested package version, CodeArtifact looks for it in my repo's upstream repositories.- 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
package-lock.json
, node_modules
+ npm i
npm cache clean -f
npm -d ping
(yes it is working)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.
Packages starting with the name "registry" had a download issue which is now resolved so the above workaround is not longer required.