1 ---
2 title: npm-adduser
3 section: 1
4 description: Add a registry user account
5 github_repo: npm/cli
6 github_branch: release/v8
7 github_path: docs/lib/content/commands/npm-adduser.md
8 redirect_from:
9 - /cli-documentation/v8/adduser
10 - /cli-documentation/v8/cli-commands/adduser
11 - /cli-documentation/v8/cli-commands/npm-adduser
12 - /cli-documentation/v8/commands/adduser
13 - /cli-documentation/v8/commands/npm-adduser
14 - /cli-documentation/v8/npm-adduser
15 - /cli/v8/adduser
16 - /cli/v8/cli-commands/adduser
17 - /cli/v8/cli-commands/npm-adduser
18 - /cli/v8/commands/adduser
19 - /cli/v8/npm-adduser
20 ---
21
22 ### Synopsis
23
24 ```bash
25 npm adduser
26
27 aliases: login, add-user
28 ```
29
30 Note: This command is unaware of workspaces.
31
32 ### Description
33
34 Create or verify a user named `<username>` in the specified registry, and save the credentials to the `.npmrc` file. If no registry is specified, the default registry will be used (see [`config`](/cli/v8/using-npm/config)).
35
36 The username, password, and email are read in from prompts.
37
38 To reset your password, go to [https://www.npmjs.com/forgot](https://www.npmjs.com/forgot)
39
40 To change your email address, go to [https://www.npmjs.com/email-edit](https://www.npmjs.com/email-edit)
41
42 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.
43
44 `npm login` is an alias to `adduser` and behaves exactly the same way.
45
46 ### Configuration
47
48 #### `registry`
49
50 - Default: "https://registry.npmjs.org/"
51 - Type: URL
52
53 The base URL of the npm registry.
54
55 #### `scope`
56
57 - Default: the scope of the current project, if any, or ""
58 - Type: String
59
60 Associate an operation with a scope for a scoped registry.
61
62 Useful when logging in to or out of a private registry:
63
64 ```
65 # log in, linking the scope to the custom registry
66 npm login --scope=@mycorp --registry=https://registry.mycorp.com
67
68 # log out, removing the link and the auth token
69 npm logout --scope=@mycorp
70 ```
71
72 This will cause `@mycorp` to be mapped to the registry for future installation of packages specified according to the pattern `@mycorp/package`.
73
74 This will also cause `npm init` to create a scoped package.
75
76 ```
77 # accept all defaults, and create a package named "@foo/whatever",
78 # instead of just named "whatever"
79 npm init --scope=@foo --yes
80 ```
81
82 #### `auth-type`
83
84 - Default: "legacy"
85 - Type: "legacy", "web", "sso", "saml", "oauth", or "webauthn"
86
87 NOTE: auth-type values "sso", "saml", "oauth", and "webauthn" will be removed in a future version.
88
89 What authentication strategy to use with `login`.
90
91 ### See Also
92
93 - [npm registry](/cli/v8/using-npm/registry)
94 - [npm config](/cli/v8/commands/npm-config)
95 - [npmrc](/cli/v8/configuring-npm/npmrc)
96 - [npm owner](/cli/v8/commands/npm-owner)
97 - [npm whoami](/cli/v8/commands/npm-whoami)
98 - [npm token](/cli/v8/commands/npm-token)
99 - [npm profile](/cli/v8/commands/npm-profile)