将协作者添加到用户账户拥有的私有包中

作为具有付费用户账户的 npm 用户,你可以添加另一个具有付费账户的 npm 用户作为你拥有的私有包的协作者。

🌐 As an npm user with a paid user account, you can add another npm user with a paid account as a collaborator on a private package you own.

注意: 你想要添加为私有包协作者的用户必须拥有付费账户。要注册付费账户,他们可以访问 https://www.npmjs.com/settings/username/billing,并将 username 替换为他们的 npm 用户名。

当你将成员添加到你的套餐时,他们会收到一封邀请加入该套餐的电子邮件。新成员必须接受邀请才能获得访问该套餐的权限。

🌐 When you add a member to your package, they are sent an email inviting them to the package. The new member has to accept the invitation to gain access to the package.

在网站上授予对私有用户包的访问权限

🌐 Granting access to a private user package on the web

  1. npm 网站 上,转到你想添加合作者的包:https://www.npmjs.com/package/<your-package-name>
  2. 在封装页面,点击“设置”标签。
  3. 进入“邀请维护者”部分。
  4. 输入协作者的 npm 用户名。
  5. 点击 邀请

从命令行接口授予私有包的访问权限

🌐 Granting private package access from the command line interface

要在命令行中向软件包添加协作者,请运行以下命令,将 <user> 替换为协作者的 npm 用户名,将 <your-package-name> 替换为私有软件包的名称:

🌐 To add a collaborator to a package on the command line, run the following command, replacing <user> with the npm username of your collaborator, and <your-package-name> with the name of the private package:

npm owner add <user> <your-package-name>

授予对私有组织包的访问权限

🌐 Granting access to private organization packages

要授予 npm 用户访问私有组织包的权限,你必须让组织所有者将其添加到组织中,然后将其添加到拥有私有包访问权限的团队中。欲了解更多信息,请参阅“添加成员到你的组织”。

🌐 To grant an npm user access to private organization packages, you must have an organization owner add them to your organization, then add them to a team that has access to the private package. For more information, see "Adding members to your organization".