1--- 2section: cli-commands 3title: npm-logout 4description: Log out of the registry 5--- 6 7# npm-logout(1) 8 9## Log out of the registry 10 11### Synopsis 12 13```bash 14npm logout [--registry=<url>] [--scope=<@scope>] 15``` 16 17### Description 18 19When logged into a registry that supports token-based authentication, tell the 20server to end this token's session. This will invalidate the token everywhere 21you're using it, not just for the current environment. 22 23When logged into a legacy registry that uses username and password authentication, this will 24clear the credentials in your user configuration. In this case, it will _only_ affect 25the current environment. 26 27If `--scope` is provided, this will find the credentials for the registry 28connected to that scope, if set. 29 30### Configuration 31 32#### registry 33 34Default: https://registry.npmjs.org/ 35 36The base URL of the npm package registry. If `scope` is also specified, 37it takes precedence. 38 39#### scope 40 41Default: The scope of your current project, if any, otherwise none. 42 43If specified, you will be logged out of the specified scope. See [`scope`](/using-npm/npm-scope). 44 45```bash 46npm logout --scope=@myco 47``` 48 49### See Also 50 51* [npm adduser](/cli-commands/npm-adduser) 52* [npm registry](/using-npm/registry) 53* [npm config](/cli-commands/npm-config) 54* [npm whoami](/cli-commands/npm-whoami) 55