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