npm-config.1 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. .TH "NPM\-CONFIG" "1" "October 2021" "" ""
  2. .SH "NAME"
  3. \fBnpm-config\fR \- Manage the npm configuration files
  4. .SS Synopsis
  5. .P
  6. .RS 2
  7. .nf
  8. npm config set <key>=<value> [<key>=<value> \.\.\.]
  9. npm config get [<key> [<key> \.\.\.]]
  10. npm config delete <key> [<key> \.\.\.]
  11. npm config list [\-\-json]
  12. npm config edit
  13. npm set <key>=<value> [<key>=<value> \.\.\.]
  14. npm get [<key> [<key> \.\.\.]]
  15. alias: c
  16. .fi
  17. .RE
  18. .P
  19. Note: This command is unaware of workspaces\.
  20. .SS Description
  21. .P
  22. npm gets its config settings from the command line, environment
  23. variables, \fBnpmrc\fP files, and in some cases, the \fBpackage\.json\fP file\.
  24. .P
  25. See npm help npmrc for more information about the npmrc
  26. files\.
  27. .P
  28. See npm help config(7) for a more thorough explanation of the
  29. mechanisms involved, and a full list of config options available\.
  30. .P
  31. The \fBnpm config\fP command can be used to update and edit the contents
  32. of the user and global npmrc files\.
  33. .SS Sub\-commands
  34. .P
  35. Config supports the following sub\-commands:
  36. .SS set
  37. .P
  38. .RS 2
  39. .nf
  40. npm config set key=value [key=value\.\.\.]
  41. npm set key=value [key=value\.\.\.]
  42. .fi
  43. .RE
  44. .P
  45. Sets each of the config keys to the value provided\.
  46. .P
  47. If value is omitted, then it sets it to an empty string\.
  48. .P
  49. Note: for backwards compatibility, \fBnpm config set key value\fP is supported
  50. as an alias for \fBnpm config set key=value\fP\|\.
  51. .SS get
  52. .P
  53. .RS 2
  54. .nf
  55. npm config get [key \.\.\.]
  56. npm get [key \.\.\.]
  57. .fi
  58. .RE
  59. .P
  60. Echo the config value(s) to stdout\.
  61. .P
  62. If multiple keys are provided, then the values will be prefixed with the
  63. key names\.
  64. .P
  65. If no keys are provided, then this command behaves the same as \fBnpm config
  66. list\fP\|\.
  67. .SS list
  68. .P
  69. .RS 2
  70. .nf
  71. npm config list
  72. .fi
  73. .RE
  74. .P
  75. Show all the config settings\. Use \fB\-l\fP to also show defaults\. Use \fB\-\-json\fP
  76. to show the settings in json format\.
  77. .SS delete
  78. .P
  79. .RS 2
  80. .nf
  81. npm config delete key [key \.\.\.]
  82. .fi
  83. .RE
  84. .P
  85. Deletes the specified keys from all configuration files\.
  86. .SS edit
  87. .P
  88. .RS 2
  89. .nf
  90. npm config edit
  91. .fi
  92. .RE
  93. .P
  94. Opens the config file in an editor\. Use the \fB\-\-global\fP flag to edit the
  95. global config\.
  96. .SS Configuration
  97. <!\-\- AUTOGENERATED CONFIG DESCRIPTIONS START \-\->
  98. <!\-\- automatically generated, do not edit manually \-\->
  99. <!\-\- see lib/utils/config/definitions\.js \-\->
  100. .SS \fBjson\fP
  101. .RS 0
  102. .IP \(bu 2
  103. Default: false
  104. .IP \(bu 2
  105. Type: Boolean
  106. .RE
  107. .P
  108. Whether or not to output JSON data, rather than the normal output\.
  109. .RS 0
  110. .IP \(bu 2
  111. In \fBnpm pkg set\fP it enables parsing set values with JSON\.parse() before
  112. saving them to your \fBpackage\.json\fP\|\.
  113. .RE
  114. .P
  115. Not supported by all npm commands\.
  116. <!\-\- automatically generated, do not edit manually \-\->
  117. <!\-\- see lib/utils/config/definitions\.js \-\->
  118. .SS \fBglobal\fP
  119. .RS 0
  120. .IP \(bu 2
  121. Default: false
  122. .IP \(bu 2
  123. Type: Boolean
  124. .RE
  125. .P
  126. Operates in "global" mode, so that packages are installed into the \fBprefix\fP
  127. folder instead of the current working directory\. See
  128. npm help folders for more on the differences in behavior\.
  129. .RS 0
  130. .IP \(bu 2
  131. packages are installed into the \fB{prefix}/lib/node_modules\fP folder, instead
  132. of the current working directory\.
  133. .IP \(bu 2
  134. bin files are linked to \fB{prefix}/bin\fP
  135. .IP \(bu 2
  136. man pages are linked to \fB{prefix}/share/man\fP
  137. .RE
  138. <!\-\- automatically generated, do not edit manually \-\->
  139. <!\-\- see lib/utils/config/definitions\.js \-\->
  140. .SS \fBeditor\fP
  141. .RS 0
  142. .IP \(bu 2
  143. Default: The EDITOR or VISUAL environment variables, or 'notepad\.exe' on
  144. Windows, or 'vim' on Unix systems
  145. .IP \(bu 2
  146. Type: String
  147. .RE
  148. .P
  149. The command to run for \fBnpm edit\fP and \fBnpm config edit\fP\|\.
  150. <!\-\- automatically generated, do not edit manually \-\->
  151. <!\-\- see lib/utils/config/definitions\.js \-\->
  152. .SS \fBlocation\fP
  153. .RS 0
  154. .IP \(bu 2
  155. Default: "user" unless \fB\-\-global\fP is passed, which will also set this value
  156. to "global"
  157. .IP \(bu 2
  158. Type: "global", "user", or "project"
  159. .RE
  160. .P
  161. When passed to \fBnpm config\fP this refers to which config file to use\.
  162. <!\-\- automatically generated, do not edit manually \-\->
  163. <!\-\- see lib/utils/config/definitions\.js \-\->
  164. .SS \fBlong\fP
  165. .RS 0
  166. .IP \(bu 2
  167. Default: false
  168. .IP \(bu 2
  169. Type: Boolean
  170. .RE
  171. .P
  172. Show extended information in \fBls\fP, \fBsearch\fP, and \fBhelp\-search\fP\|\.
  173. <!\-\- automatically generated, do not edit manually \-\->
  174. <!\-\- see lib/utils/config/definitions\.js \-\->
  175. <!\-\- AUTOGENERATED CONFIG DESCRIPTIONS END \-\->
  176. .SS See Also
  177. .RS 0
  178. .IP \(bu 2
  179. npm help folders
  180. .IP \(bu 2
  181. npm help config
  182. .IP \(bu 2
  183. npm help package\.json
  184. .IP \(bu 2
  185. npm help npmrc
  186. .IP \(bu 2
  187. npm help npm
  188. .RE