Skip to content
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

[BUG] npm profile enable-2fa preforms operation but shows error #8192

Open
2 tasks done
reggi opened this issue Mar 27, 2025 · 0 comments
Open
2 tasks done

[BUG] npm profile enable-2fa preforms operation but shows error #8192

reggi opened this issue Mar 27, 2025 · 0 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps

Comments

@reggi
Copy link
Contributor

reggi commented Mar 27, 2025

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

➜  ~    npm profile enable-2fa auth-and-writes
npm notice profile Enabling two factor authentication for auth-and-writes
npm password: 
Enter one-time password: xxxxxx

npm error Unknown error enabling two-factor authentication. Expected otpauth URL, got: { pending: false, mode: 'auth-and-writes' }
npm error A complete log of this run can be found in: /Users/reggi/.npm/_logs/2025-03-27T16_54_09_998Z-debug-0.log

tfa here doesn't need to be a string and it's asserting that it should

https://github.com/npm/cli/blob/latest/lib/commands/profile.js#L322

➜  ~    npm profile enable-2fa auth-only    
npm notice profile Enabling two factor authentication for auth-only
npm password: 
Enter one-time password: xxx

npm error Unknown error enabling two-factor authentication. Expected otpauth URL, got: { pending: false, mode: 'auth-only' }
npm error A complete log of this run can be found in: /Users/reggi/.npm/_logs/2025-03-27T17_07_52_652Z-debug-0.log

Expected Behavior

No response

Steps To Reproduce

  1. In this environment...
  2. With this config...
  3. Run '...'
  4. See error...

Environment

  • npm:
  • Node.js:
  • OS Name:
  • System Model Name:
  • npm config:
; copy and paste output from `npm config ls` here
@reggi reggi added Bug thing that needs fixing Needs Triage needs review for next steps labels Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps
Projects
None yet
Development

No branches or pull requests

1 participant