Skip to content

Error: Could not login to npm #190

@zeke

Description

@zeke

I've seen this a few times now: I run the CLI, it fails. If I run npm whoami then give npx semantic-release-cli setup another time, it works! Not sure what the deal is, as I'm not changing my login status.

First attempt fails:

$ npx semantic-release-cli setup
? What is your npm registry? https://registry.npmjs.org/
? What is your npm username? zeke
ERR! semantic-release Error: Could not login to npm.
ERR! semantic-release     at getNpmToken (/usr/local/lib/node_modules/semantic-release-cli/src/lib/npm.js:51:21)
ERR! semantic-release     at <anonymous>
ERR! semantic-release     at process._tickCallback (internal/process/next_tick.js:188:7)
ERR! semantic-release  { Error: Could not login to npm.
ERR! semantic-release     at getNpmToken (/usr/local/lib/node_modules/semantic-release-cli/src/lib/npm.js:51:21)
ERR! semantic-release     at <anonymous>
ERR! semantic-release     at process._tickCallback (internal/process/next_tick.js:188:7)
ERR! semantic-release   stack: 'Error: Could not login to npm.\n    at getNpmToken (/usr/local/lib/node_modules/semantic-release-cli/src/lib/npm.js:51:21)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:188:7)' }

But I'm logged in to npm:

$ npm whoami
zeke

Second attempt works:

$ npx semantic-release-cli setup
? What is your npm registry? https://registry.npmjs.org/
? What is your npm username? zeke
? What is your GitHub username? zeke

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions