1 ---
2 title: npm-adduser
3 section: 1
4 description: Add a registry user account
5 github_repo: npm/cli
6 github_branch: release/v7
7 github_path: docs/content/commands/npm-adduser.md
8 redirect_from:
9 - /cli-documentation/v7/adduser
10 - /cli-documentation/v7/cli-commands/adduser
11 - /cli-documentation/v7/cli-commands/npm-adduser
12 - /cli-documentation/v7/commands/adduser
13 - /cli-documentation/v7/commands/npm-adduser
14 - /cli-documentation/v7/npm-adduser
15 - /cli/v7/adduser
16 - /cli/v7/cli-commands/adduser
17 - /cli/v7/cli-commands/npm-adduser
18 - /cli/v7/commands/adduser
19 - /cli/v7/npm-adduser
20 ---
21
22 ### Synopsis
23
24 ```bash
25 npm adduser [--registry=url] [--scope=@orgname] [--auth-type=legacy]
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/v7/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 ### See Also
83
84 - [npm registry](/cli/v7/using-npm/registry)
85 - [npm config](/cli/v7/commands/npm-config)
86 - [npmrc](/cli/v7/configuring-npm/npmrc)
87 - [npm owner](/cli/v7/commands/npm-owner)
88 - [npm whoami](/cli/v7/commands/npm-whoami)
89 - [npm token](/cli/v7/commands/npm-token)
90 - [npm profile](/cli/v7/commands/npm-profile)