问题 运行 npm publish --access public (E403)

Issue running npm publish --access public (E403)

我正在尝试将作用域包发布到 npm,但我在 CLI 上不断收到此错误:

npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT https://registry.npmjs.org/@username%2fdynamic-ui-elements - Forbidden
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy, or
npm ERR! 403 on a server you do not have access to.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/cutler/.npm/_logs/2022-05-16T23_08_36_735Z-debug.log

我已查看 the internet trying solve 问题,但 none 我所看到的建议都有效。

关于 2FA,我已经尝试过选中和不选中“写入操作需要双因素身份验证”。当它被选中时,我得到的不是上述错误,而是提示我输入一次性密码,但是在输入我的 google 身份验证器应用程序生成的代码后,我再次收到 E403。

These two 问题反映了我自己的问题,但都没有得到回答。我使用的身份验证器错了吗?是否有我缺少的设置?

这是我的 package.json:

{
    "name": "@username/dynamic-ui-elements",
    "version": "1.0.0",
    "description": "Some dynamic UI elements to transform your HTML",
    "main": "index.js",
    "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1",
        "build": "webpack",
        "start": "webpack serve --open"
    },
    "repository": {
        "type": "git",
        "url": "git+https://github.com/CutlerSheridan/dynamic-ui-elements.git"
    },
    "author": "Cutler Sheridan <cutler.sheridan@gmail.com>",
    "license": "ISC",
    "files": [
        "src/dynamicUi.js",
        "README.md"
    ],
    "bugs": {
        "url": "https://github.com/CutlerSheridan/dynamic-ui-elements/issues"
    },
    "homepage": "https://github.com/CutlerSheridan/dynamic-ui-elements#readme",
    "devDependencies": {
        "webpack": "^5.72.1",
        "webpack-cli": "^4.9.2",
        "webpack-dev-server": "^4.9.0"
    }
}

尽管阅读 package.json 100 遍,但问题是我没有将 auto-generated "name": "@username/dynamic-ui-elements" 更改为我的真实用户名。