在 npmjs.com 后台设置中创建了 classic token,然后用这个 token 发布 npm 包时报错:
npm notice Publishing to https://registry.npmjs.org/ with tag latest and public access
npm error code EOTP
npm error This operation requires a one-time password from your authenticator.
npm error You can provide a one-time password by passing --otp=<code> to the command you ran.
npm error If you already provided a one-time password then it is likely that you either typoed
npm error it, or it timed out. Please try again.
请问如何解决这个问题?
改为创建 Granular Access Token,然后换成这个 token 就可以了