2020-01-28 17:14:59 -05:00
.HR
.P
section: cli\- commands
title: npm\- adduser
2020-07-21 15:51:21 -05:00
description: Set access level on published packages
.HR
2020-08-17 17:58:47 -04:00
.TH "NPM\-ADDUSER" "1" "August 2020" "" ""
2011-11-26 09:21:03 -08:00
.SH "NAME"
2019-11-18 21:01:39 +02:00
\fB npm-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
2017-04-12 21:47:49 -07:00
npm adduser [\- \- registry=url] [\- \- scope=@orgname] [\- \- always\- auth] [\- \- auth\- type=legacy]
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
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 \fB config\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
\fB npm login\fP is an alias to \fB adduser\fP and behaves exactly the same way\.
2019-11-05 14:55:08 -05:00
.SS Configuration
2014-09-24 14:41:07 -07:00
.SS registry
.P
2019-07-24 23:00:03 -07:00
Default: https://registry\. npmjs\. org/
2011-11-26 09:21:03 -08:00
.P
2015-07-24 15:09:52 -07:00
The base URL of the npm package registry\. If \fB scope\fP is also specified,
2016-12-18 20:22:09 -08:00
this registry will only be used for packages with that scope\. \fB scope\fP defaults
2019-11-18 21:01:39 +02:00
to the scope of the project directory you're currently in, if any\. See npm help \fB scope\fP \| \.
2014-09-24 14:41:07 -07:00
.SS scope
.P
Default: none
.P
If specified, the user and login credentials given will be associated
2019-11-18 21:01:39 +02:00
with the specified scope\. See npm help \fB scope\fP \| \. You can use both at the same time,
2014-09-24 14:41:07 -07:00
e\. g\.
.P
.RS 2
2014-11-04 15:08:12 -08:00
.nf
2019-11-05 14:55:08 -05:00
npm adduser \- \- registry=http://myregistry\. example\. com \- \- scope=@myco
2014-11-04 15:08:12 -08:00
.fi
2014-09-24 14:41:07 -07:00
.RE
.P
This will set a registry for the given scope and login or create a user for
that registry at the same time\.
2014-11-04 15:08:12 -08:00
.SS always\-auth
.P
Default: false
.P
If specified, save configuration indicating that all requests to the given
registry should include authorization information\. Useful for private
2015-07-24 15:09:52 -07:00
registries\. Can be used with \fB \- \- registry\fP and / or \fB \- \- scope\fP , e\. g\.
2014-11-04 15:08:12 -08:00
.P
.RS 2
.nf
2019-11-05 14:55:08 -05:00
npm adduser \- \- registry=http://private\- registry\. example\. com \- \- always\- auth
2014-11-04 15:08:12 -08:00
.fi
.RE
.P
This will ensure that all requests to that registry (including for tarballs)
2016-03-29 23:30:51 -07:00
include an authorization header\. This setting may be necessary for use with
private registries where metadata and package tarballs are stored on hosts with
2019-11-18 21:01:39 +02:00
different hostnames\. See \fB always\- auth\fP in npm help \fB config\fP for more details on always\- auth\. Registry\- specific configuration of \fB always\- auth\fP takes precedence over any global configuration\.
2017-04-12 21:47:49 -07:00
.SS auth\-type
.RS 0
.IP \(bu 2
Default: \fB \| 'legacy'\fP
.IP \(bu 2
Type: \fB \| 'legacy'\fP , \fB \| 'sso'\fP , \fB \| 'saml'\fP , \fB \| 'oauth'\fP
.RE
.P
What authentication strategy to use with \fB adduser\fP /\fB login\fP \| \. Some npm registries
(for example, npmE) might support alternative auth strategies besides classic
username/password entry in legacy npm\.
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
2014-09-24 14:41:07 -07:00
.RE