main
@reggi/path-to-regexp
dependabot/npm_and_yarn/main/copy-to-clipboard-4.0.2
dependabot/npm_and_yarn/main/eslint-10.4.0
dependabot/npm_and_yarn/main/npmcli/eslint-config-7.0.0
dependabot/npm_and_yarn/main/proc-log-7.0.0
dependabot/npm_and_yarn/npm_and_yarn-826852524d
dependabot/npm_and_yarn/npm_and_yarn-ab9a7f4bc2
deprecate-totp-2fa
dhei/classic-tokens
gat-bypass-2fa-docs
jpg619/fix-accessibility-content-flow
jpg619/version-bump-tar-2
kartykp/gat-bypass-2fa-docs
kartykp/upgrade-path-to-regex
main
maitxn/version-bump-tar
patch-1
reggi/cache-based-on-version
reggi/dev-engines
reggi/fix-transform-prettier
reggi/overrides
update-search-sensitivity
| 1 | --- |
| 2 | title: npm-logout |
| 3 | section: 1 |
| 4 | description: Log out of the registry |
| 5 | github_repo: npm/cli |
| 6 | github_branch: release/v6 |
| 7 | github_path: docs/content/commands/npm-logout.md |
| 8 | redirect_from: |
| 9 | - /cli-documentation/v6/cli-commands/logout |
| 10 | - /cli-documentation/v6/cli-commands/npm-logout |
| 11 | - /cli-documentation/v6/commands/logout |
| 12 | - /cli-documentation/v6/commands/npm-logout |
| 13 | - /cli-documentation/v6/logout |
| 14 | - /cli-documentation/v6/npm-logout |
| 15 | - /cli/v6/cli-commands/logout |
| 16 | - /cli/v6/cli-commands/npm-logout |
| 17 | - /cli/v6/commands/logout |
| 18 | - /cli/v6/logout |
| 19 | - /cli/v6/npm-logout |
| 20 | --- |
| 21 | |
| 22 | ### Synopsis |
| 23 | |
| 24 | ```bash |
| 25 | npm logout [--registry=<url>] [--scope=<@scope>] |
| 26 | ``` |
| 27 | |
| 28 | ### Description |
| 29 | |
| 30 | When logged into a registry that supports token-based authentication, tell the server to end this token's session. This will invalidate the token everywhere you're using it, not just for the current environment. |
| 31 | |
| 32 | When logged into a legacy registry that uses username and password authentication, this will clear the credentials in your user configuration. In this case, it will _only_ affect the current environment. |
| 33 | |
| 34 | If `--scope` is provided, this will find the credentials for the registry connected to that scope, if set. |
| 35 | |
| 36 | ### Configuration |
| 37 | |
| 38 | #### registry |
| 39 | |
| 40 | Default: https://registry.npmjs.org/ |
| 41 | |
| 42 | The base URL of the npm package registry. If `scope` is also specified, it takes precedence. |
| 43 | |
| 44 | #### scope |
| 45 | |
| 46 | Default: The scope of your current project, if any, otherwise none. |
| 47 | |
| 48 | If specified, you will be logged out of the specified scope. See [`scope`](/cli/v6/using-npm/scope). |
| 49 | |
| 50 | ```bash |
| 51 | npm logout --scope=@myco |
| 52 | ``` |
| 53 | |
| 54 | ### See Also |
| 55 | |
| 56 | - [npm adduser](/cli/v6/commands/npm-adduser) |
| 57 | - [npm registry](/cli/v6/using-npm/registry) |
| 58 | - [npm config](/cli/v6/commands/npm-config) |
| 59 | - [npm whoami](/cli/v6/commands/npm-whoami) |