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