-
Notifications
You must be signed in to change notification settings - Fork 4.5k
"Invalid scope name" on aws codeartifact login with --namespace #10207
Copy link
Copy link
Open
Labels
bugThis issue is a bug.This issue is a bug.closing-soonThis issue will automatically close in 4 days unless further comments are made.This issue will automatically close in 4 days unless further comments are made.codeartifact logincustomizationIssues related to CLI customizations (located in /awscli/customizations)Issues related to CLI customizations (located in /awscli/customizations)p3This is a minor priority issueThis is a minor priority issueresponse-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.closing-soonThis issue will automatically close in 4 days unless further comments are made.This issue will automatically close in 4 days unless further comments are made.codeartifact logincustomizationIssues related to CLI customizations (located in /awscli/customizations)Issues related to CLI customizations (located in /awscli/customizations)p3This is a minor priority issueThis is a minor priority issueresponse-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
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 underscoresWhere 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
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
--namespacejust fineExpected Behavior
Command works and uses the
--namespaceas the scope option in npmrcCurrent Behavior
Invalid scope name, scope must contain URL-safe characters, no leading dots or underscoresReproduction Steps
aws --profile codeartifact codeartifact login --tool npm --repository my-registry --domain my-domain --domain-owner <ACCOUNT-ID-REDACTED> --region us-east-1 --namespace NamespacePossible 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 namespaceinstead of--namespace Namespacemakes the CLI command run but thennpm install @{N,n}amespace/packagefails to resolve until you edit the.npmrcto make the scope beNamespace. 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