NPM-LOGOUT(1)

πŸ’– NAME πŸ’–

npm-logout β€” bestie, this is literally the "log out of the registry" command. Bye-bye token, see ya never ✨

✨ Synopsis ✨

npm logout
Heads up queen: this command is unaware of workspaces. Like, it doesn't know they exist. It's giving "not my department" πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the tea 🍡 β€” if you're logged into a registry that supports token-based authentication, this tells the server to end this token's session. And the way that this works? It invalidates the token everywhere you're using it, not just for the current environment. So if you had that token chilling in five different places, sorry babe, it's cooked everywhere πŸ”₯

Now, if you're logged into a legacy registry that uses username + password authentication, this instead clears the credentials in your user configuration. In that case only? It only affects the current environment. Lowkey more chill, ngl 🫢

And if --scope is provided, this will find the credentials for the registry connected to that scope, if set. iykyk 😌


πŸŽ€ CONFIGURATION πŸŽ€

registry

The base URL of the npm registry. That's it, that's the vibe πŸ¦‹

scope

  • Default: the scope of the current project, if any, or ""
  • Type: String

Associate an operation with a scope for a scoped registry. Fr fr, this is the one you want ✨

Super useful when logging in to or out of a private registry:

# log in, linking the scope to the custom registry
npm login --scope=@mycorp --registry=https://registry.mycorp.com

# log out, removing the link and the auth token
npm logout --scope=@mycorp

This will cause @mycorp to be mapped to the registry for future installation of packages specified according to the pattern @mycorp/package. Iconic mapping behaviour, honestly πŸ‘‘

This will also cause npm init to create a scoped package:

# accept all defaults, and create a package named "@foo/whatever",
# instead of just named "whatever"
npm init --scope=@foo --yes

Not it creating "@foo/whatever" instead of just "whatever" 😭 slay.


🌈 SEE ALSO 🌈

  • npm help login
  • npm help registry
  • npm help config
  • npm help whoami

That's the whole page bestie! πŸŽ€ Go forth and de-authenticate responsibly πŸ’œ

npm@12.2.1, October 2026 β€” signed, sealed, delivered, and logged out πŸ’…βœ¨
πŸ“¦ where this page comes from