We have been using the following standard way to authenticate to CodeArtifact:
aws codeartifact login --tool npm --repository MyRepository --domain MyDomain --domain-owner 123456789 --query authorizationToken --output text --duration-seconds 43200
Works fine for :
node v14.20.0 (npm v6.14.17)
Successfully configured npm to use AWS CodeArtifact repository https://nems-123456789.d.codeartifact.eu-central-1.amazonaws.com/npm/MyRepository/
Login expires in 12 hours at 2023-05-11 01:56:58+02:00
Switching with nvm for:
node v16.20.0 (npm v9.6.6)
Gives the following error:
Command '['npm', 'config', 'set', '//nems-123456789.d.codeartifact.eu-central-1.amazonaws.com/npm/*MyRepository/:always-auth', 'true']' returned non-zero exit status 1.
Only after downgrading to npm v6.14.17 am i able to authenticate, does npm version 9 does not work with Codeartifact or am i missing something?
EDIT
(Note: was able to authenticate until version npm@8.19.4 )