Npm 发布到私有范围不断失败 [英] Npm publish to private scope keeps failing

查看:66
本文介绍了Npm 发布到私有范围不断失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近创建了一个新组织,并选择了发布无限私人包的付费计划.

I've recently created a new Organization and went for the paid plan to publish unlimited private packages.

然而,每次我尝试将我的包发布到我的组织时,它总是给我以下错误:

However, each time I try to publish my package to my Org, it keeps giving me the following error:

npm ERR! publish Failed PUT 403
npm ERR! code E403
npm ERR! Forbidden : @myScopeName/myPackageName

我已经注销,然后作为范围登录;像这样:

I've already logged out and then logged in as a scope; like this:

npm login scope=myScopeName

然后返回以下内容

以 myUserName 身份登录到 http://registry.npmjs.org/上的 @myScopeName 范围

我检查了我的 .npmrc 文件,我有以下几行:

And I've checked my .npmrc file and I have the following lines:

registry=http://registry.npmjs.org/
scope=myScopeName
@myScopeName:registry=http://registry.npmjs.org

但是我仍然无法发布我的包.有谁知道我是否忘记了其他事情,或者我是否根据上述内容做错了什么?

Yet I still can't publish my package. Does anyone know if I've forgotten something else or if I did something wrong according to the above?

谢谢!

推荐答案

这是一个可能有多种根源的错误.我将在下面列出一些可能性:

This is an error that can have many origins. I will list some of the possibilities below:

  1. 您的电子邮件地址未经验证.
  2. 包裹被分配到一个组,您不在该组中.
  3. 您提供的软件包名称与您范围内现有的软件包名称相似.
  4. 范围名称中的拼写错误.
  5. 格式错误的包名称.
  6. ...

通过实验,我发现私有 npm 包的命名方案与 官方记录.私下推送的包好像不能带下划线,可能其他东西也和官方文档有冲突.

Through experimenting, I actually found out that the naming scheme for private npm packages is different than the one officially documented. It appears that privately pushed packages cannot contain underscores, and probably other stuff is also conflicting with the official documents.

这篇关于Npm 发布到私有范围不断失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆