2022-07-19 08:51:49 -07:00
|
|
|
.TH "NPM\-ADDUSER" "1" "July 2022" "" ""
|
2011-11-26 09:21:03 -08:00
|
|
|
.SH "NAME"
|
2019-11-18 21:01:39 +02:00
|
|
|
\fBnpm-adduser\fR \- Add a registry user account
|
2019-11-05 14:55:08 -05:00
|
|
|
.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
|
|
|
|
|
|
|
aliases: login, 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
|
|
|
|
Note: This command is unaware of workspaces\.
|
2019-11-05 14:55:08 -05:00
|
|
|
.SS Description
|
2014-09-24 14:41:07 -07:00
|
|
|
.P
|
2015-07-24 15:09:52 -07:00
|
|
|
Create or verify a user named \fB<username>\fP in the specified registry, and
|
|
|
|
save the credentials to the \fB\|\.npmrc\fP file\. If no registry is specified,
|
2019-11-18 21:01:39 +02:00
|
|
|
the default registry will be used (see npm help \fBconfig\fP)\.
|
2011-11-26 09:21:03 -08:00
|
|
|
.P
|
|
|
|
The username, password, and email are read in from prompts\.
|
|
|
|
.P
|
2015-01-08 14:37:26 -08:00
|
|
|
To reset your password, go to https://www\.npmjs\.com/forgot
|
2011-11-26 09:21:03 -08:00
|
|
|
.P
|
2015-01-08 14:37:26 -08:00
|
|
|
To change your email address, go to https://www\.npmjs\.com/email\-edit
|
2011-11-26 09:21:03 -08:00
|
|
|
.P
|
|
|
|
You may use this command multiple times with the same user account to
|
2015-01-08 14:37:26 -08:00
|
|
|
authorize on a new machine\. When authenticating on a new machine,
|
|
|
|
the username, password and email address must all match with
|
|
|
|
your existing record\.
|
2014-09-24 14:41:07 -07:00
|
|
|
.P
|
2015-07-24 15:09:52 -07:00
|
|
|
\fBnpm login\fP is an alias to \fBadduser\fP and behaves exactly the same way\.
|
2019-11-05 14:55:08 -05:00
|
|
|
.SS Configuration
|
2021-05-20 15:54:50 -04:00
|
|
|
.SS \fBregistry\fP
|
|
|
|
.RS 0
|
|
|
|
.IP \(bu 2
|
|
|
|
Default: "https://registry\.npmjs\.org/"
|
|
|
|
.IP \(bu 2
|
|
|
|
Type: URL
|
|
|
|
|
|
|
|
.RE
|
2011-11-26 09:21:03 -08:00
|
|
|
.P
|
2021-05-20 15:54:50 -04:00
|
|
|
The base URL of the npm registry\.
|
|
|
|
.SS \fBscope\fP
|
|
|
|
.RS 0
|
|
|
|
.IP \(bu 2
|
|
|
|
Default: the scope of the current project, if any, or ""
|
|
|
|
.IP \(bu 2
|
|
|
|
Type: String
|
|
|
|
|
|
|
|
.RE
|
2014-09-24 14:41:07 -07:00
|
|
|
.P
|
2021-05-20 15:54:50 -04: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
|
|
|
|
npm login \-\-scope=@mycorp \-\-registry=https://registry\.mycorp\.com
|
|
|
|
|
|
|
|
# log out, removing the link and the auth token
|
|
|
|
npm logout \-\-scope=@mycorp
|
2014-11-04 15:08:12 -08:00
|
|
|
.fi
|
2014-09-24 14:41:07 -07:00
|
|
|
.RE
|
|
|
|
.P
|
2021-05-20 15:54:50 -04:00
|
|
|
This will cause \fB@mycorp\fP to be mapped to the registry for future
|
|
|
|
installation of packages specified according to the pattern
|
|
|
|
\fB@mycorp/package\fP\|\.
|
|
|
|
.P
|
|
|
|
This will also cause \fBnpm init\fP 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"
|
|
|
|
npm init \-\-scope=@foo \-\-yes
|
|
|
|
.fi
|
|
|
|
.RE
|
2022-06-13 23:04:21 -07:00
|
|
|
.SS \fBauth\-type\fP
|
|
|
|
.RS 0
|
|
|
|
.IP \(bu 2
|
|
|
|
Default: "legacy"
|
|
|
|
.IP \(bu 2
|
2022-07-19 08:51:49 -07:00
|
|
|
Type: "legacy", "web", "sso", "saml", "oauth", or "webauthn"
|
2022-06-13 23:04:21 -07:00
|
|
|
|
|
|
|
.RE
|
|
|
|
.P
|
2022-07-19 08:51:49 -07:00
|
|
|
NOTE: auth\-type values "sso", "saml", "oauth", and "webauthn" will be
|
|
|
|
removed in a future version\.
|
2022-06-13 23:04:21 -07:00
|
|
|
.P
|
2022-07-19 08:51:49 -07:00
|
|
|
What authentication strategy to use with \fBlogin\fP\|\.
|
2019-11-05 14:55:08 -05:00
|
|
|
.SS See Also
|
2014-09-24 14:41:07 -07:00
|
|
|
.RS 0
|
|
|
|
.IP \(bu 2
|
2019-11-05 14:55:08 -05:00
|
|
|
npm help registry
|
2014-09-24 14:41:07 -07:00
|
|
|
.IP \(bu 2
|
2019-11-18 21:01:39 +02:00
|
|
|
npm help config
|
2014-09-24 14:41:07 -07:00
|
|
|
.IP \(bu 2
|
2019-11-05 14:55:08 -05:00
|
|
|
npm help npmrc
|
2014-09-24 14:41:07 -07:00
|
|
|
.IP \(bu 2
|
2019-11-18 21:01:39 +02:00
|
|
|
npm help owner
|
2014-09-24 14:41:07 -07:00
|
|
|
.IP \(bu 2
|
2019-11-18 21:01:39 +02:00
|
|
|
npm help whoami
|
2021-05-20 15:54:50 -04:00
|
|
|
.IP \(bu 2
|
|
|
|
npm help token
|
|
|
|
.IP \(bu 2
|
|
|
|
npm help profile
|
2014-09-24 14:41:07 -07:00
|
|
|
|
|
|
|
.RE
|