-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Could not login to npm #190
Comments
Yeah I've seen that myself lately, without updating |
For the record, I'm still getting this error a lot. |
Same here. How do you resolve this? Edit: Nvm, just try again and again... :) |
Ok, this is getting ridiculous... :/ |
@simlu sorry that this frustrates you, but please be kind ❤️ we would appreciate if you could delete or edit your comment |
@gr2m Apologies for not providing more details - just having a really bad day here. So this seems to be related to slow connections somehow. After tethering through my phone it worked /shrugs |
I am still getting this error quite a bit as well. Has there been any progress on determining what is causing this? |
nope. I’m quite sure something changed on npm’s side. Nobody is looking into it right now, I get it too, all the time :( if you could look into it that’d be great |
Hey @kbrandwijk and @pvdlg 👋 , I'm trying to understand how this part of the code works. Does the PUT request to CouchDB generate a new token on every request? Lines 24 to 27 in 45c00b4
|
Wondering if we could just fall back to using the token in |
I don’t know, but looks like it? Here is how it worked before: https://github.com/semantic-release/cli/blame/bdbf616c8f0b03816f5a509e7c48d06c92a81344/src/lib/npm.js#L12 when we used npm-registry-client I guess that would be the right code to investigate though, if there is an error, maybe log out the error entirely and see if there is anything helpful in there?
I think that’d be dangerous, I very often have dedicated npm accounts only for semantic-release, I woudln’t want it accidentally take a token from my personal account when I don’t want to |
From working on this #185 i saw that it always generates token at first, and then complain about not able to login, trying again immediately it should work, since the first try generates the token without you knowing check https://github.com/theo4u/cli/blob/aac04906701889d4bb17b2ae75671bb2dea012ee/src/lib/npm.js#L46 @gr2m ^^ |
The problem come from the npm registry instability. It has been changed to handle 409 errors from some "compatible" registries in 92e15f7. The solution would be to use a proper http client (personally I prefer https://github.com/sindresorhus/got) that would allow to use Promises, setup the authentication (token or user/pass/email) and handle the different errors. And we would need to add a retry mechanism with https://github.com/sindresorhus/p-retry. Another solution would be to use I would rather use https://github.com/sindresorhus/got rather than continuing to deal with the multiple issues and shortcomings of |
I'm new to semantic-release-cli and I sometimes get this issue. First time I ran setup it logged in fine but subsequent attempts kept failing then after a while, it seemed to work again. Here are my logs running the module with login failure
login success
It appears that on the first try, the response is sending back json data but on subsequent tries, it sends back compressed data and so the code @zeke linked is not extracting the token. Update: Replacing Line 45 in 45c00b4
seems to have fixed my issue. |
I have created the PR #199, which will probably fix this issue. I did not receive the error message "Error: Could not login to npm", but "Invalid authentication code" since I am using 2FA. |
Had the same problem, but resolved itself after running |
🎉 This issue has been resolved in version 3.6.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This should be fixed in |
Thanks, @pvdlg! 🙏 |
@pvdlg I'm running
|
@richardschneider does this happen constantly or just occasionally? If it happens evey time I'd say it's a different issue (credentials to incorrect etc) |
I just ran into this myself on 4.0.7 and I got around it by turning off 2fa on npm, which is not ideal. Seem maybe SR cli does not understand the 2fa with NPM, but it asked for it with guthub. |
I confirm that the issue still exists on 4.0.7 even though EDIT: after a quick debugging, I don't get for me, it's |
Some code error |
did that get resolved via #238? |
Hey all, just a heads up that if you are still having this issue or something resembling this issue on OSX then make sure to check that an outdated isn't saved in your OSX keychain. I'd reset my bot account via the npm web interface but didn't do the same in my osx keychain which had my old password. You can check this by going to Keychain Access > All Items then search for semantic-release-cli:npm. Hope it helps someone who thinks they have this issue but actually have other problems. :) |
If you run your command with (I know this issue is closed but it comes up in the first results in google so adding this solution seems useful) |
I met the error today, finally figured out that the username should be all in lowercase.
|
could you send a pull request that lower-cases the username? |
Co-authored-by: Jeff Tian <[email protected]>
I've seen this a few times now: I run the CLI, it fails. If I run
npm whoami
then givenpx 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:
But I'm logged in to npm:
Second attempt works:
The text was updated successfully, but these errors were encountered: