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