aws-cli icon indicating copy to clipboard operation
aws-cli copied to clipboard

aws codeartifact login can't set npm registry

Open barabadzhi opened this issue 4 years ago • 17 comments

Describe the bug

Since last upgrade, I'm no longer able to set npm registry with aws codeartifact login. Command I execute aws codeartifact login --tool npm --repository XXX --domain XXX.

Expected Behavior

Typical You're logged in message as it used to be. Npm pulls codeartifact as usual.

Current Behavior

Short: Command '['npm', 'config', 'set', '//XXX-195852102923.d.codeartifact.eu-west-1.amazonaws.com/npm/XXX/:always-auth', 'true']' returned non-zero exit status 1.

Long (--debug):

Debug output ➜ aws codeartifact login --tool npm --repository XXX --domain XXX --debug 2022-11-14 14:21:34,263 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.8.12 Python/3.10.8 Darwin/22.1.0 source/arm64 2022-11-14 14:21:34,263 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['codeartifact', 'login', '--tool', 'npm', '--repository', 'XXX', '--domain', 'XXX', '--debug'] 2022-11-14 14:21:34,274 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler 2022-11-14 14:21:34,274 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler 2022-11-14 14:21:34,274 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler > 2022-11-14 14:21:34,274 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler 2022-11-14 14:21:34,274 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler 2022-11-14 14:21:34,274 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler 2022-11-14 14:21:34,274 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler 2022-11-14 14:21:34,275 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler > 2022-11-14 14:21:34,275 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler 2022-11-14 14:21:34,275 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /opt/homebrew/Cellar/awscli/2.8.12/libexec/lib/python3.10/site-packages/awscli/data/cli.json 2022-11-14 14:21:34,275 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler 2022-11-14 14:21:34,275 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler 2022-11-14 14:21:34,275 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler 2022-11-14 14:21:34,275 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler 2022-11-14 14:21:34,275 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler 2022-11-14 14:21:34,276 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler 2022-11-14 14:21:34,276 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.8.12 Python/3.10.8 Darwin/22.1.0 source/arm64 prompt/off 2022-11-14 14:21:34,276 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['codeartifact', 'login', '--tool', 'npm', '--repository', 'XXX', '--domain', 'XXX', '--debug'] 2022-11-14 14:21:34,276 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler 2022-11-14 14:21:34,276 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler 2022-11-14 14:21:34,276 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler 2022-11-14 14:21:34,276 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler 2022-11-14 14:21:34,276 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler 2022-11-14 14:21:34,277 - MainThread - botocore.utils - DEBUG - IMDS ENDPOINT: ENDPOINT 2022-11-14 14:21:34,280 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler 2022-11-14 14:21:34,280 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler 2022-11-14 14:21:34,290 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /opt/homebrew/Cellar/awscli/2.8.12/libexec/lib/python3.10/site-packages/awscli/botocore/data/codeartifact/2018-09-22/service-2.json 2022-11-14 14:21:34,292 - MainThread - botocore.hooks - DEBUG - Event building-command-table.codeartifact: calling handler 2022-11-14 14:21:34,292 - MainThread - botocore.hooks - DEBUG - Event building-command-table.codeartifact: calling handler 2022-11-14 14:21:34,301 - MainThread - botocore.hooks - DEBUG - Event building-command-table.codeartifact_login: calling handler 2022-11-14 14:21:34,301 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.login.tool: calling handler 2022-11-14 14:21:34,301 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.login: calling handler 2022-11-14 14:21:34,301 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.login.domain: calling handler 2022-11-14 14:21:34,301 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.login: calling handler 2022-11-14 14:21:34,301 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.login.domain-owner: calling handler 2022-11-14 14:21:34,301 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.login.namespace: calling handler 2022-11-14 14:21:34,301 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.login.duration-seconds: calling handler 2022-11-14 14:21:34,301 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.login.repository: calling handler 2022-11-14 14:21:34,301 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.login: calling handler 2022-11-14 14:21:34,301 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.login.dry-run: calling handler 2022-11-14 14:21:34,301 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.login: calling handler 2022-11-14 14:21:34,301 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: env 2022-11-14 14:21:34,301 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role 2022-11-14 14:21:34,301 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role-with-web-identity 2022-11-14 14:21:34,301 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: sso 2022-11-14 14:21:34,301 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: shared-credentials-file 2022-11-14 14:21:34,301 - MainThread - botocore.credentials - INFO - Found credentials in shared credentials file: ~/.aws/credentials 2022-11-14 14:21:34,302 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /opt/homebrew/Cellar/awscli/2.8.12/libexec/lib/python3.10/site-packages/awscli/botocore/data/endpoints.json 2022-11-14 14:21:34,306 - MainThread - botocore.hooks - DEBUG - Event choose-service-name: calling handler 2022-11-14 14:21:34,307 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.codeartifact: calling handler 2022-11-14 14:21:34,346 - MainThread - botocore.endpoint - DEBUG - Setting codeartifact timeout as (60, 60) 2022-11-14 14:21:34,346 - MainThread - botocore.hooks - DEBUG - Event provide-client-params.codeartifact.GetAuthorizationToken: calling handler 2022-11-14 14:21:34,346 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.codeartifact.GetAuthorizationToken: calling handler 2022-11-14 14:21:34,347 - MainThread - botocore.hooks - DEBUG - Event before-call.codeartifact.GetAuthorizationToken: calling handler 2022-11-14 14:21:34,347 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=GetAuthorizationToken) with params: {'url_path': '/v1/authorization-token', 'query_string': {'domain': 'XXX'}, 'method': 'POST', 'headers': {'User-Agent': 'aws-cli/2.8.12 Python/3.10.8 Darwin/22.1.0 source/arm64 prompt/off command/codeartifact.login'}, 'body': b'', 'url': 'https://codeartifact.eu-west-1.amazonaws.com/v1/authorization-token?domain=XXX', 'context': {'client_region': 'eu-west-1', 'client_config': , 'has_streaming_input': False, 'auth_type': None}} 2022-11-14 14:21:34,347 - MainThread - botocore.hooks - DEBUG - Event request-created.codeartifact.GetAuthorizationToken: calling handler > 2022-11-14 14:21:34,347 - MainThread - botocore.hooks - DEBUG - Event choose-signer.codeartifact.GetAuthorizationToken: calling handler 2022-11-14 14:21:34,347 - MainThread - botocore.auth - DEBUG - Calculating signature using v4 auth. 2022-11-14 14:21:34,347 - MainThread - botocore.auth - DEBUG - CanonicalRequest: POST /v1/authorization-token domain=XXX host:codeartifact.eu-west-1.amazonaws.com x-amz-date:20221114T132134Z x-amz-security-token:TOKEN

host;x-amz-date;x-amz-security-token TOKEN 2022-11-14 14:21:34,347 - MainThread - botocore.auth - DEBUG - StringToSign: AWS4-HMAC-SHA256 20221114T132134Z 20221114/eu-west-1/codeartifact/aws4_request 3812203d1f64c519acbf89a1db2a0052ae90cdb1630fc7910a0ede17e691442e 2022-11-14 14:21:34,347 - MainThread - botocore.auth - DEBUG - Signature: SIG 2022-11-14 14:21:34,347 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://codeartifact.eu-west-1.amazonaws.com/v1/authorization-token?domain=XXX, headers={'User-Agent': b'aws-cli/2.8.12 Python/3.10.8 Darwin/22.1.0 source/arm64 prompt/off command/codeartifact.login', 'X-Amz-Date': b'20221114T132134Z', 'X-Amz-Security-Token': b'TOKEN', 'Authorization': b'AWS4-HMAC-SHA256 Credential=CREDENTIAL/20221114/eu-west-1/codeartifact/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=SIG', 'Content-Length': '0'}> 2022-11-14 14:21:34,347 - MainThread - botocore.httpsession - DEBUG - Certificate path: /opt/homebrew/Cellar/awscli/2.8.12/libexec/lib/python3.10/site-packages/awscli/botocore/cacert.pem 2022-11-14 14:21:34,347 - MainThread - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): codeartifact.eu-west-1.amazonaws.com:443 2022-11-14 14:21:34,620 - MainThread - urllib3.connectionpool - DEBUG - https://codeartifact.eu-west-1.amazonaws.com:443 "POST /v1/authorization-token?domain=XXX HTTP/1.1" 200 1324 2022-11-14 14:21:34,621 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Mon, 14 Nov 2022 13:21:34 GMT', 'Content-Type': 'application/json', 'Content-Length': '1324', 'Connection': 'keep-alive', 'x-amzn-RequestId': '516961da-7187-4cd6-9a24-2b7105624d63'} 2022-11-14 14:21:34,621 - MainThread - botocore.parsers - DEBUG - Response body: b'{"authorizationToken":TOKEN}' 2022-11-14 14:21:34,622 - MainThread - botocore.hooks - DEBUG - Event needs-retry.codeartifact.GetAuthorizationToken: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x1054fd090>> 2022-11-14 14:21:34,622 - MainThread - botocore.retries.standard - DEBUG - Not retrying request. 2022-11-14 14:21:34,623 - MainThread - botocore.hooks - DEBUG - Event after-call.codeartifact.GetAuthorizationToken: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x1054fc5b0>> 2022-11-14 14:21:34,623 - MainThread - botocore.hooks - DEBUG - Event provide-client-params.codeartifact.GetRepositoryEndpoint: calling handler <function base64_decode_input_blobs at 0x104fa5f30> 2022-11-14 14:21:34,623 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.codeartifact.GetRepositoryEndpoint: calling handler <function generate_idempotent_uuid at 0x103b460e0> 2022-11-14 14:21:34,623 - MainThread - botocore.hooks - DEBUG - Event before-call.codeartifact.GetRepositoryEndpoint: calling handler <function inject_api_version_header_if_needed at 0x103b47910> 2022-11-14 14:21:34,623 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=GetRepositoryEndpoint) with params: {'url_path': '/v1/repository/endpoint', 'query_string': {'domain': 'XXX', 'repository': 'XXX', 'format': 'npm'}, 'method': 'GET', 'headers': {'User-Agent': 'aws-cli/2.8.12 Python/3.10.8 Darwin/22.1.0 source/arm64 prompt/off command/codeartifact.login'}, 'body': b'', 'url': 'https://codeartifact.eu-west-1.amazonaws.com/v1/repository/endpoint?domain=XXX&repository=XXX&format=npm', 'context': {'client_region': 'eu-west-1', 'client_config': <botocore.config.Config object at 0x1054fc5e0>, 'has_streaming_input': False, 'auth_type': None}} 2022-11-14 14:21:34,624 - MainThread - botocore.hooks - DEBUG - Event request-created.codeartifact.GetRepositoryEndpoint: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x1054fc670>> 2022-11-14 14:21:34,624 - MainThread - botocore.hooks - DEBUG - Event choose-signer.codeartifact.GetRepositoryEndpoint: calling handler <function set_operation_specific_signer at 0x103b45fc0> 2022-11-14 14:21:34,624 - MainThread - botocore.auth - DEBUG - Calculating signature using v4 auth. 2022-11-14 14:21:34,624 - MainThread - botocore.auth - DEBUG - CanonicalRequest: GET /v1/repository/endpoint domain=XXX&format=npm&repository=XXX host:codeartifact.eu-west-1.amazonaws.com x-amz-date:20221114T132134Z x-amz-security-token:TOKEN

host;x-amz-date;x-amz-security-token TOKEN 2022-11-14 14:21:34,624 - MainThread - botocore.auth - DEBUG - StringToSign: AWS4-HMAC-SHA256 20221114T132134Z 20221114/eu-west-1/codeartifact/aws4_request dc8a9e9f4ac92328d78ce6f42de67ccecea9959b32b198dcc32b2499cc4f62cf 2022-11-14 14:21:34,625 - MainThread - botocore.auth - DEBUG - Signature: SIG 2022-11-14 14:21:34,625 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=GET, url=https://codeartifact.eu-west-1.amazonaws.com/v1/repository/endpoint?domain=XXX&repository=XXX&format=npm, headers={'User-Agent': b'aws-cli/2.8.12 Python/3.10.8 Darwin/22.1.0 source/arm64 prompt/off command/codeartifact.login', 'X-Amz-Date': b'20221114T132134Z', 'X-Amz-Security-Token': b'TOKEN', 'Authorization': b'AWS4-HMAC-SHA256 Credential=CREDENTIAL/20221114/eu-west-1/codeartifact/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=SIG'}> 2022-11-14 14:21:34,625 - MainThread - botocore.httpsession - DEBUG - Certificate path: /opt/homebrew/Cellar/awscli/2.8.12/libexec/lib/python3.10/site-packages/awscli/botocore/cacert.pem 2022-11-14 14:21:34,773 - MainThread - urllib3.connectionpool - DEBUG - https://codeartifact.eu-west-1.amazonaws.com:443 "GET /v1/repository/endpoint?domain=XXX&repository=XXX&format=npm HTTP/1.1" 200 115 2022-11-14 14:21:34,774 - MainThread - botocore.parsers - DEBUG - Response headers: {'Date': 'Mon, 14 Nov 2022 13:21:34 GMT', 'Content-Type': 'application/json', 'Content-Length': '115', 'Connection': 'keep-alive', 'x-amzn-RequestId': '277eb8fa-894d-4e25-b83b-ca7c215c8d23'} 2022-11-14 14:21:34,774 - MainThread - botocore.parsers - DEBUG - Response body: b'{"repositoryEndpoint":"https://XXX-195852102923.d.codeartifact.eu-west-1.amazonaws.com/npm/XXX/"}' 2022-11-14 14:21:34,775 - MainThread - botocore.hooks - DEBUG - Event needs-retry.codeartifact.GetRepositoryEndpoint: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x1054fd090>> 2022-11-14 14:21:34,775 - MainThread - botocore.retries.standard - DEBUG - Not retrying request. 2022-11-14 14:21:34,775 - MainThread - botocore.hooks - DEBUG - Event after-call.codeartifact.GetRepositoryEndpoint: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x1054fc5b0>> 2022-11-14 14:21:35,314 - MainThread - awscli.clidriver - DEBUG - Exception caught in main() Traceback (most recent call last): File "/opt/homebrew/Cellar/awscli/2.8.12/libexec/lib/python3.10/site-packages/awscli/clidriver.py", line 458, in main return command_table[parsed_args.command](remaining, parsed_args) File "/opt/homebrew/Cellar/awscli/2.8.12/libexec/lib/python3.10/site-packages/awscli/clidriver.py", line 593, in call return command_table[parsed_args.operation](remaining, parsed_globals) File "/opt/homebrew/Cellar/awscli/2.8.12/libexec/lib/python3.10/site-packages/awscli/customizations/commands.py", line 191, in call rc = self._run_main(parsed_args, parsed_globals) File "/opt/homebrew/Cellar/awscli/2.8.12/libexec/lib/python3.10/site-packages/awscli/customizations/codeartifact/login.py", line 663, in _run_main login.login(parsed_args.dry_run) File "/opt/homebrew/Cellar/awscli/2.8.12/libexec/lib/python3.10/site-packages/awscli/customizations/codeartifact/login.py", line 312, in login self._run_commands('npm', commands, dry_run) File "/opt/homebrew/Cellar/awscli/2.8.12/libexec/lib/python3.10/site-packages/awscli/customizations/codeartifact/login.py", line 88, in _run_commands self.subprocess_utils.run( File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 526, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['npm', 'config', 'set', '//XXX-195852102923.d.codeartifact.eu-west-1.amazonaws.com/npm/XXX/:always-auth', 'true']' returned non-zero exit status 1.

Command '['npm', 'config', 'set', '//XXX-195852102923.d.codeartifact.eu-west-1.amazonaws.com/npm/XXX/:always-auth', 'true']' returned non-zero exit status 1.

Reproduction Steps

On a fresh Ventura (M1):

  1. Install aws-cli (brew install awscli).
  2. Set region in ~/.aws/config.
  3. Set credentials in ~/.aws/credentials.
  4. Get new session token with aws sts get-session-token & hardware key.
  5. Update ~/.aws/credentials with the new info.
  6. Run aws codeartifact login --tool npm --repository XXX --domain XXX. ~Profit!~ Nope.

Possible Solution

Manually set npm repo, but it is cumbersome & defeats the whole purpose of the CLI tool.

UPD: Manually setting npm registry indeed worked. So, the aws codeartifact login is broken (at least for me).

Additional Information/Context

npm --version   
9.1.1
node --version
v18.12.1

CLI version used

aws-cli/2.8.12 Python/3.10.8 Darwin/22.1.0 source/arm64 prompt/off

Environment details (OS name and version, etc.)

Apple M1/macOS Ventura 13.0.1 (22A400)

barabadzhi avatar Nov 14 '22 13:11 barabadzhi

i get the same behavior with aws-cli/2.8.12 Python/3.10.8 Darwin/21.6.0 source/x86_64 prompt/off

hakamadare avatar Nov 15 '22 15:11 hakamadare

Hi @barabadzhi and @hakamadare thanks for reporting this issue. I think we may need to loop in the CodeArtifact team. First could you confirm if this was working prior to v2.8.12? Are any other services/commands not working? And @hakamadare are you also using macOS Ventura?

tim-finnigan avatar Nov 15 '22 17:11 tim-finnigan

@tim-finnigan no, Monterey (see the Darwin/21.6.0 in my version string). i believe i started seeing this failure before upgrading to 2.8.12; i did that upgrade yesterday and i think i've been seeing this error message for a little while now, on the order of weeks.

the CLI documentation suggests to me that aws codeartifact login --tool npm is only supposed to inject that always-auth parameter when generating a config for npm version 6 or earlier. i'm using npm 9.1.1; however, look at this changelog entry:

https://github.com/npm/cli/blob/latest/CHANGELOG.md#%EF%B8%8F-breaking-changes-1

i suspect that the AWS CLI has been incorrectly injecting that parameter for a long time, but npm has been silently ignoring it; i suspect that as of 2022-10-19 npm now throws that error (https://github.com/npm/cli/blob/latest/CHANGELOG.md#900-2022-10-19), and that roughly lines up with my sense of how long i've been seeing that error message.

hakamadare avatar Nov 15 '22 17:11 hakamadare

also: i'd be happy to open a support case if that would be helpful, just let me know

hakamadare avatar Nov 15 '22 17:11 hakamadare

Thanks @hakamadare for following up. I heard back from the CodeArtifact team and they are aware of this issue with the upgrade of NPM to version 9, where the aws codeartifact login command does not work because NPM has dropped the support of setting always-auth flag. They are actively working on a fix for this which should be released soon. I will continue to leave updates here when I have more information.

tim-finnigan avatar Nov 15 '22 18:11 tim-finnigan

Thank you @tim-finnigan! I feel like @hakamadare pretty much answered your question.

The issue is with hard deprecation of always-auth in the recent npm release, so AWS CLI is trying to set custom repo with unsupported param. To my knowledge it was setting always-auth like forever, npm just ignored it until recently.

Immediate solution for those affected is to manually set npm registry. Personally, I wrote a tiny shell script to use until the issue is fixed.

barabadzhi avatar Nov 16 '22 12:11 barabadzhi

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar Dec 03 '22 00:12 github-actions[bot]

Was the fix provided for Windows? I'm still getting this error.

npm --version
9.4.1

aws --version
aws-cli/2.9.20 Python/3.9.11 Windows/10 exe/AMD64 prompt/off

pedroluceena avatar Feb 03 '23 12:02 pedroluceena

Was the fix provided for Windows? I'm still getting this error.

npm --version
9.4.1

aws --version
aws-cli/2.9.20 Python/3.9.11 Windows/10 exe/AMD64 prompt/off

Still getting this error while doing codeartifact login via cli; any updates?

tiwari-ashwani avatar Feb 09 '23 14:02 tiwari-ashwani

@tiwari-ashwani Hi! I was working with @pedroluceena when this occurred. We solved it by using aws configure to define the credentials and use a bash terminal instead of powershell to run the cli command. It seems like a Windows powershell problem to me. I'm using MacOS + Node v18, while other teammates use Ubuntu + Node v18, all running the exact same command (and also awscli 2.9) and only in @pedroluceena's case (Windows powershell) it didn't work.


Maybe you won't need the aws configure part. We only did this because the cli was not reading the AWS environment variables properly in @pedroluceena's bash terminal, even when exported.

jgtvares avatar Feb 09 '23 14:02 jgtvares

Hey. I looked at the merged fix by @kdaily https://github.com/aws/aws-cli/pull/7468 and updated the aws cli to latest aws-cli/2.9.23 Python/3.9.11 Darwin/20.6.0 exe/x86_64 prompt/off and it works! The .npmrc looks great again Thank you for the fix 👍

devonik avatar Feb 13 '23 06:02 devonik

Solved it on windows by updating aws-cli to 2.11.12

VictorBianche avatar Apr 13 '23 14:04 VictorBianche

I still have the same problem on Mac.

$ aws --version
aws-cli/2.11.14 Python/3.11.3 Darwin/21.6.0 exe/x86_64 prompt/off
$ npm --version
9.5.1

engineerakki avatar Apr 21 '23 19:04 engineerakki

The issue was resolved for me by upgrading to aws-cli/2.11.19

nluckenbill avatar May 12 '23 19:05 nluckenbill

Stumbled into this with 2.11.22

kornicameister avatar May 25 '23 11:05 kornicameister

Works for me with 2.11.25 on Windows.

bdwade100 avatar Jun 05 '23 18:06 bdwade100

update aws-cli to latest version will fix the problem

raphael5178 avatar Jul 04 '23 15:07 raphael5178