npm publish --otp=123456

Category: Node.js & npm/yarn

npm publish --otp=123456

Publish using a one-time password

Sends the six-digit code from your authenticator app along with the publish request, which accounts with two-factor authentication require. The OTP value changes every 30 seconds, so generate it right before publishing. Interactive prompts ask for it anyway when omitted.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.