Switching to Node16, CodeArtifact does not authenticate with npm 9

0

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 )

1 Answer
1

Hi,

You likely have an outdated version of the AWS CLI as this issue was fixed in https://github.com/aws/aws-cli/pull/7468. Update to at least AWS CLIv2 2.9.5 or CLIv1 1.27.23.

profile pictureAWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions