npm-adduser.1 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. .TH "NPM-ADDUSER" "1" "March 2026" "NPM@11.12.0" ""
  2. .SH "NAME"
  3. \fBnpm-adduser\fR - Add a registry user account
  4. .SS "Synopsis"
  5. .P
  6. .RS 2
  7. .nf
  8. npm adduser
  9. alias: add-user
  10. .fi
  11. .RE
  12. .P
  13. Note: This command is unaware of workspaces.
  14. .SS "Description"
  15. .P
  16. Create a new user in the specified registry, and save the credentials to the \fB.npmrc\fR file. If no registry is specified, the default registry will be used (see npm help registry).
  17. .P
  18. When you run \fBnpm adduser\fR, the CLI automatically generates a legacy token of \fBpublish\fR type. For more information, see \fBAbout legacy tokens\fR \fI\(la/about-access-tokens#about-legacy-tokens\(ra\fR.
  19. .P
  20. When using \fBlegacy\fR for your \fBauth-type\fR, the username, password, and email are read in from prompts.
  21. .SS "Configuration"
  22. .SS "\fBregistry\fR"
  23. .RS 0
  24. .IP \(bu 4
  25. Default: "https://registry.npmjs.org/"
  26. .IP \(bu 4
  27. Type: URL
  28. .RE 0
  29. .P
  30. The base URL of the npm registry.
  31. .SS "\fBscope\fR"
  32. .RS 0
  33. .IP \(bu 4
  34. Default: the scope of the current project, if any, or ""
  35. .IP \(bu 4
  36. Type: String
  37. .RE 0
  38. .P
  39. Associate an operation with a scope for a scoped registry.
  40. .P
  41. Useful when logging in to or out of a private registry:
  42. .P
  43. .RS 2
  44. .nf
  45. # log in, linking the scope to the custom registry
  46. npm login --scope=@mycorp --registry=https://registry.mycorp.com
  47. # log out, removing the link and the auth token
  48. npm logout --scope=@mycorp
  49. .fi
  50. .RE
  51. .P
  52. 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.
  53. .P
  54. This will also cause \fBnpm init\fR to create a scoped package.
  55. .P
  56. .RS 2
  57. .nf
  58. # accept all defaults, and create a package named "@foo/whatever",
  59. # instead of just named "whatever"
  60. npm init --scope=@foo --yes
  61. .fi
  62. .RE
  63. .SS "\fBauth-type\fR"
  64. .RS 0
  65. .IP \(bu 4
  66. Default: "web"
  67. .IP \(bu 4
  68. Type: "legacy" or "web"
  69. .RE 0
  70. .P
  71. What authentication strategy to use with \fBlogin\fR. Note that if an \fBotp\fR config is given, this value will always be set to \fBlegacy\fR.
  72. .SS "See Also"
  73. .RS 0
  74. .IP \(bu 4
  75. npm help registry
  76. .IP \(bu 4
  77. npm help config
  78. .IP \(bu 4
  79. npm help npmrc
  80. .IP \(bu 4
  81. npm help owner
  82. .IP \(bu 4
  83. npm help whoami
  84. .IP \(bu 4
  85. npm help token
  86. .IP \(bu 4
  87. npm help profile
  88. .RE 0