npm-logout.1 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. .TH "NPM\-LOGOUT" "1" "October 2021" "" ""
  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 [\-\-registry=<url>] [\-\-scope=<@scope>]
  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
  16. the server to end this token's session\. This will invalidate the token
  17. everywhere you're using it, not just for the current environment\.
  18. .P
  19. When logged into a legacy registry that uses username and password
  20. authentication, this will clear the credentials in your user configuration\.
  21. In this case, it will \fIonly\fR affect the current environment\.
  22. .P
  23. If \fB\-\-scope\fP is provided, this will find the credentials for the registry
  24. connected to that scope, if set\.
  25. .SS Configuration
  26. <!\-\- AUTOGENERATED CONFIG DESCRIPTIONS START \-\->
  27. <!\-\- automatically generated, do not edit manually \-\->
  28. <!\-\- see lib/utils/config/definitions\.js \-\->
  29. .SS \fBregistry\fP
  30. .RS 0
  31. .IP \(bu 2
  32. Default: "https://registry\.npmjs\.org/"
  33. .IP \(bu 2
  34. Type: URL
  35. .RE
  36. .P
  37. The base URL of the npm registry\.
  38. <!\-\- automatically generated, do not edit manually \-\->
  39. <!\-\- see lib/utils/config/definitions\.js \-\->
  40. .SS \fBscope\fP
  41. .RS 0
  42. .IP \(bu 2
  43. Default: the scope of the current project, if any, or ""
  44. .IP \(bu 2
  45. Type: String
  46. .RE
  47. .P
  48. Associate an operation with a scope for a scoped registry\.
  49. .P
  50. Useful when logging in to or out of a private registry:
  51. .P
  52. .RS 2
  53. .nf
  54. # log in, linking the scope to the custom registry
  55. npm login \-\-scope=@mycorp \-\-registry=https://registry\.mycorp\.com
  56. # log out, removing the link and the auth token
  57. npm logout \-\-scope=@mycorp
  58. .fi
  59. .RE
  60. .P
  61. This will cause \fB@mycorp\fP to be mapped to the registry for future
  62. installation of packages specified according to the pattern
  63. \fB@mycorp/package\fP\|\.
  64. .P
  65. This will also cause \fBnpm init\fP to create a scoped package\.
  66. .P
  67. .RS 2
  68. .nf
  69. # accept all defaults, and create a package named "@foo/whatever",
  70. # instead of just named "whatever"
  71. npm init \-\-scope=@foo \-\-yes
  72. .fi
  73. .RE
  74. <!\-\- automatically generated, do not edit manually \-\->
  75. <!\-\- see lib/utils/config/definitions\.js \-\->
  76. <!\-\- AUTOGENERATED CONFIG DESCRIPTIONS END \-\->
  77. .SS See Also
  78. .RS 0
  79. .IP \(bu 2
  80. npm help adduser
  81. .IP \(bu 2
  82. npm help registry
  83. .IP \(bu 2
  84. npm help config
  85. .IP \(bu 2
  86. npm help whoami
  87. .RE