选择命令行版本:
See Details
目录
概要
¥Synopsis
npm org set orgname username [developer | admin | owner]npm org rm orgname usernamenpm org ls orgname [<username>]alias: ogr
注意:此命令对工作区无感知。
¥Note: This command is unaware of workspaces.
示例
¥Example
将新开发者添加到组织:
¥Add a new developer to an org:
$ npm org set my-org @mx-smith
向组织添加新管理员(或将开发者更改为管理员):
¥Add a new admin to an org (or change a developer to an admin):
$ npm org set my-org @mx-santos admin
从组织中删除用户:
¥Remove a user from an org:
$ npm org rm my-org mx-santos
列出组织中的所有用户:
¥List all users in an org:
$ npm org ls my-org
以 JSON 格式列出所有用户:
¥List all users in JSON format:
$ npm org ls my-org --json
查看用户在组织中的角色:
¥See what role a user has in an org:
$ npm org ls my-org @mx-santos
描述
¥Description
你可以使用 npm org
命令来管理和查看组织的用户。它支持添加和删除用户、更改他们的角色、列出他们以及查找特定的用户和他们的角色。
¥You can use the npm org
commands to manage and view users of an organization. It supports adding and removing users, changing their roles, listing them, and finding specific ones and their roles.
配置
¥Configuration
registry
-
默认值:"https://registry.npmjs.org/"
¥Default: "https://registry.npmjs.org/"
-
类型:URL
¥Type: URL
npm 注册表的基本 URL。
¥The base URL of the npm registry.
otp
-
默认值:null
¥Default: null
-
类型:空值或字符串
¥Type: null or String
这是来自双重身份验证器的一次性密码。使用 npm access
发布或更改包权限时需要它。
¥This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with npm access
.
如果未设置,并且注册表响应失败并询问一次性密码,npm 将在命令行上提示输入一次密码。
¥If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one.
json
-
默认值:false
¥Default: false
-
类型:布尔值
¥Type: Boolean
是否输出 JSON 数据,而不是正常输出。
¥Whether or not to output JSON data, rather than the normal output.
-
在
npm pkg set
中,它可以使用 JSON.parse() 解析集合值,然后再将它们保存到你的package.json
。¥In
npm pkg set
it enables parsing set values with JSON.parse() before saving them to yourpackage.json
.
并非所有 npm 命令都支持。
¥Not supported by all npm commands.
parseable
-
默认值:false
¥Default: false
-
类型:布尔值
¥Type: Boolean
从写入标准输出的命令输出可解析的结果。对于 npm search
,这将是制表符分隔的表格格式。
¥Output parseable results from commands that write to standard output. For npm search
, this will be tab-separated table format.
也可以看看
¥See Also