1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
.HR
.P
section: cli\-commands
title: npm\-adduser
description: Set access level on published packages
.HR
.TH "NPM\-ADDUSER" "1" "July 2020" "" ""
.SH "NAME"
\fBnpm-adduser\fR \- Add a registry user account
.SS Synopsis
.P
.RS 2
.nf
npm adduser [\-\-registry=url] [\-\-scope=@orgname] [\-\-always\-auth] [\-\-auth\-type=legacy]
aliases: login, add\-user
.fi
.RE
.SS Description
.P
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,
the default registry will be used (see npm help \fBconfig\fP)\.
.P
The username, password, and email are read in from prompts\.
.P
To reset your password, go to https://www\.npmjs\.com/forgot
.P
To change your email address, go to https://www\.npmjs\.com/email\-edit
.P
You may use this command multiple times with the same user account to
authorize on a new machine\. When authenticating on a new machine,
the username, password and email address must all match with
your existing record\.
.P
\fBnpm login\fP is an alias to \fBadduser\fP and behaves exactly the same way\.
.SS Configuration
.SS registry
.P
Default: https://registry\.npmjs\.org/
.P
The base URL of the npm package registry\. If \fBscope\fP is also specified,
this registry will only be used for packages with that scope\. \fBscope\fP defaults
to the scope of the project directory you're currently in, if any\. See npm help \fBscope\fP\|\.
.SS scope
.P
Default: none
.P
If specified, the user and login credentials given will be associated
with the specified scope\. See npm help \fBscope\fP\|\. You can use both at the same time,
e\.g\.
.P
.RS 2
.nf
npm adduser \-\-registry=http://myregistry\.example\.com \-\-scope=@myco
.fi
.RE
.P
This will set a registry for the given scope and login or create a user for
that registry at the same time\.
.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
registries\. Can be used with \fB\-\-registry\fP and / or \fB\-\-scope\fP, e\.g\.
.P
.RS 2
.nf
npm adduser \-\-registry=http://private\-registry\.example\.com \-\-always\-auth
.fi
.RE
.P
This will ensure that all requests to that registry (including for tarballs)
include an authorization header\. This setting may be necessary for use with
private registries where metadata and package tarballs are stored on hosts with
different hostnames\. See \fBalways\-auth\fP in npm help \fBconfig\fP for more details on always\-auth\. Registry\-specific configuration of \fBalways\-auth\fP takes precedence over any global configuration\.
.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 \fBadduser\fP/\fBlogin\fP\|\. Some npm registries
(for example, npmE) might support alternative auth strategies besides classic
username/password entry in legacy npm\.
.SS See Also
.RS 0
.IP \(bu 2
npm help registry
.IP \(bu 2
npm help config
.IP \(bu 2
npm help npmrc
.IP \(bu 2
npm help owner
.IP \(bu 2
npm help whoami
.RE
|