运行NPM发布的问题 - Access Public(E403)

发布于 2025-01-29 12:34:34 字数 3248 浏览 3 评论 0 原文

我正在尝试将范围发布给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

我看上去 all aft /stackoverflow.com/questions/52103353/how-do-i-i-publish-an-npm-package-with-a-two-factor-authentication-error"> internet 尝试 解决问题问题,但我见过的建议都没有起作用。

  • 我已在CLI上登录
  • 我的NPM电子邮件已验证,
  • 没有其他名称的软件包,因为我将其发布到我的用户名中,而且我从未发布过任何其他包裹,
  • 我尝试过该命令为 npm发布 - access public 以及 npm publish-access = public
  • 2fa启用了

2fa,我尝试过有没有尝试过”写动作“检查了。当检查它时,我会提示一个一次性密码,但是从我的Google Authenticator应用程序输入生成的代码后,我再次获得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 <[email protected]>",
    "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"
    }
}

I'm trying to publish a scoped package to npm, but I keep getting this error on the 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

I have looked all over the internet trying to solve the issue, but none of the suggestions I've seen have worked.

  • I am logged in on the CLI
  • My npm email is verified
  • there is no other package with the same name, as I'm publishing this scoped to my username and I've never published any other packages
  • I've tried the command as npm publish --access public as well as npm publish --access=public
  • 2FA is enabled

Regarding the 2FA, I've tried both with and without "Require two-factor authentication for write actions" checked. When it IS checked, instead of the above error, I get prompted for a one-time password, but upon entering the generated code from my google authenticator app, I get the E403 again.

These two questions mirror my own, but neither has been answered. Am I using the authenticator wrong? Is there a setting I'm missing?

Here is my 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 <[email protected]>",
    "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"
    }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

幻想少年梦 2025-02-05 12:34:34

尽管阅读了 package.json 100次,但问题是我没有更改自动生成的“ name”:“@username/dynamic-ui-elements” 成为我的真正用户名。

Despite reading that package.json 100 times, the problem was that I had not changed the auto-generated "name": "@username/dynamic-ui-elements" to be my real username.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文