np: 503 Service Unavailable at step Enabling two-factor authentication

Description

np stops at step Enabling two-factor authentication with error 503 Service Unavailable.

This error seems a consequence of the fact that np tells me

This scoped repo @nextbitlabs/onepunch hasn't been published. Do you want to publish it publicly?

where the repo has already been published instead.

Looking at the code, line https://github.com/sindresorhus/np/blob/master/source/ui.js#L143 seems a relevant place to start debugging, in particular condition !options.availability.isAvailable.

Please note that the error does not happen with np@5.2.1.

Steps to reproduce

  1. Install np@6.0.0
  2. Use np to publish a scoped module that has been already published in npm.

Expected behavior

Step Enabling two-factor authentication should not happen, the repo has been already published with two-factor authentication enabled.

np should understand that the package is already published.

Environment

np - 6.0.0 Node.js - 12.5.0 npm - 6.13.6 Git - 2.20.0 OS - macosx 10.14.6

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 19
  • Comments: 20 (1 by maintainers)

Commits related to this issue

Most upvoted comments

I have exactly the same issue with 6.2.1. Waiting for a fix… 🙏

EDIT: on 6.2.3 -> partially fixed, it works when you previously published your lib on npm. But when it is first time, you still have same issue

Any fix for this? New user here trying to use this awesome tool to publish my package. It publishes fine but I miss out on the remaining features after 2FA error.

@itaisteinherz the issue persists for me with 6.2.0 unfortunately

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/Users/agney/.nvm/versions/node/v13.11.0/bin/node',
1 verbose cli   '/Users/agney/.nvm/versions/node/v13.11.0/bin/npm',
1 verbose cli   'access',
1 verbose cli   '2fa-required',
1 verbose cli   '@agney/react-loading'
1 verbose cli ]
2 info using npm@6.14.2
3 info using node@v13.11.0
4 verbose npm-session ecbd5b6d0caae905
5 http fetch POST 503 https://registry.npmjs.org/-/package/%40agney%2Freact-loading/access 544ms
6 verbose stack Error: 503 Service Unavailable - POST https://registry.npmjs.org/-/package/%40agney%2Freact-loading/access - Service Unavailable
6 verbose stack     at /Users/agney/.nvm/versions/node/v13.11.0/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:104:15
6 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:97:5)
7 verbose statusCode 503
8 verbose pkgid @agney/react-loading@latest
9 verbose cwd /Users/agney/code/run-throughs/new-spinner
10 verbose Darwin 19.3.0
11 verbose argv "/Users/agney/.nvm/versions/node/v13.11.0/bin/node" "/Users/agney/.nvm/versions/node/v13.11.0/bin/npm" "access" "2fa-required" "@agney/react-loading"
12 verbose node v13.11.0
13 verbose npm  v6.14.2
14 error code E503
15 error 503 Service Unavailable - POST https://registry.npmjs.org/-/package/%40agney%2Freact-loading/access - Service Unavailable
16 verbose exit [ 1, true ]

This is the NPM log when it happens. The package was successfully published though.

Can someone verify if this issue is reproducible? For me, 2FA worked without a hiccup on the latest release of np

Yes, verifying the error was still reproducible with np@6.5.0. For some reason I can see the package on npm, but 404 when I try to access under the npm package url.

Update: It just worked on the second attempt without any commits in between releases. Also the page show up now.

Can someone verify if this issue is reproducible? For me, 2FA worked without a hiccup on the latest release of np

It is a long time since I last saw this error.