跳至內容

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 )

已提問 3 年前檢視次數 1555 次

1 個回答
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.

AWS

已回答 3 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。