npm: publish 报错 OTP

一个npm 报错处理
更新于: 2025-12-11 17:38:42

现场

npm notice
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.
npm error A complete log of this run can be found in: /Users/feizheng/.npm/_logs/2025-12-11T08_59_36_596Z-debug-0.log

解决方案

  • npm publish 在线输入这个码
  • 下次就不会了
Authenticate your account at:
https://www.npmjs.com/auth/cli/26676048-cd6a-47fa-b1be-d039b2811b65
Press ENTER to open in the browser...

+ @jswork/ushell-module-nodejs@1.0.73