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
- Default:
"https://registry.npmjs.org/" - Type: URL
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 loginnpm help registrynpm help confignpm 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
- arch rolling: npm 12.2.1-1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms