Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
npm-login.198 linesDownload Raw Back to man1
1.TH "NPM-LOGIN" "1" "April 2026" "NPM@11.13.0" ""
2.SH "NAME"
3\fBnpm-login\fR - Login to a registry user account
4.SS "Synopsis"
5.P
6.RS 2
7.nf
8npm login
9.fi
10.RE
11.P
12Note: This command is unaware of workspaces.
13.SS "Description"
14.P
15Verify a user in the specified registry, and save the credentials to the \fB.npmrc\fR file. If no registry is specified, the default registry will be used (see npm help config).
16.P
17When you run \fBnpm login\fR, the CLI automatically generates a legacy token of \fBpublish\fR type. For more information, see \fBAbout legacy tokens\fR \fI\(la/about-access-tokens#about-legacy-tokens\(ra\fR.
18.P
19When using \fBlegacy\fR for your \fBauth-type\fR, the username and password, are read in from prompts.
20.P
21To reset your password, go to \fI\(lahttps://www.npmjs.com/forgot\(ra\fR
22.P
23To change your email address, go to \fI\(lahttps://www.npmjs.com/email-edit\(ra\fR
24.P
25You 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.
26.SS "Configuration"
27.SS "\fBregistry\fR"
28.RS 0
29.IP \(bu 4
30Default: "https://registry.npmjs.org/"
31.IP \(bu 4
32Type: URL
33.RE 0
34
35.P
36The base URL of the npm registry.
37.SS "\fBscope\fR"
38.RS 0
39.IP \(bu 4
40Default: the scope of the current project, if any, or ""
41.IP \(bu 4
42Type: String
43.RE 0
44
45.P
46Associate an operation with a scope for a scoped registry.
47.P
48Useful when logging in to or out of a private registry:
49.P
50.RS 2
51.nf
52# log in, linking the scope to the custom registry
53npm login --scope=@mycorp --registry=https://registry.mycorp.com
54
55# log out, removing the link and the auth token
56npm logout --scope=@mycorp
57.fi
58.RE
59.P
60This will cause \fB@mycorp\fR to be mapped to the registry for future installation of packages specified according to the pattern \fB@mycorp/package\fR.
61.P
62This will also cause \fBnpm init\fR to create a scoped package.
63.P
64.RS 2
65.nf
66# accept all defaults, and create a package named "@foo/whatever",
67# instead of just named "whatever"
68npm init --scope=@foo --yes
69.fi
70.RE
71.SS "\fBauth-type\fR"
72.RS 0
73.IP \(bu 4
74Default: "web"
75.IP \(bu 4
76Type: "legacy" or "web"
77.RE 0
78
79.P
80What authentication strategy to use with \fBlogin\fR. Note that if an \fBotp\fR config is given, this value will always be set to \fBlegacy\fR.
81.SS "See Also"
82.RS 0
83.IP \(bu 4
84npm help registry
85.IP \(bu 4
86npm help config
87.IP \(bu 4
88npm help npmrc
89.IP \(bu 4
90npm help owner
91.IP \(bu 4
92npm help whoami
93.IP \(bu 4
94npm help token
95.IP \(bu 4
96npm help profile
97.RE 0
98 
codekingpro/portable-devtools · Team Ai