1NPM-LOGOUT(1) NPM-LOGOUT(1)
2
3
4
6 npm-logout - Log out of the registry
7
8 Synopsis
9 npm logout [--registry=<url>] [--scope=<@scope>]
10
11 Note: This command is unaware of workspaces.
12
13 Description
14 When logged into a registry that supports token-based authentication,
15 tell the server to end this token's session. This will invalidate the
16 token everywhere you're using it, not just for the current environment.
17
18 When logged into a legacy registry that uses username and password au‐
19 thentication, this will clear the credentials in your user configura‐
20 tion. In this case, it will only affect the current environment.
21
22 If --scope is provided, this will find the credentials for the registry
23 connected to that scope, if set.
24
25 Configuration
26 <!-- AUTOGENERATED CONFIG DESCRIPTIONS START --> <!-- automatically
27 generated, do not edit manually --> <!-- see lib/utils/config/defini‐
28 tions.js -->
29
30 registry
31 • Default: "https://registry.npmjs.org/"
32
33 • Type: URL
34
35
36 The base URL of the npm registry. <!-- automatically generated, do not
37 edit manually --> <!-- see lib/utils/config/definitions.js -->
38
39
40 scope
41 • Default: the scope of the current project, if any, or ""
42
43 • Type: String
44
45
46 Associate an operation with a scope for a scoped registry.
47
48 Useful when logging in to or out of a private registry:
49
50 # log in, linking the scope to the custom registry
51 npm login --scope=@mycorp --registry=https://registry.mycorp.com
52
53 # log out, removing the link and the auth token
54 npm logout --scope=@mycorp
55
56 This will cause @mycorp to be mapped to the registry for future instal‐
57 lation of packages specified according to the pattern @mycorp/package.
58
59 This will also cause npm init to create a scoped package.
60
61 # accept all defaults, and create a package named "@foo/whatever",
62 # instead of just named "whatever"
63 npm init --scope=@foo --yes
64 <!-- automatically generated, do not edit manually --> <!-- see
65 lib/utils/config/definitions.js -->
66
67 <!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
68
69
70 See Also
71 • npm help adduser
72
73 • npm help registry
74
75 • npm help config
76
77 • npm help whoami
78
79
80
81
82 October 2021 NPM-LOGOUT(1)