npm-logout.1 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. .TH "NPM-LOGOUT" "1" "March 2026" "NPM@11.12.0" ""
  2. .SH "NAME"
  3. \fBnpm-logout\fR - Log out of the registry
  4. .SS "Synopsis"
  5. .P
  6. .RS 2
  7. .nf
  8. npm logout
  9. .fi
  10. .RE
  11. .P
  12. Note: This command is unaware of workspaces.
  13. .SS "Description"
  14. .P
  15. 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.
  16. .P
  17. 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 \fIonly\fR affect the current environment.
  18. .P
  19. If \fB--scope\fR is provided, this will find the credentials for the registry connected to that scope, if set.
  20. .SS "Configuration"
  21. .SS "\fBregistry\fR"
  22. .RS 0
  23. .IP \(bu 4
  24. Default: "https://registry.npmjs.org/"
  25. .IP \(bu 4
  26. Type: URL
  27. .RE 0
  28. .P
  29. The base URL of the npm registry.
  30. .SS "\fBscope\fR"
  31. .RS 0
  32. .IP \(bu 4
  33. Default: the scope of the current project, if any, or ""
  34. .IP \(bu 4
  35. Type: String
  36. .RE 0
  37. .P
  38. Associate an operation with a scope for a scoped registry.
  39. .P
  40. Useful when logging in to or out of a private registry:
  41. .P
  42. .RS 2
  43. .nf
  44. # log in, linking the scope to the custom registry
  45. npm login --scope=@mycorp --registry=https://registry.mycorp.com
  46. # log out, removing the link and the auth token
  47. npm logout --scope=@mycorp
  48. .fi
  49. .RE
  50. .P
  51. This will cause \fB@mycorp\fR to be mapped to the registry for future installation of packages specified according to the pattern \fB@mycorp/package\fR.
  52. .P
  53. This will also cause \fBnpm init\fR to create a scoped package.
  54. .P
  55. .RS 2
  56. .nf
  57. # accept all defaults, and create a package named "@foo/whatever",
  58. # instead of just named "whatever"
  59. npm init --scope=@foo --yes
  60. .fi
  61. .RE
  62. .SS "See Also"
  63. .RS 0
  64. .IP \(bu 4
  65. npm help adduser
  66. .IP \(bu 4
  67. npm help registry
  68. .IP \(bu 4
  69. npm help config
  70. .IP \(bu 4
  71. npm help whoami
  72. .RE 0