Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
npm-logout.md73 linesDownload Raw Back to commands
1---
2title: npm-logout
3section: 1
4description: Log out of the registry
5---
6
7### Synopsis
8
9```bash
10npm logout
11```
12
13Note: This command is unaware of workspaces.
14
15### Description
16
17When logged into a registry that supports token-based authentication, tell the server to end this token's session.
18This will invalidate the token everywhere you're using it, not just for the current environment.
19
20When logged into a legacy registry that uses username and password authentication, this will clear the credentials in your user configuration.
21In this case, it will _only_ affect the current environment.
22
23If `--scope` is provided, this will find the credentials for the registry connected to that scope, if set.
24
25### Configuration
26
27#### `registry`
28
29* Default: "https://registry.npmjs.org/"
30* Type: URL
31
32The base URL of the npm registry.
33
34
35
36#### `scope`
37
38* Default: the scope of the current project, if any, or ""
39* Type: String
40
41Associate an operation with a scope for a scoped registry.
42
43Useful when logging in to or out of a private registry:
44
45```
46# log in, linking the scope to the custom registry
47npm login --scope=@mycorp --registry=https://registry.mycorp.com
48
49# log out, removing the link and the auth token
50npm logout --scope=@mycorp
51```
52
53This will cause `@mycorp` to be mapped to the registry for future
54installation of packages specified according to the pattern
55`@mycorp/package`.
56
57This will also cause `npm init` to create a scoped package.
58
59```
60# accept all defaults, and create a package named "@foo/whatever",
61# instead of just named "whatever"
62npm init --scope=@foo --yes
63```
64
65
66
67### See Also
68
69* [npm adduser](/commands/npm-adduser)
70* [npm registry](/using-npm/registry)
71* [npm config](/commands/npm-config)
72* [npm whoami](/commands/npm-whoami)
73 
codekingpro/portable-devtools · Team Ai