I have a private package in a CodeArtifact repository npm cannot find it. I have tried installing from a package.json and copying and pasting the suggested command from AWS dashboard; npm install @myproject/[email protected]
.
I am getting an error
npm ERR! code E404
npm ERR! 404 Not Found - GET https://company-112233445566.d.codeartifact.eu-west-1.amazonaws.com/npm/myrepo/@myproject%2fauthentication - Repository not found.
npm ERR! 404
npm ERR! 404 '@myproject/[email protected]' is not in this registry.
my .npmrc
includes
@myproject:registry=https://company-112233445566.d.codeartifact.eu-west-1.amazonaws.com/npm/myrepo/
//company-112233445566.d.codeartifact.eu-west-1.amazonaws.com/npm/myrepo/:always-auth=true
//company-112233445566.d.codeartifact.eu-west-1.amazonaws.com/npm/myrepo/:_authToken=${CODEARTIFACT_AUTH_TOKEN}
However,I can see the repo on the dsahboard and the query aws codeartifact list-package-versions --package authentication --domain company --domain-owner 112233445566 --repository myrepo --format npm --namespace myproject
returns
{
"versions": [
{
"version": "1.0.93",
"revision": "<somebase64string>",
"status": "Published",
"origin": {
"domainEntryPoint": {
"repositoryName": "myrepo"
},
"originType": "INTERNAL"
}
}
],
"defaultDisplayVersion": "1.0.93",
"format": "npm",
"package": "authentication",
"namespace": "myproject"
}
Could it be the %2f
being used in the request rather then a '/'?
I should mention that I am using WSL (Ubuntu) on Windows10. I do not think this is the issue however, since this setup work with a private verdaccio server (https://verdaccio.org/).
Copyright Notice:Content Author:「goldfishalpha」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/74459365/private-package-in-codeartifact-repository-not-found