Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
npm-adduser.md88 linesDownload Raw Back to commands
1---
2title: npm-adduser
3section: 1
4description: Add a registry user account
5---
6
7### Synopsis
8
9```bash
10npm adduser
11
12alias: add-user
13```
14
15Note: This command is unaware of workspaces.
16
17### Description
18
19Create a new user in the specified registry, and save the credentials to the `.npmrc` file.
20If no registry is specified, the default registry will be used (see [`registry`](/using-npm/registry)).
21
22When you run `npm adduser`, the CLI automatically generates a legacy token of `publish` type.
23For more information, see [About legacy tokens](/about-access-tokens#about-legacy-tokens).
24
25When using `legacy` for your `auth-type`, the username, password, and email are read in from prompts.
26
27### Configuration
28
29#### `registry`
30
31* Default: "https://registry.npmjs.org/"
32* Type: URL
33
34The base URL of the npm registry.
35
36
37
38#### `scope`
39
40* Default: the scope of the current project, if any, or ""
41* Type: String
42
43Associate an operation with a scope for a scoped registry.
44
45Useful when logging in to or out of a private registry:
46
47```
48# log in, linking the scope to the custom registry
49npm login --scope=@mycorp --registry=https://registry.mycorp.com
50
51# log out, removing the link and the auth token
52npm logout --scope=@mycorp
53```
54
55This will cause `@mycorp` to be mapped to the registry for future
56installation of packages specified according to the pattern
57`@mycorp/package`.
58
59This will also cause `npm init` to create a scoped package.
60
61```
62# accept all defaults, and create a package named "@foo/whatever",
63# instead of just named "whatever"
64npm init --scope=@foo --yes
65```
66
67
68
69#### `auth-type`
70
71* Default: "web"
72* Type: "legacy" or "web"
73
74What authentication strategy to use with `login`. Note that if an `otp`
75config is given, this value will always be set to `legacy`.
76
77
78
79### See Also
80
81* [npm registry](/using-npm/registry)
82* [npm config](/commands/npm-config)
83* [npmrc](/configuring-npm/npmrc)
84* [npm owner](/commands/npm-owner)
85* [npm whoami](/commands/npm-whoami)
86* [npm token](/commands/npm-token)
87* [npm profile](/commands/npm-profile)
88 
codekingpro/portable-devtools · Team Ai