NPM login to GitHub registry requires lowercase username

2.8k Views Asked by At

I'm trying to log in from the command line using this command:

$ npm login --registry=https://npm.pkg.github.com/

But my username on GitHub has an uppercase first letter, which results in the following error:

$ npm login --registry=https://npm.pkg.github.com/
Username: <Username>
npm WARN Name must be lowercase

Anyone know how I can get around this? Do I have to change my GitHub username for this to work?

2

There are 2 best solutions below

3
On BEST ANSWER

npm started to enforce lower case usernames at some points, leaving the accounts previously created in this awkward situation.

To solve the issue, you might want to email [email protected], which will link the lowercase variant of your username to your account.

source: this github issue.

0
On

Use GitHub token instead of credentials:

Stack Overflow: Set NPM credentials

Don't forget to set Read packages permission upon creation.