npm-adduser.1 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. .HR
  2. .P
  3. section: cli\-commands
  4. title: npm\-adduser
  5. description: Set access level on published packages
  6. .HR
  7. .TH "NPM\-ADDUSER" "1" "August 2021" "" ""
  8. .SH "NAME"
  9. \fBnpm-adduser\fR \- Add a registry user account
  10. .SS Synopsis
  11. .P
  12. .RS 2
  13. .nf
  14. npm adduser [\-\-registry=url] [\-\-scope=@orgname] [\-\-always\-auth] [\-\-auth\-type=legacy]
  15. aliases: login, add\-user
  16. .fi
  17. .RE
  18. .SS Description
  19. .P
  20. Create or verify a user named \fB<username>\fP in the specified registry, and
  21. save the credentials to the \fB\|\.npmrc\fP file\. If no registry is specified,
  22. the default registry will be used (see npm help \fBconfig\fP)\.
  23. .P
  24. The username, password, and email are read in from prompts\.
  25. .P
  26. To reset your password, go to https://www\.npmjs\.com/forgot
  27. .P
  28. To change your email address, go to https://www\.npmjs\.com/email\-edit
  29. .P
  30. You may use this command multiple times with the same user account to
  31. authorize on a new machine\. When authenticating on a new machine,
  32. the username, password and email address must all match with
  33. your existing record\.
  34. .P
  35. \fBnpm login\fP is an alias to \fBadduser\fP and behaves exactly the same way\.
  36. .SS Configuration
  37. .SS registry
  38. .P
  39. Default: https://registry\.npmjs\.org/
  40. .P
  41. The base URL of the npm package registry\. If \fBscope\fP is also specified,
  42. this registry will only be used for packages with that scope\. \fBscope\fP defaults
  43. to the scope of the project directory you're currently in, if any\. See npm help \fBscope\fP\|\.
  44. .SS scope
  45. .P
  46. Default: none
  47. .P
  48. If specified, the user and login credentials given will be associated
  49. with the specified scope\. See npm help \fBscope\fP\|\. You can use both at the same time,
  50. e\.g\.
  51. .P
  52. .RS 2
  53. .nf
  54. npm adduser \-\-registry=http://myregistry\.example\.com \-\-scope=@myco
  55. .fi
  56. .RE
  57. .P
  58. This will set a registry for the given scope and login or create a user for
  59. that registry at the same time\.
  60. .SS always\-auth
  61. .P
  62. Default: false
  63. .P
  64. If specified, save configuration indicating that all requests to the given
  65. registry should include authorization information\. Useful for private
  66. registries\. Can be used with \fB\-\-registry\fP and / or \fB\-\-scope\fP, e\.g\.
  67. .P
  68. .RS 2
  69. .nf
  70. npm adduser \-\-registry=http://private\-registry\.example\.com \-\-always\-auth
  71. .fi
  72. .RE
  73. .P
  74. This will ensure that all requests to that registry (including for tarballs)
  75. include an authorization header\. This setting may be necessary for use with
  76. private registries where metadata and package tarballs are stored on hosts with
  77. different hostnames\. See \fBalways\-auth\fP in npm help \fBconfig\fP for more details on always\-auth\. Registry\-specific configuration of \fBalways\-auth\fP takes precedence over any global configuration\.
  78. .SS auth\-type
  79. .RS 0
  80. .IP \(bu 2
  81. Default: \fB\|'legacy'\fP
  82. .IP \(bu 2
  83. Type: \fB\|'legacy'\fP, \fB\|'sso'\fP, \fB\|'saml'\fP, \fB\|'oauth'\fP
  84. .RE
  85. .P
  86. What authentication strategy to use with \fBadduser\fP/\fBlogin\fP\|\. Some npm registries
  87. (for example, npmE) might support alternative auth strategies besides classic
  88. username/password entry in legacy npm\.
  89. .SS See Also
  90. .RS 0
  91. .IP \(bu 2
  92. npm help registry
  93. .IP \(bu 2
  94. npm help config
  95. .IP \(bu 2
  96. npm help npmrc
  97. .IP \(bu 2
  98. npm help owner
  99. .IP \(bu 2
  100. npm help whoami
  101. .RE