选择 CLI 版本:




There are three levels of org users:

  1. 超级管理员,控制计费并将人员添加到组织。

    Super admin, controls billing & adding people to the org.

  2. 团队管理员,管理团队成员和包访问。

    Team admin, manages team membership & package access.

  3. 开发者,在他们有权访问的包上工作。

    Developer, works on packages they are given access to.

超级管理员是唯一可以将用户添加到组织的人,因为它会影响月度账单。超级管理员将使用该网站来管理会员资格。每个组织都有一个 developers 团队,所有用户都会自动添加到该团队。

The super admin is the only person who can add users to the org because it impacts the monthly bill. The super admin will use the website to manage membership. Every org has a developers team that all users are automatically added to.


The team admin is the person who manages team creation, team membership, and package access for teams. The team admin grants package access to teams, not individuals.


The developer will be able to access packages based on the teams they are on. Access is either read-write or read-only.


There are two main commands:

  1. npm team 详见 npm team

    npm team see npm team for more details

  2. npm access 详见 npm access

    npm access see npm access for more details


Team Admins create teams

  • 检查你已将谁添加到你的组织:

    Check who you’ve added to your org:

npm team ls <org>:developers
  • 每个组织都会自动分配一个 developers 团队,因此你可以查看组织中团队成员的完整列表。该团队自动获得对所有包的读写访问权限,但你可以使用 access 命令更改它。

    Each org is automatically given a developers team, so you can see the whole list of team members in your org. This team automatically gets read-write access to all packages, but you can change that with the access command.

  • 创建一个新团队:

    Create a new team:

npm team create <org:team>
  • 将成员添加到该团队:

    Add members to that team:

npm team add <org:team> <user>


Publish a package and adjust package access

  • 在包目录中,运行

    In package directory, run

npm init --scope=<org>


to scope it for your org & publish as usual

  • 授予访问权限:

    Grant access:

npm access grant <read-only|read-write> <org:team> [<package>]
  • 撤销访问:

    Revoke access:

npm access revoke <org:team> [<package>]


Monitor your package access

  • 查看团队成员可以访问哪些组织包:

    See what org packages a team member can access:

npm access ls-packages <org> <user>
  • 查看特定团队可用的包:

    See packages available to a specific team:

npm access ls-packages <org:team>
  • 检查哪些团队正在协作处理一个包:

    Check which teams are collaborating on a package:

npm access ls-collaborators <pkg>


See also

npm 中文网 - 粤ICP备13048890号