Skip to content

"Invalid scope name" on aws codeartifact login with --namespace #10207

@carschandler

Description

@carschandler

Describe the bug

I have tried various forms of the NPM scope in the namespace argument but all fail with this message:

Invalid scope name, scope must contain URL-safe characters, no leading dots or underscores

Where I have tried Namespace, @Namespace, "Namespace", "@Namespace"

aws-cli/2.33.2 Python/3.13.12 Linux/6.18.20 source/x86_64.nixos.26

Regression Issue

  • Select this option if this issue appears to be a regression.

It seems likely since I've seen other issues in my search for info on this one where it seems as though people were using --namespace just fine

Expected Behavior

Command works and uses the --namespace as the scope option in npmrc

Current Behavior

Invalid scope name, scope must contain URL-safe characters, no leading dots or underscores

Reproduction Steps

aws --profile codeartifact codeartifact login --tool npm --repository my-registry --domain my-domain --domain-owner <ACCOUNT-ID-REDACTED> --region us-east-1 --namespace Namespace

Possible Solution

It looks like this is just a simple fix in the regex match on the namespace, which currently disallows uppercase characters for NPM, but uppercase characters are valid scopes in NPM, and they are not case insensitive: using --namespace namespace instead of --namespace Namespace makes the CLI command run but then npm install @{N,n}amespace/package fails to resolve until you edit the .npmrc to make the scope be Namespace. I opened #10208 to fix this.

Additional Information/Context

No response

CLI version used

aws-cli/2.33.2 Python/3.13.12 Linux/6.18.20 source/x86_64.nixos.26

Environment details (OS name and version, etc.)

NixOS 26.05

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.potential-regressionMarking this issue as a potential regression to be checked by team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions