npm-profile.1 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. .TH "NPM-PROFILE" "1" "March 2026" "NPM@11.12.0" ""
  2. .SH "NAME"
  3. \fBnpm-profile\fR - Change settings on your registry profile
  4. .SS "Synopsis"
  5. .P
  6. .RS 2
  7. .nf
  8. npm profile enable-2fa \[lB]auth-only|auth-and-writes\[rB]
  9. npm profile disable-2fa
  10. npm profile get \[lB]<key>\[rB]
  11. npm profile set <key> <value>
  12. .fi
  13. .RE
  14. .P
  15. Note: This command is unaware of workspaces.
  16. .SS "Description"
  17. .P
  18. Change your profile information on the registry. Note that this command depends on the registry implementation, so third-party registries may not support this interface.
  19. .RS 0
  20. .IP \(bu 4
  21. \fBnpm profile get \[lB]<property>\[rB]\fR: Display all of the properties of your profile, or one or more specific properties. It looks like:
  22. .RE 0
  23. .P
  24. .RS 2
  25. .nf
  26. name: example
  27. email: e@example.com (verified)
  28. two-factor auth: auth-and-writes
  29. fullname: Example User
  30. homepage:
  31. freenode:
  32. twitter:
  33. github:
  34. created: 2015-02-26T01:38:35.892Z
  35. updated: 2017-10-02T21:29:45.922Z
  36. .fi
  37. .RE
  38. .RS 0
  39. .IP \(bu 4
  40. \fBnpm profile set <property> <value>\fR: Set the value of a profile property. You can set the following properties this way: email, fullname, homepage, freenode, twitter, github
  41. .IP \(bu 4
  42. \fBnpm profile set password\fR: Change your password. This is interactive, you'll be prompted for your current password and a new password. You'll also be prompted for an OTP if you have two-factor authentication enabled.
  43. .IP \(bu 4
  44. \fBnpm profile enable-2fa \[lB]auth-and-writes|auth-only\[rB]\fR: Enables two-factor authentication. Defaults to \fBauth-and-writes\fR mode. Modes are:
  45. .RS 4
  46. .IP \(bu 4
  47. \fBauth-only\fR: Require an OTP when logging in or making changes to your account's authentication. The OTP will be required on both the website and the command line.
  48. .IP \(bu 4
  49. \fBauth-and-writes\fR: Requires an OTP at all the times \fBauth-only\fR does, and also requires one when publishing a module, setting the \fBlatest\fR dist-tag, or changing access via \fBnpm access\fR and \fBnpm owner\fR.
  50. .RE 0
  51. .IP \(bu 4
  52. \fBnpm profile disable-2fa\fR: Disables two-factor authentication.
  53. .RE 0
  54. .SS "Details"
  55. .P
  56. Some of these commands may not be available on non npmjs.com registries.
  57. .SS "Configuration"
  58. .SS "\fBregistry\fR"
  59. .RS 0
  60. .IP \(bu 4
  61. Default: "https://registry.npmjs.org/"
  62. .IP \(bu 4
  63. Type: URL
  64. .RE 0
  65. .P
  66. The base URL of the npm registry.
  67. .SS "\fBjson\fR"
  68. .RS 0
  69. .IP \(bu 4
  70. Default: false
  71. .IP \(bu 4
  72. Type: Boolean
  73. .RE 0
  74. .P
  75. Whether or not to output JSON data, rather than the normal output.
  76. .RS 0
  77. .IP \(bu 4
  78. In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR.
  79. .RE 0
  80. .P
  81. Not supported by all npm commands.
  82. .SS "\fBparseable\fR"
  83. .RS 0
  84. .IP \(bu 4
  85. Default: false
  86. .IP \(bu 4
  87. Type: Boolean
  88. .RE 0
  89. .P
  90. Output parseable results from commands that write to standard output. For \fBnpm search\fR, this will be tab-separated table format.
  91. .SS "\fBotp\fR"
  92. .RS 0
  93. .IP \(bu 4
  94. Default: null
  95. .IP \(bu 4
  96. Type: null or String
  97. .RE 0
  98. .P
  99. This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with \fBnpm access\fR.
  100. .P
  101. If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one.
  102. .SS "See Also"
  103. .RS 0
  104. .IP \(bu 4
  105. npm help adduser
  106. .IP \(bu 4
  107. npm help registry
  108. .IP \(bu 4
  109. npm help config
  110. .IP \(bu 4
  111. npm help npmrc
  112. .IP \(bu 4
  113. npm help owner
  114. .IP \(bu 4
  115. npm help whoami
  116. .IP \(bu 4
  117. npm help token
  118. .RE 0