2025-04-10 14:36:22 -07:00
.TH "NPM-ADDUSER" "1" "April 2025" "NPM@11.3.0" ""
2011-11-26 09:21:03 -08:00
.SH "NAME"
2022-12-06 22:18:33 -05:00
\fB npm-adduser\fR - Add a registry user account
.SS "Synopsis"
2014-09-24 14:41:07 -07:00
.P
.RS 2
2014-11-04 15:08:12 -08:00
.nf
2022-02-24 21:41:49 +00:00
npm adduser
2016-03-29 23:30:51 -07:00
2022-12-06 22:18:33 -05:00
alias: add-user
2014-11-04 15:08:12 -08:00
.fi
2014-09-24 14:41:07 -07:00
.RE
2021-03-23 14:58:11 -04:00
.P
2022-12-06 22:18:33 -05:00
Note: This command is unaware of workspaces.
.SS "Description"
2014-09-24 14:41:07 -07:00
.P
2022-12-06 22:18:33 -05:00
Create a new user in the specified registry, and save the credentials to the \fB .npmrc\fR file. If no registry is specified, the default registry will be used (see npm help registry).
2011-11-26 09:21:03 -08:00
.P
2022-12-06 22:18:33 -05:00
When using \fB legacy\fR for your \fB auth-type\fR , the username, password, and email are read in from prompts.
.SS "Configuration"
.SS "\fBregistry\fR"
2021-05-20 15:54:50 -04:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
Default: "https://registry.npmjs.org/"
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Type: URL
2022-12-06 22:18:33 -05:00
.RE 0
2021-05-20 15:54:50 -04:00
2011-11-26 09:21:03 -08:00
.P
2022-12-06 22:18:33 -05:00
The base URL of the npm registry.
.SS "\fBscope\fR"
2021-05-20 15:54:50 -04:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Default: the scope of the current project, if any, or ""
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Type: String
2022-12-06 22:18:33 -05:00
.RE 0
2021-05-20 15:54:50 -04:00
2014-09-24 14:41:07 -07:00
.P
2022-12-06 22:18:33 -05:00
Associate an operation with a scope for a scoped registry.
2014-09-24 14:41:07 -07:00
.P
2021-05-20 15:54:50 -04:00
Useful when logging in to or out of a private registry:
2014-09-24 14:41:07 -07:00
.P
.RS 2
2014-11-04 15:08:12 -08:00
.nf
2021-05-20 15:54:50 -04:00
# log in, linking the scope to the custom registry
2022-12-06 22:18:33 -05:00
npm login --scope=@mycorp --registry=https://registry.mycorp.com
2021-05-20 15:54:50 -04:00
# log out, removing the link and the auth token
2022-12-06 22:18:33 -05:00
npm logout --scope=@mycorp
2014-11-04 15:08:12 -08:00
.fi
2014-09-24 14:41:07 -07:00
.RE
.P
2022-12-06 22:18:33 -05:00
This will cause \fB @mycorp\fR to be mapped to the registry for future installation of packages specified according to the pattern \fB @mycorp/package\fR .
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
This will also cause \fB npm init\fR to create a scoped package.
2017-04-12 21:47:49 -07:00
.P
2021-05-20 15:54:50 -04:00
.RS 2
.nf
# accept all defaults, and create a package named "@foo/whatever",
# instead of just named "whatever"
2022-12-06 22:18:33 -05:00
npm init --scope=@foo --yes
2021-05-20 15:54:50 -04:00
.fi
.RE
2022-12-06 22:18:33 -05:00
.SS "\fBauth-type\fR"
2022-06-13 23:04:21 -07:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
Default: "web"
.IP \(bu 4
Type: "legacy" or "web"
.RE 0
2022-06-13 23:04:21 -07:00
.P
2023-01-16 22:38:23 -05:00
What authentication strategy to use with \fB login\fR . Note that if an \fB otp\fR config is given, this value will always be set to \fB legacy\fR .
2022-12-06 22:18:33 -05:00
.SS "See Also"
2014-09-24 14:41:07 -07:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-05 14:55:08 -05:00
npm help registry
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-18 21:01:39 +02:00
npm help config
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-05 14:55:08 -05:00
npm help npmrc
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-18 21:01:39 +02:00
npm help owner
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-18 21:01:39 +02:00
npm help whoami
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
npm help token
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
npm help profile
2022-12-06 22:18:33 -05:00
.RE 0