LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

npm-logout

removes authentication token

TLDR

Logout from npm
$ npm logout
copy
Logout from specific registry
$ npm logout --registry=[https://registry.example.com]
copy
Logout from scope
$ npm logout --scope=[@myorg]
copy

SYNOPSIS

npm logout [options]

DESCRIPTION

npm logout invalidates and removes the authentication token for the configured registry. For tokens issued by npm login, the registry is also notified to revoke the token server-side. The local .npmrc entry for the registry is then deleted.When the configured auth was a legacy username/password (basic auth), only the local credential is removed — there is nothing to revoke on the server.

PARAMETERS

--registry URL

Registry to logout from.
--scope SCOPE
Scoped registry.
--help
Display help information.

CAVEATS

Operates on a single registry at a time; pass --registry or --scope to log out of a non-default registry. Subsequent npm publish or npm install of private packages will fail until you log in again. Tokens stored manually in .npmrc (e.g., `_authToken=...`) without a matching server-side credential will be removed locally but cannot be revoked.

HISTORY

npm logout provides authentication management for npm registry access.

SEE ALSO

npm(1), npm-login(1), npm-whoami(1)

Copied to clipboard
Kai