Encounter when publishing package npm: This operation requires a one-time password how to solve.

Had just arrived, this is the first time I write a blog, registered blog Park did not take long to accumulate temporarily current technology can not write anything to share technical quality, but still want to write something, so I talk about my recent encounter a pit of it! I hope to help friends encountered this problem. As the title, this is the situation you may encounter when you publish or update npm package - looks like recent npmjs platform developers are forced to open 2FA verified, the solution is as follows:
  1. Login npmjs official website, if it is the first release on click picture and then click on the account option and then locate the Enable 2FA options on the page and click on; and if it is updated package, then go directly to the page own packages then switch to the next setting page, then there will be the following page:

2. Select the first option will come out a two-dimensional code page, if it is to achieve this through a friend 2FA should know how to do it, on principle 2FA can refer to God Ruanda article http://www.ruanyifeng.com /blog/2017/11/2fa-tutorial.html , have the time and energy to achieve their own friends can try one of the conditions in this regard that there is no ready-made with it - open the browser on your phone to scan two-dimensional code, then it will enter a search results page, find the following software and download page (there are VPN can also use Microsoft or Google's Authenticator mobile phone app):

3. Open the software, click Start and then add the account interface will enter the two-dimensional code function looks like this software is not available, so I chose a key input provided to add the account:

4. Then add the account interface, npm account is your account, and your password is not npm account login password, but the key is to generate two-dimensional code scanning - Scans two in the second step in mobile browser dimensional code, the observation of the browser will find the url query string in which there is a secret:

5. Copy url to the password input box, and then delete the previous key value (screct):

6. Then add the account will be successful, app will automatically enter the verification code display page 2FA:

7.返回之前npmjs二维码那个页面,然后输入实时验证码:

8.到这里就开启2FA成功了:

9.接下来你可以在setting页面关闭更新包时需要2FA验证的选项:

10.或者在以后发布/更新包时打开移动端那个2FA验证码生成软件,然后输入验证码就可以顺利发布/更新包了:

以上就是解决发布/更新npm包时2FA验证问题的全部流程,对你有帮助的话,请点个赞吧!:)

Guess you like

Origin www.cnblogs.com/corleone113/p/12116334.html