When you have two-factor access enabled on your account, and you lose access to your 2FA device, you may be able to recover your account using the following methods.
Misplaced second factor device
If you have misplaced the device that provided second-factor authentication, you can use the recovery codes generated when you enabled 2FA to access your account.
Using recovery code on the web
Locate the recovery codes generated that you have saved.
Note: Using the recovery codes to re-enable 2FA may create a new authenticator account with the same npm account name.
If you are using a time-based one-time password (TOTP) mobile app and want to delete the old authenticator account, follow the steps for the authenticator.
Viewing and regenerating recovery code
Note: Once you regenerate a set of code, all previous recovery codes become invalid. Each code can be used only once.
In the upper right corner of the page, click your profile picture, then click Account.
On the account settings page, under "Two-Factor Authentication", click Modify 2FA.
Click "Manage Recovery Codes'' to view your recovery codes
Click "Regenerate Code" to generate a new set of codes.
Misplaced recovery codes
If you have misplaced both the device that provided second-factor authentication and your recovery codes, we may be unable to help you recover your account. If you have any questions, please contact npm Support.