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 you run `npm adduser`, the CLI automatically generates a legacy token of `publish` type. For more information, see [About legacy tokens](/about-access-tokens#about-legacy-tokens).
53
54 When using `legacy` for your `auth-type`, the username, password, and email are read in from prompts.
55
56 ### Configuration
57
58 #### `registry`
59
60 - Default: "https://registry.npmjs.org/"
61 - Type: URL
62
63 The base URL of the npm registry.
64
65 #### `scope`
66
67 - Default: the scope of the current project, if any, or ""
68 - Type: String
69
70 Associate an operation with a scope for a scoped registry.
71
72 Useful when logging in to or out of a private registry:
73
74 ```
75 # log in, linking the scope to the custom registry
76 npm login --scope=@mycorp --registry=https://registry.mycorp.com
77
78 # log out, removing the link and the auth token
79 npm logout --scope=@mycorp
80 ```
81
82 This will cause `@mycorp` to be mapped to the registry for future installation of packages specified according to the pattern `@mycorp/package`.
83
84 This will also cause `npm init` to create a scoped package.
85
86 ```
87 # accept all defaults, and create a package named "@foo/whatever",
88 # instead of just named "whatever"
89 npm init --scope=@foo --yes
90 ```
91
92 #### `auth-type`
93
94 - Default: "web"
95 - Type: "legacy" or "web"
96
97 What authentication strategy to use with `login`. Note that if an `otp` config is given, this value will always be set to `legacy`.
98
99 ### See Also
100
101 - [npm registry](/cli/v11/using-npm/registry)
102 - [npm config](/cli/v11/commands/npm-config)
103 - [npmrc](/cli/v11/configuring-npm/npmrc)
104 - [npm owner](/cli/v11/commands/npm-owner)
105 - [npm whoami](/cli/v11/commands/npm-whoami)
106 - [npm token](/cli/v11/commands/npm-token)
107 - [npm profile](/cli/v11/commands/npm-profile)