The npm community forum has been discontinued.
To discuss usage of npm, visit the GitHub Support Community.
Can't enable 2FA for Authorization and Publishing
What I Wanted to Do
Activate Two-Factor Authentication for Authorization and Publishing
What Happened Instead
It always keeps returning to “Authorization” only and, if running
npm profile get, keeps saying that my two-factor auth is disabled.
- Activate 2FA under profile settings
- Use password to login
- Under 2FA mode, select “Authorization and Publishing”
- Going to next step, it will automatically return to “Authorization” (the first selection)
- Scan QR code using Google Authenticator
- Log out of npm in your command line
- Log in to npm in your command line
npm profile get
- See “Two Fact Auth” as disabled
Update: If someone else has this problem. I fixed it by enable 2FA via command line.
I followed npm docs for npm profile: https://docs.npmjs.com/cli/profile.html