Npm 发布包提示 bypass 2fa 错误

npm notice Publishing to https://registry.npmjs.org/ with tag latest and public access
npm error code E403
npm error 403 403 Forbidden - PUT https://registry.npmjs.org/docsify-plugin-adsense - Two-factor authentication or granular access token with bypass 2fa enabled is required to publish packages.
npm error 403 In most cases, you or one of your dependencies are requesting
npm error 403 a package version that is forbidden by your security policy, or
npm error 403 on a server you do not have access to.
npm error A complete log of this run can be found in: C:\Users\yhu\AppData\Local\npm-cache\_logs\2026-02-10T14_00_12_359Z-debug-0.log

解决方法

解决方法也很简单。

在创建的时候记得把: Bypass two-factor authentication (2FA)" option enabled. 这个选项选上。