2024-12-05 23:24:47 +08:00
.TH "NPM-TEAM" "1" "December 2024" "NPM@10.9.2" ""
2015-09-05 05:47:14 +08:00
.SH "NAME"
2022-12-07 11:18:33 +08:00
\fB npm-team\fR - Manage organization teams and team memberships
.SS "Synopsis"
2015-09-05 05:47:14 +08:00
.P
.RS 2
.nf
2022-12-07 11:18:33 +08:00
npm team create <scope:team> \[ lB]--otp <otpcode>\[ rB]
npm team destroy <scope:team> \[ lB]--otp <otpcode>\[ rB]
npm team add <scope:team> <user> \[ lB]--otp <otpcode>\[ rB]
npm team rm <scope:team> <user> \[ lB]--otp <otpcode>\[ rB]
2015-09-05 05:47:14 +08:00
npm team ls <scope>|<scope:team>
.fi
.RE
2021-03-24 02:58:11 +08:00
.P
2022-12-07 11:18:33 +08:00
Note: This command is unaware of workspaces.
.SS "Description"
2015-09-05 05:47:14 +08:00
.P
2022-12-07 11:18:33 +08:00
Used to manage teams in organizations, and change team memberships. Does not handle permissions for packages.
2015-09-05 05:47:14 +08:00
.P
2022-12-07 11:18:33 +08:00
Teams must always be fully qualified with the organization/scope they belong to when operating on them, separated by a colon (\fB :\fR ). That is, if you have a \fB newteam\fR team in an \fB org\fR organization, you must always refer to that team as \fB @org:newteam\fR in these commands.
2020-03-20 00:53:27 +08:00
.P
2023-02-19 06:09:39 +08:00
If you have two-factor authentication enabled in \fB auth-and-writes\fR mode, then you can provide a code from your authenticator with \fB \[ lB]--otp <otpcode>\[ rB]\fR . If you don't include this then you will be taken through a second factor flow based on your \fB authtype\fR .
2015-09-05 05:47:14 +08:00
.RS 0
2022-12-07 11:18:33 +08:00
.IP \(bu 4
2023-11-03 22:03:57 +08:00
create / destroy: Create a new team, or destroy an existing one. Note: You cannot remove the \fB developers\fR team, \fB learn more.\fR \fI \(la https://docs.npmjs.com/about-developers-team\(ra \fR
2022-12-07 11:18:33 +08:00
.P
Here's how to create a new team \fB newteam\fR under the \fB org\fR org:
2021-02-02 06:26:42 +08:00
.P
.RS 2
.nf
npm team create @org:newteam
.fi
.RE
2022-12-07 11:18:33 +08:00
.P
You should see a confirming message such as: \fB +@org:newteam\fR once the new team has been created.
.IP \(bu 4
add: Add a user to an existing team.
.P
Adding a new user \fB username\fR to a team named \fB newteam\fR under the \fB org\fR org:
2021-02-02 06:26:42 +08:00
.P
.RS 2
.nf
npm team add @org:newteam username
.fi
.RE
2022-12-07 11:18:33 +08:00
.P
On success, you should see a message: \fB username added to @org:newteam\fR
.IP \(bu 4
rm: Using \fB npm team rm\fR you can also remove users from a team they belong to.
.P
Here's an example removing user \fB username\fR from \fB newteam\fR team in \fB org\fR organization:
2021-02-02 06:26:42 +08:00
.P
.RS 2
.nf
npm team rm @org:newteam username
.fi
.RE
2022-12-07 11:18:33 +08:00
.P
Once the user is removed a confirmation message is displayed: \fB username removed from @org:newteam\fR
.IP \(bu 4
ls: If performed on an organization name, will return a list of existing teams under that organization. If performed on a team, it will instead return a list of all users belonging to that particular team.
.P
Here's an example of how to list all teams from an org named \fB org\fR :
2021-02-02 06:26:42 +08:00
.P
.RS 2
.nf
npm team ls @org
.fi
.RE
2022-12-07 11:18:33 +08:00
.P
Example listing all members of a team named \fB newteam\fR :
2021-02-02 06:26:42 +08:00
.P
.RS 2
.nf
npm team ls @org:newteam
.fi
.RE
2022-12-07 11:18:33 +08:00
.RE 0
2015-09-05 05:47:14 +08:00
2022-12-07 11:18:33 +08:00
.SS "Details"
2015-09-05 05:47:14 +08:00
.P
2022-12-07 11:18:33 +08:00
\fB npm team\fR always operates directly on the current registry, configurable from the command line using \fB --registry=<registry url>\fR .
2015-09-05 05:47:14 +08:00
.P
2022-12-07 11:18:33 +08:00
You must be a \fI team admin\fR to create teams and manage team membership, under the given organization. Listing teams and team memberships may be done by any member of the organization.
2015-09-05 05:47:14 +08:00
.P
2022-12-07 11:18:33 +08:00
Organization creation and management of team admins and \fI organization\fR members is done through the website, not the npm CLI.
2015-09-05 05:47:14 +08:00
.P
2022-12-07 11:18:33 +08:00
To use teams to manage permissions on packages belonging to your organization, use the \fB npm access\fR command to grant or revoke the appropriate permissions.
.SS "Configuration"
.SS "\fBregistry\fR"
2021-05-21 03:54:50 +08:00
.RS 0
2022-12-07 11:18:33 +08:00
.IP \(bu 4
Default: "https://registry.npmjs.org/"
.IP \(bu 4
2021-05-21 03:54:50 +08:00
Type: URL
2022-12-07 11:18:33 +08:00
.RE 0
2021-05-21 03:54:50 +08:00
.P
2022-12-07 11:18:33 +08:00
The base URL of the npm registry.
.SS "\fBotp\fR"
2021-05-21 03:54:50 +08:00
.RS 0
2022-12-07 11:18:33 +08:00
.IP \(bu 4
2021-05-21 03:54:50 +08:00
Default: null
2022-12-07 11:18:33 +08:00
.IP \(bu 4
2021-05-21 03:54:50 +08:00
Type: null or String
2022-12-07 11:18:33 +08:00
.RE 0
2021-05-21 03:54:50 +08:00
.P
2022-12-07 11:18:33 +08:00
This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with \fB npm access\fR .
2021-05-21 03:54:50 +08:00
.P
2022-12-07 11:18:33 +08:00
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.
.SS "\fBparseable\fR"
2021-05-21 03:54:50 +08:00
.RS 0
2022-12-07 11:18:33 +08:00
.IP \(bu 4
2021-05-21 03:54:50 +08:00
Default: false
2022-12-07 11:18:33 +08:00
.IP \(bu 4
2021-05-21 03:54:50 +08:00
Type: Boolean
2022-12-07 11:18:33 +08:00
.RE 0
2021-05-21 03:54:50 +08:00
.P
2022-12-07 11:18:33 +08:00
Output parseable results from commands that write to standard output. For \fB npm search\fR , this will be tab-separated table format.
.SS "\fBjson\fR"
2021-05-21 03:54:50 +08:00
.RS 0
2022-12-07 11:18:33 +08:00
.IP \(bu 4
2021-05-21 03:54:50 +08:00
Default: false
2022-12-07 11:18:33 +08:00
.IP \(bu 4
2021-05-21 03:54:50 +08:00
Type: Boolean
2022-12-07 11:18:33 +08:00
.RE 0
2021-05-21 03:54:50 +08:00
.P
2022-12-07 11:18:33 +08:00
Whether or not to output JSON data, rather than the normal output.
2021-07-16 04:09:18 +08:00
.RS 0
2022-12-07 11:18:33 +08:00
.IP \(bu 4
In \fB npm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fB package.json\fR .
.RE 0
2021-07-16 04:09:18 +08:00
2021-05-21 03:54:50 +08:00
.P
2022-12-07 11:18:33 +08:00
Not supported by all npm commands.
.SS "See Also"
2015-09-05 05:47:14 +08:00
.RS 0
2022-12-07 11:18:33 +08:00
.IP \(bu 4
2019-11-19 03:01:39 +08:00
npm help access
2022-12-07 11:18:33 +08:00
.IP \(bu 4
2021-02-02 06:26:42 +08:00
npm help config
2022-12-07 11:18:33 +08:00
.IP \(bu 4
2019-11-06 03:55:08 +08:00
npm help registry
2022-12-07 11:18:33 +08:00
.RE 0