MELWIN VINCENT
MELWIN VINCENT

Reputation: 1

How do I publish an npm package with a two-factor authentication error?

I just created a package called ionic3-star-rating. When I run the command npm publish, it rejetcs with an error: "This package requires that publishers enable TFA and provide an OTP to publish". But I haven't enabled TFA (on running npm profile get, it shows two-factor auth = disabled). when I run the command npm profile disable-2fa, it shows the message "Two factor authentication not enabled".

Why does this happen? I had to create another package to publish my latest changes.

Upvotes: 3

Views: 4701

Answers (1)

yiming tian
yiming tian

Reputation: 21

It looks like you inadvertently enabled per-package TFA on ionic3-star-rating.

Learn more about per-package TFA here: How to require two-factor authentication for package publishing and settings modification

If you encounter this situation please configure 2FA to edit this package

You will need an application that can generate a One Time Password, or OTP. For example, Authy or Google Authenticator, can generate one time passwords (OTP's). Learn more here:How to Use Two-Factor Authentication

Upvotes: 1

Related Questions