config.7 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250
  1. .TH "CONFIG" "7" "March 2026" "NPM@11.12.0" ""
  2. .SH "NAME"
  3. \fBConfig\fR - About npm configuration
  4. .SS "Description"
  5. .P
  6. This article details npm configuration in general. To learn about the \fBconfig\fR command, see npm help config.
  7. .P
  8. npm gets its configuration values from the following sources, sorted by priority:
  9. .SS "Command Line Flags"
  10. .P
  11. Putting \fB--foo bar\fR on the command line sets the \fBfoo\fR configuration parameter to \fB"bar"\fR. A \fB--\fR argument tells the cli parser to stop reading flags. Using \fB--flag\fR without specifying any value will set the value to \fBtrue\fR.
  12. .P
  13. Example: \fB--flag1 --flag2\fR will set both configuration parameters to \fBtrue\fR, while \fB--flag1 --flag2 bar\fR will set \fBflag1\fR to \fBtrue\fR, and \fBflag2\fR to \fBbar\fR. Finally, \fB--flag1 --flag2 -- bar\fR will set both configuration parameters to \fBtrue\fR, and the \fBbar\fR is taken as a command argument.
  14. .P
  15. \fBCommon examples:\fR
  16. .RS 0
  17. .IP \(bu 4
  18. \fBnpm install --prefix /path/to/dir\fR - Runs npm commands in a different directory without changing the current working directory
  19. .IP \(bu 4
  20. \fBnpm install --global\fR - Installs packages globally (shorthand: \fB-g\fR)
  21. .IP \(bu 4
  22. \fBnpm install --save-dev\fR - Saves to devDependencies (shorthand: \fB-D\fR)
  23. .RE 0
  24. .P
  25. Any configuration option documented in the \fI(Config Settings)\fR section below can be set via command line flags using \fB--option-name value\fR syntax.
  26. .SS "Environment Variables"
  27. .P
  28. Any environment variables that start with \fBnpm_config_\fR will be interpreted as a configuration parameter. For example, putting \fBnpm_config_foo=bar\fR in your environment will set the \fBfoo\fR configuration parameter to \fBbar\fR. Any environment configurations that are not given a value will be given the value of \fBtrue\fR. Config values are case-insensitive, so \fBNPM_CONFIG_FOO=bar\fR will work the same. However, please note that inside npm help scripts npm will set its own environment variables and Node will prefer those lowercase versions over any uppercase ones that you might set. For details see \fBthis issue\fR \fI\(lahttps://github.com/npm/npm/issues/14528\(ra\fR.
  29. .P
  30. Notice that you need to use underscores instead of dashes, so \fB--allow-same-version\fR would become \fBnpm_config_allow_same_version=true\fR.
  31. .P
  32. \fBImportant:\fR When defining custom configuration keys in \fB.npmrc\fR files, use hyphens instead of underscores (e.g., \fBcustom-key=value\fR). This ensures they can be overridden by environment variables, since npm automatically converts underscores to hyphens when reading environment variables. Keys with underscores in \fB.npmrc\fR files cannot be overridden via environment variables.
  33. .SS "npmrc Files"
  34. .P
  35. The four relevant files are:
  36. .RS 0
  37. .IP \(bu 4
  38. per-project configuration file (\fB/path/to/my/project/.npmrc\fR)
  39. .IP \(bu 4
  40. per-user configuration file (defaults to \fB$HOME/.npmrc\fR; configurable via CLI option \fB--userconfig\fR or environment variable \fB$NPM_CONFIG_USERCONFIG\fR)
  41. .IP \(bu 4
  42. global configuration file (defaults to \fB$PREFIX/etc/npmrc\fR; configurable via CLI option \fB--globalconfig\fR or environment variable \fB$NPM_CONFIG_GLOBALCONFIG\fR)
  43. .IP \(bu 4
  44. npm's built-in configuration file (\fB/path/to/npm/npmrc\fR)
  45. .RE 0
  46. .P
  47. See npm help npmrc for more details.
  48. .SS "Default Configs"
  49. .P
  50. Run \fBnpm config ls -l\fR to see a set of configuration parameters that are internal to npm, and are defaults if nothing else is specified.
  51. .SS "Shorthands and Other CLI Niceties"
  52. .P
  53. The following shorthands are parsed on the command-line:
  54. .RS 0
  55. .IP \(bu 4
  56. \fB-a\fR: \fB--all\fR
  57. .IP \(bu 4
  58. \fB--enjoy-by\fR: \fB--before\fR
  59. .IP \(bu 4
  60. \fB-c\fR: \fB--call\fR
  61. .IP \(bu 4
  62. \fB--desc\fR: \fB--description\fR
  63. .IP \(bu 4
  64. \fB-f\fR: \fB--force\fR
  65. .IP \(bu 4
  66. \fB-g\fR: \fB--global\fR
  67. .IP \(bu 4
  68. \fB--iwr\fR: \fB--include-workspace-root\fR
  69. .IP \(bu 4
  70. \fB-L\fR: \fB--location\fR
  71. .IP \(bu 4
  72. \fB-d\fR: \fB--loglevel info\fR
  73. .IP \(bu 4
  74. \fB-s\fR: \fB--loglevel silent\fR
  75. .IP \(bu 4
  76. \fB--silent\fR: \fB--loglevel silent\fR
  77. .IP \(bu 4
  78. \fB--ddd\fR: \fB--loglevel silly\fR
  79. .IP \(bu 4
  80. \fB--dd\fR: \fB--loglevel verbose\fR
  81. .IP \(bu 4
  82. \fB--verbose\fR: \fB--loglevel verbose\fR
  83. .IP \(bu 4
  84. \fB-q\fR: \fB--loglevel warn\fR
  85. .IP \(bu 4
  86. \fB--quiet\fR: \fB--loglevel warn\fR
  87. .IP \(bu 4
  88. \fB-l\fR: \fB--long\fR
  89. .IP \(bu 4
  90. \fB-m\fR: \fB--message\fR
  91. .IP \(bu 4
  92. \fB--local\fR: \fB--no-global\fR
  93. .IP \(bu 4
  94. \fB-n\fR: \fB--no-yes\fR
  95. .IP \(bu 4
  96. \fB--no\fR: \fB--no-yes\fR
  97. .IP \(bu 4
  98. \fB-p\fR: \fB--parseable\fR
  99. .IP \(bu 4
  100. \fB--porcelain\fR: \fB--parseable\fR
  101. .IP \(bu 4
  102. \fB-C\fR: \fB--prefix\fR
  103. .IP \(bu 4
  104. \fB--readonly\fR: \fB--read-only\fR
  105. .IP \(bu 4
  106. \fB--reg\fR: \fB--registry\fR
  107. .IP \(bu 4
  108. \fB-S\fR: \fB--save\fR
  109. .IP \(bu 4
  110. \fB-B\fR: \fB--save-bundle\fR
  111. .IP \(bu 4
  112. \fB-D\fR: \fB--save-dev\fR
  113. .IP \(bu 4
  114. \fB-E\fR: \fB--save-exact\fR
  115. .IP \(bu 4
  116. \fB-O\fR: \fB--save-optional\fR
  117. .IP \(bu 4
  118. \fB-P\fR: \fB--save-prod\fR
  119. .IP \(bu 4
  120. \fB-?\fR: \fB--usage\fR
  121. .IP \(bu 4
  122. \fB-h\fR: \fB--usage\fR
  123. .IP \(bu 4
  124. \fB-H\fR: \fB--usage\fR
  125. .IP \(bu 4
  126. \fB--help\fR: \fB--usage\fR
  127. .IP \(bu 4
  128. \fB-v\fR: \fB--version\fR
  129. .IP \(bu 4
  130. \fB-w\fR: \fB--workspace\fR
  131. .IP \(bu 4
  132. \fB--ws\fR: \fB--workspaces\fR
  133. .IP \(bu 4
  134. \fB-y\fR: \fB--yes\fR
  135. .RE 0
  136. .P
  137. If the specified configuration param resolves unambiguously to a known configuration parameter, then it is expanded to that configuration parameter. For example:
  138. .P
  139. .RS 2
  140. .nf
  141. npm ls --par
  142. # same as:
  143. npm ls --parseable
  144. .fi
  145. .RE
  146. .P
  147. If multiple single-character shorthands are strung together, and the resulting combination is unambiguously not some other configuration param, then it is expanded to its various component pieces. For example:
  148. .P
  149. .RS 2
  150. .nf
  151. npm ls -gpld
  152. # same as:
  153. npm ls --global --parseable --long --loglevel info
  154. .fi
  155. .RE
  156. .SS "Config Settings"
  157. .SS "\fB_auth\fR"
  158. .RS 0
  159. .IP \(bu 4
  160. Default: null
  161. .IP \(bu 4
  162. Type: null or String
  163. .RE 0
  164. .P
  165. A basic-auth string to use when authenticating against the npm registry. This will ONLY be used to authenticate against the npm registry. For other registries you will need to scope it like "//other-registry.tld/:_auth"
  166. .P
  167. Warning: This should generally not be set via a command-line option. It is safer to use a registry-provided authentication bearer token stored in the ~/.npmrc file by running \fBnpm login\fR.
  168. .SS "\fBaccess\fR"
  169. .RS 0
  170. .IP \(bu 4
  171. Default: 'public' for new packages, existing packages it will not change the current level
  172. .IP \(bu 4
  173. Type: null, "restricted", or "public"
  174. .RE 0
  175. .P
  176. If you do not want your scoped package to be publicly viewable (and installable) set \fB--access=restricted\fR.
  177. .P
  178. Unscoped packages cannot be set to \fBrestricted\fR.
  179. .P
  180. Note: This defaults to not changing the current access level for existing packages. Specifying a value of \fBrestricted\fR or \fBpublic\fR during publish will change the access for an existing package the same way that \fBnpm access set
  181. status\fR would.
  182. .SS "\fBall\fR"
  183. .RS 0
  184. .IP \(bu 4
  185. Default: false
  186. .IP \(bu 4
  187. Type: Boolean
  188. .RE 0
  189. .P
  190. When running \fBnpm outdated\fR and \fBnpm ls\fR, setting \fB--all\fR will show all outdated or installed packages, rather than only those directly depended upon by the current project.
  191. .SS "\fBallow-git\fR"
  192. .RS 0
  193. .IP \(bu 4
  194. Default: "all"
  195. .IP \(bu 4
  196. Type: "all", "none", or "root"
  197. .RE 0
  198. .P
  199. Limits the ability for npm to fetch dependencies from git references. That is, dependencies that point to a git repo instead of a version or semver range. Please note that this could leave your tree incomplete and some packages may not function as intended or designed.
  200. .P
  201. \fBall\fR allows any git dependencies to be fetched and installed. \fBnone\fR prevents any git dependencies from being fetched and installed. \fBroot\fR only allows git dependencies defined in your project's package.json to be fetched installed. Also allows git dependencies to be fetched for other commands like \fBnpm view\fR
  202. .SS "\fBallow-same-version\fR"
  203. .RS 0
  204. .IP \(bu 4
  205. Default: false
  206. .IP \(bu 4
  207. Type: Boolean
  208. .RE 0
  209. .P
  210. Prevents throwing an error when \fBnpm version\fR is used to set the new version to the same value as the current version.
  211. .SS "\fBaudit\fR"
  212. .RS 0
  213. .IP \(bu 4
  214. Default: true
  215. .IP \(bu 4
  216. Type: Boolean
  217. .RE 0
  218. .P
  219. When "true" submit audit reports alongside the current npm command to the default registry and all registries configured for scopes. See the documentation for npm help audit for details on what is submitted.
  220. .SS "\fBaudit-level\fR"
  221. .RS 0
  222. .IP \(bu 4
  223. Default: null
  224. .IP \(bu 4
  225. Type: null, "info", "low", "moderate", "high", "critical", or "none"
  226. .RE 0
  227. .P
  228. The minimum level of vulnerability for \fBnpm audit\fR to exit with a non-zero exit code.
  229. .SS "\fBauth-type\fR"
  230. .RS 0
  231. .IP \(bu 4
  232. Default: "web"
  233. .IP \(bu 4
  234. Type: "legacy" or "web"
  235. .RE 0
  236. .P
  237. 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.
  238. .SS "\fBbefore\fR"
  239. .RS 0
  240. .IP \(bu 4
  241. Default: null
  242. .IP \(bu 4
  243. Type: null or Date
  244. .RE 0
  245. .P
  246. If passed to \fBnpm install\fR, will rebuild the npm tree such that only versions that were available \fBon or before\fR the given date are installed. If there are no versions available for the current set of dependencies, the command will error.
  247. .P
  248. If the requested version is a \fBdist-tag\fR and the given tag does not pass the \fB--before\fR filter, the most recent version less than or equal to that tag will be used. For example, \fBfoo@latest\fR might install \fBfoo@1.2\fR even though \fBlatest\fR is \fB2.0\fR.
  249. .P
  250. This config cannot be used with: \fBmin-release-age\fR
  251. .SS "\fBbin-links\fR"
  252. .RS 0
  253. .IP \(bu 4
  254. Default: true
  255. .IP \(bu 4
  256. Type: Boolean
  257. .RE 0
  258. .P
  259. Tells npm to create symlinks (or \fB.cmd\fR shims on Windows) for package executables.
  260. .P
  261. Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems.
  262. .SS "\fBbrowser\fR"
  263. .RS 0
  264. .IP \(bu 4
  265. Default: macOS: \fB"open"\fR, Windows: \fB"start"\fR, Others: \fB"xdg-open"\fR
  266. .IP \(bu 4
  267. Type: null, Boolean, or String
  268. .RE 0
  269. .P
  270. The browser that is called by npm commands to open websites.
  271. .P
  272. Set to \fBfalse\fR to suppress browser behavior and instead print urls to terminal.
  273. .P
  274. Set to \fBtrue\fR to use default system URL opener.
  275. .SS "\fBbypass-2fa\fR"
  276. .RS 0
  277. .IP \(bu 4
  278. Default: false
  279. .IP \(bu 4
  280. Type: Boolean
  281. .RE 0
  282. .P
  283. When creating a Granular Access Token with \fBnpm token create\fR, setting this to true will allow the token to bypass two-factor authentication. This is useful for automation and CI/CD workflows.
  284. .SS "\fBca\fR"
  285. .RS 0
  286. .IP \(bu 4
  287. Default: null
  288. .IP \(bu 4
  289. Type: null or String (can be set multiple times)
  290. .RE 0
  291. .P
  292. The Certificate Authority signing certificate that is trusted for SSL connections to the registry. Values should be in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with newlines replaced by the string "\[rs]n". For example:
  293. .P
  294. .RS 2
  295. .nf
  296. ca="-----BEGIN CERTIFICATE-----\[rs]nXXXX\[rs]nXXXX\[rs]n-----END CERTIFICATE-----"
  297. .fi
  298. .RE
  299. .P
  300. Set to \fBnull\fR to only allow "known" registrars, or to a specific CA cert to trust only that specific signing authority.
  301. .P
  302. Multiple CAs can be trusted by specifying an array of certificates:
  303. .P
  304. .RS 2
  305. .nf
  306. ca\[lB]\[rB]="..."
  307. ca\[lB]\[rB]="..."
  308. .fi
  309. .RE
  310. .P
  311. See also the \fBstrict-ssl\fR config.
  312. .SS "\fBcache\fR"
  313. .RS 0
  314. .IP \(bu 4
  315. Default: Windows: \fB%LocalAppData%\[rs]npm-cache\fR, Posix: \fB~/.npm\fR
  316. .IP \(bu 4
  317. Type: Path
  318. .RE 0
  319. .P
  320. The location of npm's cache directory.
  321. .SS "\fBcafile\fR"
  322. .RS 0
  323. .IP \(bu 4
  324. Default: null
  325. .IP \(bu 4
  326. Type: Path
  327. .RE 0
  328. .P
  329. A path to a file containing one or multiple Certificate Authority signing certificates. Similar to the \fBca\fR setting, but allows for multiple CA's, as well as for the CA information to be stored in a file on disk.
  330. .SS "\fBcall\fR"
  331. .RS 0
  332. .IP \(bu 4
  333. Default: ""
  334. .IP \(bu 4
  335. Type: String
  336. .RE 0
  337. .P
  338. Optional companion option for \fBnpm exec\fR, \fBnpx\fR that allows for specifying a custom command to be run along with the installed packages.
  339. .P
  340. .RS 2
  341. .nf
  342. npm exec --package yo --package generator-node --call "yo node"
  343. .fi
  344. .RE
  345. .SS "\fBcidr\fR"
  346. .RS 0
  347. .IP \(bu 4
  348. Default: null
  349. .IP \(bu 4
  350. Type: null or String (can be set multiple times)
  351. .RE 0
  352. .P
  353. This is a list of CIDR address to be used when configuring limited access tokens with the \fBnpm token create\fR command.
  354. .SS "\fBcolor\fR"
  355. .RS 0
  356. .IP \(bu 4
  357. Default: true unless the NO_COLOR environ is set to something other than '0'
  358. .IP \(bu 4
  359. Type: "always" or Boolean
  360. .RE 0
  361. .P
  362. If false, never shows colors. If \fB"always"\fR then always shows colors. If true, then only prints color codes for tty file descriptors.
  363. .SS "\fBcommit-hooks\fR"
  364. .RS 0
  365. .IP \(bu 4
  366. Default: true
  367. .IP \(bu 4
  368. Type: Boolean
  369. .RE 0
  370. .P
  371. Run git commit hooks when using the \fBnpm version\fR command.
  372. .SS "\fBcpu\fR"
  373. .RS 0
  374. .IP \(bu 4
  375. Default: null
  376. .IP \(bu 4
  377. Type: null or String
  378. .RE 0
  379. .P
  380. Override CPU architecture of native modules to install. Acceptable values are same as \fBcpu\fR field of package.json, which comes from \fBprocess.arch\fR.
  381. .SS "\fBdepth\fR"
  382. .RS 0
  383. .IP \(bu 4
  384. Default: \fBInfinity\fR if \fB--all\fR is set; otherwise, \fB0\fR
  385. .IP \(bu 4
  386. Type: null or Number
  387. .RE 0
  388. .P
  389. The depth to go when recursing packages for \fBnpm ls\fR.
  390. .P
  391. If not set, \fBnpm ls\fR will show only the immediate dependencies of the root project. If \fB--all\fR is set, then npm will show all dependencies by default.
  392. .SS "\fBdescription\fR"
  393. .RS 0
  394. .IP \(bu 4
  395. Default: true
  396. .IP \(bu 4
  397. Type: Boolean
  398. .RE 0
  399. .P
  400. Show the description in \fBnpm search\fR
  401. .SS "\fBdiff\fR"
  402. .RS 0
  403. .IP \(bu 4
  404. Default:
  405. .IP \(bu 4
  406. Type: String (can be set multiple times)
  407. .RE 0
  408. .P
  409. Define arguments to compare in \fBnpm diff\fR.
  410. .SS "\fBdiff-dst-prefix\fR"
  411. .RS 0
  412. .IP \(bu 4
  413. Default: "b/"
  414. .IP \(bu 4
  415. Type: String
  416. .RE 0
  417. .P
  418. Destination prefix to be used in \fBnpm diff\fR output.
  419. .SS "\fBdiff-ignore-all-space\fR"
  420. .RS 0
  421. .IP \(bu 4
  422. Default: false
  423. .IP \(bu 4
  424. Type: Boolean
  425. .RE 0
  426. .P
  427. Ignore whitespace when comparing lines in \fBnpm diff\fR.
  428. .SS "\fBdiff-name-only\fR"
  429. .RS 0
  430. .IP \(bu 4
  431. Default: false
  432. .IP \(bu 4
  433. Type: Boolean
  434. .RE 0
  435. .P
  436. Prints only filenames when using \fBnpm diff\fR.
  437. .SS "\fBdiff-no-prefix\fR"
  438. .RS 0
  439. .IP \(bu 4
  440. Default: false
  441. .IP \(bu 4
  442. Type: Boolean
  443. .RE 0
  444. .P
  445. Do not show any source or destination prefix in \fBnpm diff\fR output.
  446. .P
  447. Note: this causes \fBnpm diff\fR to ignore the \fB--diff-src-prefix\fR and \fB--diff-dst-prefix\fR configs.
  448. .SS "\fBdiff-src-prefix\fR"
  449. .RS 0
  450. .IP \(bu 4
  451. Default: "a/"
  452. .IP \(bu 4
  453. Type: String
  454. .RE 0
  455. .P
  456. Source prefix to be used in \fBnpm diff\fR output.
  457. .SS "\fBdiff-text\fR"
  458. .RS 0
  459. .IP \(bu 4
  460. Default: false
  461. .IP \(bu 4
  462. Type: Boolean
  463. .RE 0
  464. .P
  465. Treat all files as text in \fBnpm diff\fR.
  466. .SS "\fBdiff-unified\fR"
  467. .RS 0
  468. .IP \(bu 4
  469. Default: 3
  470. .IP \(bu 4
  471. Type: Number
  472. .RE 0
  473. .P
  474. The number of lines of context to print in \fBnpm diff\fR.
  475. .SS "\fBdry-run\fR"
  476. .RS 0
  477. .IP \(bu 4
  478. Default: false
  479. .IP \(bu 4
  480. Type: Boolean
  481. .RE 0
  482. .P
  483. Indicates that you don't want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, \fBinstall\fR, \fBupdate\fR, \fBdedupe\fR, \fBuninstall\fR, as well as \fBpack\fR and \fBpublish\fR.
  484. .P
  485. Note: This is NOT honored by other network related commands, eg \fBdist-tags\fR, \fBowner\fR, etc.
  486. .SS "\fBeditor\fR"
  487. .RS 0
  488. .IP \(bu 4
  489. Default: The EDITOR or VISUAL environment variables, or '%SYSTEMROOT%\[rs]notepad.exe' on Windows, or 'vi' on Unix systems
  490. .IP \(bu 4
  491. Type: String
  492. .RE 0
  493. .P
  494. The command to run for \fBnpm edit\fR and \fBnpm config edit\fR.
  495. .SS "\fBengine-strict\fR"
  496. .RS 0
  497. .IP \(bu 4
  498. Default: false
  499. .IP \(bu 4
  500. Type: Boolean
  501. .RE 0
  502. .P
  503. If set to true, then npm will stubbornly refuse to install (or even consider installing) any package that claims to not be compatible with the current Node.js version.
  504. .P
  505. This can be overridden by setting the \fB--force\fR flag.
  506. .SS "\fBexpect-result-count\fR"
  507. .RS 0
  508. .IP \(bu 4
  509. Default: null
  510. .IP \(bu 4
  511. Type: null or Number
  512. .RE 0
  513. .P
  514. Tells to expect a specific number of results from the command.
  515. .P
  516. This config cannot be used with: \fBexpect-results\fR
  517. .SS "\fBexpect-results\fR"
  518. .RS 0
  519. .IP \(bu 4
  520. Default: null
  521. .IP \(bu 4
  522. Type: null or Boolean
  523. .RE 0
  524. .P
  525. Tells npm whether or not to expect results from the command. Can be either true (expect some results) or false (expect no results).
  526. .P
  527. This config cannot be used with: \fBexpect-result-count\fR
  528. .SS "\fBexpires\fR"
  529. .RS 0
  530. .IP \(bu 4
  531. Default: null
  532. .IP \(bu 4
  533. Type: null or Number
  534. .RE 0
  535. .P
  536. When creating a Granular Access Token with \fBnpm token create\fR, this sets the expiration in days. If not specified, the server will determine the default expiration.
  537. .SS "\fBfetch-retries\fR"
  538. .RS 0
  539. .IP \(bu 4
  540. Default: 2
  541. .IP \(bu 4
  542. Type: Number
  543. .RE 0
  544. .P
  545. The "retries" config for the \fBretry\fR module to use when fetching packages from the registry.
  546. .P
  547. npm will retry idempotent read requests to the registry in the case of network failures or 5xx HTTP errors.
  548. .SS "\fBfetch-retry-factor\fR"
  549. .RS 0
  550. .IP \(bu 4
  551. Default: 10
  552. .IP \(bu 4
  553. Type: Number
  554. .RE 0
  555. .P
  556. The "factor" config for the \fBretry\fR module to use when fetching packages.
  557. .SS "\fBfetch-retry-maxtimeout\fR"
  558. .RS 0
  559. .IP \(bu 4
  560. Default: 60000 (1 minute)
  561. .IP \(bu 4
  562. Type: Number
  563. .RE 0
  564. .P
  565. The "maxTimeout" config for the \fBretry\fR module to use when fetching packages.
  566. .SS "\fBfetch-retry-mintimeout\fR"
  567. .RS 0
  568. .IP \(bu 4
  569. Default: 10000 (10 seconds)
  570. .IP \(bu 4
  571. Type: Number
  572. .RE 0
  573. .P
  574. The "minTimeout" config for the \fBretry\fR module to use when fetching packages.
  575. .SS "\fBfetch-timeout\fR"
  576. .RS 0
  577. .IP \(bu 4
  578. Default: 300000 (5 minutes)
  579. .IP \(bu 4
  580. Type: Number
  581. .RE 0
  582. .P
  583. The maximum amount of time to wait for HTTP requests to complete.
  584. .SS "\fBforce\fR"
  585. .RS 0
  586. .IP \(bu 4
  587. Default: false
  588. .IP \(bu 4
  589. Type: Boolean
  590. .RE 0
  591. .P
  592. Removes various protections against unfortunate side effects, common mistakes, unnecessary performance degradation, and malicious input.
  593. .RS 0
  594. .IP \(bu 4
  595. Allow clobbering non-npm files in global installs.
  596. .IP \(bu 4
  597. Allow the \fBnpm version\fR command to work on an unclean git repository.
  598. .IP \(bu 4
  599. Allow deleting the cache folder with \fBnpm cache clean\fR.
  600. .IP \(bu 4
  601. Allow installing packages that have an \fBengines\fR declaration requiring a different version of npm.
  602. .IP \(bu 4
  603. Allow installing packages that have an \fBengines\fR declaration requiring a different version of \fBnode\fR, even if \fB--engine-strict\fR is enabled.
  604. .IP \(bu 4
  605. Allow \fBnpm audit fix\fR to install modules outside your stated dependency range (including SemVer-major changes).
  606. .IP \(bu 4
  607. Allow unpublishing all versions of a published package.
  608. .IP \(bu 4
  609. Allow conflicting peerDependencies to be installed in the root project.
  610. .IP \(bu 4
  611. Implicitly set \fB--yes\fR during \fBnpm init\fR.
  612. .IP \(bu 4
  613. Allow clobbering existing values in \fBnpm pkg\fR
  614. .IP \(bu 4
  615. Allow unpublishing of entire packages (not just a single version).
  616. .RE 0
  617. .P
  618. If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option!
  619. .SS "\fBforeground-scripts\fR"
  620. .RS 0
  621. .IP \(bu 4
  622. Default: \fBfalse\fR unless when using \fBnpm pack\fR or \fBnpm publish\fR where it defaults to \fBtrue\fR
  623. .IP \(bu 4
  624. Type: Boolean
  625. .RE 0
  626. .P
  627. Run all build scripts (ie, \fBpreinstall\fR, \fBinstall\fR, and \fBpostinstall\fR) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process.
  628. .P
  629. Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging.
  630. .SS "\fBformat-package-lock\fR"
  631. .RS 0
  632. .IP \(bu 4
  633. Default: true
  634. .IP \(bu 4
  635. Type: Boolean
  636. .RE 0
  637. .P
  638. Format \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR as a human readable file.
  639. .SS "\fBfund\fR"
  640. .RS 0
  641. .IP \(bu 4
  642. Default: true
  643. .IP \(bu 4
  644. Type: Boolean
  645. .RE 0
  646. .P
  647. When "true" displays the message at the end of each \fBnpm install\fR acknowledging the number of dependencies looking for funding. See npm help fund for details.
  648. .SS "\fBgit\fR"
  649. .RS 0
  650. .IP \(bu 4
  651. Default: "git"
  652. .IP \(bu 4
  653. Type: String
  654. .RE 0
  655. .P
  656. The command to use for git commands. If git is installed on the computer, but is not in the \fBPATH\fR, then set this to the full path to the git binary.
  657. .SS "\fBgit-tag-version\fR"
  658. .RS 0
  659. .IP \(bu 4
  660. Default: true
  661. .IP \(bu 4
  662. Type: Boolean
  663. .RE 0
  664. .P
  665. Tag the commit when using the \fBnpm version\fR command. Setting this to false results in no commit being made at all.
  666. .SS "\fBglobal\fR"
  667. .RS 0
  668. .IP \(bu 4
  669. Default: false
  670. .IP \(bu 4
  671. Type: Boolean
  672. .RE 0
  673. .P
  674. Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior.
  675. .RS 0
  676. .IP \(bu 4
  677. packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory.
  678. .IP \(bu 4
  679. bin files are linked to \fB{prefix}/bin\fR
  680. .IP \(bu 4
  681. man pages are linked to \fB{prefix}/share/man\fR
  682. .RE 0
  683. .SS "\fBglobalconfig\fR"
  684. .RS 0
  685. .IP \(bu 4
  686. Default: The global --prefix setting plus 'etc/npmrc'. For example, '/usr/local/etc/npmrc'
  687. .IP \(bu 4
  688. Type: Path
  689. .RE 0
  690. .P
  691. The config file to read for global config options.
  692. .SS "\fBheading\fR"
  693. .RS 0
  694. .IP \(bu 4
  695. Default: "npm"
  696. .IP \(bu 4
  697. Type: String
  698. .RE 0
  699. .P
  700. The string that starts all the debugging log output.
  701. .SS "\fBhttps-proxy\fR"
  702. .RS 0
  703. .IP \(bu 4
  704. Default: null
  705. .IP \(bu 4
  706. Type: null or URL
  707. .RE 0
  708. .P
  709. A proxy to use for outgoing https requests. If the \fBHTTPS_PROXY\fR or \fBhttps_proxy\fR or \fBHTTP_PROXY\fR or \fBhttp_proxy\fR environment variables are set, proxy settings will be honored by the underlying \fBmake-fetch-happen\fR library.
  710. .SS "\fBif-present\fR"
  711. .RS 0
  712. .IP \(bu 4
  713. Default: false
  714. .IP \(bu 4
  715. Type: Boolean
  716. .RE 0
  717. .P
  718. If true, npm will not exit with an error code when \fBrun\fR is invoked for a script that isn't defined in the \fBscripts\fR section of \fBpackage.json\fR. This option can be used when it's desirable to optionally run a script when it's present and fail if the script fails. This is useful, for example, when running scripts that may only apply for some builds in an otherwise generic CI setup.
  719. .P
  720. This value is not exported to the environment for child processes.
  721. .SS "\fBignore-scripts\fR"
  722. .RS 0
  723. .IP \(bu 4
  724. Default: false
  725. .IP \(bu 4
  726. Type: Boolean
  727. .RE 0
  728. .P
  729. If true, npm does not run scripts specified in package.json files.
  730. .P
  731. Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts.
  732. .SS "\fBinclude\fR"
  733. .RS 0
  734. .IP \(bu 4
  735. Default:
  736. .IP \(bu 4
  737. Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
  738. .RE 0
  739. .P
  740. Option that allows for defining which types of dependencies to install.
  741. .P
  742. This is the inverse of \fB--omit=<type>\fR.
  743. .P
  744. Dependency types specified in \fB--include\fR will not be omitted, regardless of the order in which omit/include are specified on the command-line.
  745. .SS "\fBinclude-attestations\fR"
  746. .RS 0
  747. .IP \(bu 4
  748. Default: false
  749. .IP \(bu 4
  750. Type: Boolean
  751. .RE 0
  752. .P
  753. When used with \fBnpm audit signatures --json\fR, includes the full sigstore attestation bundles in the JSON output for each verified package. The bundles contain DSSE envelopes, verification material, and transparency log entries.
  754. .SS "\fBinclude-staged\fR"
  755. .RS 0
  756. .IP \(bu 4
  757. Default: false
  758. .IP \(bu 4
  759. Type: Boolean
  760. .RE 0
  761. .P
  762. Allow installing "staged" published packages, as defined by \fBnpm RFC PR #92\fR \fI\(lahttps://github.com/npm/rfcs/pull/92\(ra\fR.
  763. .P
  764. This is experimental, and not implemented by the npm public registry.
  765. .SS "\fBinclude-workspace-root\fR"
  766. .RS 0
  767. .IP \(bu 4
  768. Default: false
  769. .IP \(bu 4
  770. Type: Boolean
  771. .RE 0
  772. .P
  773. Include the workspace root when workspaces are enabled for a command.
  774. .P
  775. When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project.
  776. .P
  777. This value is not exported to the environment for child processes.
  778. .SS "\fBinit-author-email\fR"
  779. .RS 0
  780. .IP \(bu 4
  781. Default: ""
  782. .IP \(bu 4
  783. Type: String
  784. .RE 0
  785. .P
  786. The value \fBnpm init\fR should use by default for the package author's email.
  787. .SS "\fBinit-author-name\fR"
  788. .RS 0
  789. .IP \(bu 4
  790. Default: ""
  791. .IP \(bu 4
  792. Type: String
  793. .RE 0
  794. .P
  795. The value \fBnpm init\fR should use by default for the package author's name.
  796. .SS "\fBinit-author-url\fR"
  797. .RS 0
  798. .IP \(bu 4
  799. Default: ""
  800. .IP \(bu 4
  801. Type: "" or URL
  802. .RE 0
  803. .P
  804. The value \fBnpm init\fR should use by default for the package author's homepage.
  805. .SS "\fBinit-license\fR"
  806. .RS 0
  807. .IP \(bu 4
  808. Default: "ISC"
  809. .IP \(bu 4
  810. Type: String
  811. .RE 0
  812. .P
  813. The value \fBnpm init\fR should use by default for the package license.
  814. .SS "\fBinit-module\fR"
  815. .RS 0
  816. .IP \(bu 4
  817. Default: "~/.npm-init.js"
  818. .IP \(bu 4
  819. Type: Path
  820. .RE 0
  821. .P
  822. A module that will be loaded by the \fBnpm init\fR command. See the documentation for the \fBinit-package-json\fR \fI\(lahttps://github.com/npm/init-package-json\(ra\fR module for more information, or npm help init.
  823. .SS "\fBinit-private\fR"
  824. .RS 0
  825. .IP \(bu 4
  826. Default: false
  827. .IP \(bu 4
  828. Type: Boolean
  829. .RE 0
  830. .P
  831. The value \fBnpm init\fR should use by default for the package's private flag.
  832. .SS "\fBinit-type\fR"
  833. .RS 0
  834. .IP \(bu 4
  835. Default: "commonjs"
  836. .IP \(bu 4
  837. Type: String
  838. .RE 0
  839. .P
  840. The value that \fBnpm init\fR should use by default for the package.json type field.
  841. .SS "\fBinit-version\fR"
  842. .RS 0
  843. .IP \(bu 4
  844. Default: "1.0.0"
  845. .IP \(bu 4
  846. Type: SemVer string
  847. .RE 0
  848. .P
  849. The value that \fBnpm init\fR should use by default for the package version number, if not already set in package.json.
  850. .SS "\fBinstall-links\fR"
  851. .RS 0
  852. .IP \(bu 4
  853. Default: false
  854. .IP \(bu 4
  855. Type: Boolean
  856. .RE 0
  857. .P
  858. When set file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. This option has no effect on workspaces.
  859. .SS "\fBinstall-strategy\fR"
  860. .RS 0
  861. .IP \(bu 4
  862. Default: "hoisted"
  863. .IP \(bu 4
  864. Type: "hoisted", "nested", "shallow", or "linked"
  865. .RE 0
  866. .P
  867. Sets the strategy for installing packages in node_modules. hoisted (default): Install non-duplicated in top-level, and duplicated as necessary within directory structure. nested: (formerly --legacy-bundling) install in place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted.
  868. .SS "\fBjson\fR"
  869. .RS 0
  870. .IP \(bu 4
  871. Default: false
  872. .IP \(bu 4
  873. Type: Boolean
  874. .RE 0
  875. .P
  876. Whether or not to output JSON data, rather than the normal output.
  877. .RS 0
  878. .IP \(bu 4
  879. In \fBnpm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fBpackage.json\fR.
  880. .RE 0
  881. .P
  882. Not supported by all npm commands.
  883. .SS "\fBlegacy-peer-deps\fR"
  884. .RS 0
  885. .IP \(bu 4
  886. Default: false
  887. .IP \(bu 4
  888. Type: Boolean
  889. .RE 0
  890. .P
  891. Causes npm to completely ignore \fBpeerDependencies\fR when building a package tree, as in npm versions 3 through 6.
  892. .P
  893. If a package cannot be installed because of overly strict \fBpeerDependencies\fR that collide, it provides a way to move forward resolving the situation.
  894. .P
  895. This differs from \fB--omit=peer\fR, in that \fB--omit=peer\fR will avoid unpacking \fBpeerDependencies\fR on disk, but will still design a tree such that \fBpeerDependencies\fR \fIcould\fR be unpacked in a correct place.
  896. .P
  897. Use of \fBlegacy-peer-deps\fR is not recommended, as it will not enforce the \fBpeerDependencies\fR contract that meta-dependencies may rely on.
  898. .SS "\fBlibc\fR"
  899. .RS 0
  900. .IP \(bu 4
  901. Default: null
  902. .IP \(bu 4
  903. Type: null or String
  904. .RE 0
  905. .P
  906. Override libc of native modules to install. Acceptable values are same as \fBlibc\fR field of package.json
  907. .SS "\fBlink\fR"
  908. .RS 0
  909. .IP \(bu 4
  910. Default: false
  911. .IP \(bu 4
  912. Type: Boolean
  913. .RE 0
  914. .P
  915. Used with \fBnpm ls\fR, limiting output to only those packages that are linked.
  916. .SS "\fBlocal-address\fR"
  917. .RS 0
  918. .IP \(bu 4
  919. Default: null
  920. .IP \(bu 4
  921. Type: IP Address
  922. .RE 0
  923. .P
  924. The IP address of the local interface to use when making connections to the npm registry. Must be IPv4 in versions of Node prior to 0.12.
  925. .SS "\fBlocation\fR"
  926. .RS 0
  927. .IP \(bu 4
  928. Default: "user" unless \fB--global\fR is passed, which will also set this value to "global"
  929. .IP \(bu 4
  930. Type: "global", "user", or "project"
  931. .RE 0
  932. .P
  933. When passed to \fBnpm config\fR this refers to which config file to use.
  934. .P
  935. When set to "global" mode, packages are installed into the \fBprefix\fR folder instead of the current working directory. See npm help folders for more on the differences in behavior.
  936. .RS 0
  937. .IP \(bu 4
  938. packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory.
  939. .IP \(bu 4
  940. bin files are linked to \fB{prefix}/bin\fR
  941. .IP \(bu 4
  942. man pages are linked to \fB{prefix}/share/man\fR
  943. .RE 0
  944. .SS "\fBlockfile-version\fR"
  945. .RS 0
  946. .IP \(bu 4
  947. Default: Version 3 if no lockfile, auto-converting v1 lockfiles to v3; otherwise, maintain current lockfile version.
  948. .IP \(bu 4
  949. Type: null, 1, 2, 3, "1", "2", or "3"
  950. .RE 0
  951. .P
  952. Set the lockfile format version to be used in package-lock.json and npm-shrinkwrap-json files. Possible options are:
  953. .P
  954. 1: The lockfile version used by npm versions 5 and 6. Lacks some data that is used during the install, resulting in slower and possibly less deterministic installs. Prevents lockfile churn when interoperating with older npm versions.
  955. .P
  956. 2: The default lockfile version used by npm version 7 and 8. Includes both the version 1 lockfile data and version 3 lockfile data, for maximum determinism and interoperability, at the expense of more bytes on disk.
  957. .P
  958. 3: Only the new lockfile information introduced in npm version 7. Smaller on disk than lockfile version 2, but not interoperable with older npm versions. Ideal if all users are on npm version 7 and higher.
  959. .SS "\fBloglevel\fR"
  960. .RS 0
  961. .IP \(bu 4
  962. Default: "notice"
  963. .IP \(bu 4
  964. Type: "silent", "error", "warn", "notice", "http", "info", "verbose", or "silly"
  965. .RE 0
  966. .P
  967. What level of logs to report. All logs are written to a debug log, with the path to that file printed if the execution of a command fails.
  968. .P
  969. Any logs of a higher level than the setting are shown. The default is "notice".
  970. .P
  971. See also the \fBforeground-scripts\fR config.
  972. .SS "\fBlogs-dir\fR"
  973. .RS 0
  974. .IP \(bu 4
  975. Default: A directory named \fB_logs\fR inside the cache
  976. .IP \(bu 4
  977. Type: null or Path
  978. .RE 0
  979. .P
  980. The location of npm's log directory. See npm help logging for more information.
  981. .SS "\fBlogs-max\fR"
  982. .RS 0
  983. .IP \(bu 4
  984. Default: 10
  985. .IP \(bu 4
  986. Type: Number
  987. .RE 0
  988. .P
  989. The maximum number of log files to store.
  990. .P
  991. If set to 0, no log files will be written for the current run.
  992. .SS "\fBlong\fR"
  993. .RS 0
  994. .IP \(bu 4
  995. Default: false
  996. .IP \(bu 4
  997. Type: Boolean
  998. .RE 0
  999. .P
  1000. Show extended information in \fBls\fR, \fBsearch\fR, and \fBhelp-search\fR.
  1001. .SS "\fBmaxsockets\fR"
  1002. .RS 0
  1003. .IP \(bu 4
  1004. Default: 15
  1005. .IP \(bu 4
  1006. Type: Number
  1007. .RE 0
  1008. .P
  1009. The maximum number of connections to use per origin (protocol/host/port combination).
  1010. .SS "\fBmessage\fR"
  1011. .RS 0
  1012. .IP \(bu 4
  1013. Default: "%s"
  1014. .IP \(bu 4
  1015. Type: String
  1016. .RE 0
  1017. .P
  1018. Commit message which is used by \fBnpm version\fR when creating version commit.
  1019. .P
  1020. Any "%s" in the message will be replaced with the version number.
  1021. .SS "\fBmin-release-age\fR"
  1022. .RS 0
  1023. .IP \(bu 4
  1024. Default: null
  1025. .IP \(bu 4
  1026. Type: null or Number
  1027. .RE 0
  1028. .P
  1029. If set, npm will build the npm tree such that only versions that were available more than the given number of days ago will be installed. If there are no versions available for the current set of dependencies, the command will error.
  1030. .P
  1031. This flag is a complement to \fBbefore\fR, which accepts an exact date instead of a relative number of days.
  1032. .P
  1033. This config cannot be used with: \fBbefore\fR
  1034. .P
  1035. This value is not exported to the environment for child processes.
  1036. .SS "\fBname\fR"
  1037. .RS 0
  1038. .IP \(bu 4
  1039. Default: null
  1040. .IP \(bu 4
  1041. Type: null or String
  1042. .RE 0
  1043. .P
  1044. When creating a Granular Access Token with \fBnpm token create\fR, this sets the name/description for the token.
  1045. .SS "\fBnode-gyp\fR"
  1046. .RS 0
  1047. .IP \(bu 4
  1048. Default: The path to the node-gyp bin that ships with npm
  1049. .IP \(bu 4
  1050. Type: Path
  1051. .RE 0
  1052. .P
  1053. This is the location of the "node-gyp" bin. By default it uses one that ships with npm itself.
  1054. .P
  1055. You can use this config to specify your own "node-gyp" to run when it is required to build a package.
  1056. .SS "\fBnode-options\fR"
  1057. .RS 0
  1058. .IP \(bu 4
  1059. Default: null
  1060. .IP \(bu 4
  1061. Type: null or String
  1062. .RE 0
  1063. .P
  1064. Options to pass through to Node.js via the \fBNODE_OPTIONS\fR environment variable. This does not impact how npm itself is executed but it does impact how lifecycle scripts are called.
  1065. .SS "\fBnoproxy\fR"
  1066. .RS 0
  1067. .IP \(bu 4
  1068. Default: The value of the NO_PROXY environment variable
  1069. .IP \(bu 4
  1070. Type: String (can be set multiple times)
  1071. .RE 0
  1072. .P
  1073. Domain extensions that should bypass any proxies.
  1074. .P
  1075. Also accepts a comma-delimited string.
  1076. .SS "\fBoffline\fR"
  1077. .RS 0
  1078. .IP \(bu 4
  1079. Default: false
  1080. .IP \(bu 4
  1081. Type: Boolean
  1082. .RE 0
  1083. .P
  1084. Force offline mode: no network requests will be done during install. To allow the CLI to fill in missing cache data, see \fB--prefer-offline\fR.
  1085. .SS "\fBomit\fR"
  1086. .RS 0
  1087. .IP \(bu 4
  1088. Default: 'dev' if the \fBNODE_ENV\fR environment variable is set to 'production'; otherwise, empty.
  1089. .IP \(bu 4
  1090. Type: "dev", "optional", or "peer" (can be set multiple times)
  1091. .RE 0
  1092. .P
  1093. Dependency types to omit from the installation tree on disk.
  1094. .P
  1095. Note that these dependencies \fIare\fR still resolved and added to the \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR file. They are just not physically installed on disk.
  1096. .P
  1097. If a package type appears in both the \fB--include\fR and \fB--omit\fR lists, then it will be included.
  1098. .P
  1099. If the resulting omit list includes \fB'dev'\fR, then the \fBNODE_ENV\fR environment variable will be set to \fB'production'\fR for all lifecycle scripts.
  1100. .SS "\fBomit-lockfile-registry-resolved\fR"
  1101. .RS 0
  1102. .IP \(bu 4
  1103. Default: false
  1104. .IP \(bu 4
  1105. Type: Boolean
  1106. .RE 0
  1107. .P
  1108. This option causes npm to create lock files without a \fBresolved\fR key for registry dependencies. Subsequent installs will need to resolve tarball endpoints with the configured registry, likely resulting in a longer install time.
  1109. .SS "\fBorgs\fR"
  1110. .RS 0
  1111. .IP \(bu 4
  1112. Default: null
  1113. .IP \(bu 4
  1114. Type: null or String (can be set multiple times)
  1115. .RE 0
  1116. .P
  1117. When creating a Granular Access Token with \fBnpm token create\fR, this limits the token access to specific organizations.
  1118. .SS "\fBorgs-permission\fR"
  1119. .RS 0
  1120. .IP \(bu 4
  1121. Default: null
  1122. .IP \(bu 4
  1123. Type: null, "read-only", "read-write", or "no-access"
  1124. .RE 0
  1125. .P
  1126. When creating a Granular Access Token with \fBnpm token create\fR, sets the permission level for organizations. Options are "read-only", "read-write", or "no-access".
  1127. .SS "\fBos\fR"
  1128. .RS 0
  1129. .IP \(bu 4
  1130. Default: null
  1131. .IP \(bu 4
  1132. Type: null or String
  1133. .RE 0
  1134. .P
  1135. Override OS of native modules to install. Acceptable values are same as \fBos\fR field of package.json, which comes from \fBprocess.platform\fR.
  1136. .SS "\fBotp\fR"
  1137. .RS 0
  1138. .IP \(bu 4
  1139. Default: null
  1140. .IP \(bu 4
  1141. Type: null or String
  1142. .RE 0
  1143. .P
  1144. This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with \fBnpm access\fR.
  1145. .P
  1146. 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.
  1147. .SS "\fBpack-destination\fR"
  1148. .RS 0
  1149. .IP \(bu 4
  1150. Default: "."
  1151. .IP \(bu 4
  1152. Type: String
  1153. .RE 0
  1154. .P
  1155. Directory in which \fBnpm pack\fR will save tarballs.
  1156. .SS "\fBpackage\fR"
  1157. .RS 0
  1158. .IP \(bu 4
  1159. Default:
  1160. .IP \(bu 4
  1161. Type: String (can be set multiple times)
  1162. .RE 0
  1163. .P
  1164. The package or packages to install for npm help exec
  1165. .SS "\fBpackage-lock\fR"
  1166. .RS 0
  1167. .IP \(bu 4
  1168. Default: true
  1169. .IP \(bu 4
  1170. Type: Boolean
  1171. .RE 0
  1172. .P
  1173. If set to false, then ignore \fBpackage-lock.json\fR files when installing. This will also prevent \fIwriting\fR \fBpackage-lock.json\fR if \fBsave\fR is true.
  1174. .SS "\fBpackage-lock-only\fR"
  1175. .RS 0
  1176. .IP \(bu 4
  1177. Default: false
  1178. .IP \(bu 4
  1179. Type: Boolean
  1180. .RE 0
  1181. .P
  1182. If set to true, the current operation will only use the \fBpackage-lock.json\fR, ignoring \fBnode_modules\fR.
  1183. .P
  1184. For \fBupdate\fR this means only the \fBpackage-lock.json\fR will be updated, instead of checking \fBnode_modules\fR and downloading dependencies.
  1185. .P
  1186. For \fBlist\fR this means the output will be based on the tree described by the \fBpackage-lock.json\fR, rather than the contents of \fBnode_modules\fR.
  1187. .SS "\fBpackages\fR"
  1188. .RS 0
  1189. .IP \(bu 4
  1190. Default:
  1191. .IP \(bu 4
  1192. Type: null or String (can be set multiple times)
  1193. .RE 0
  1194. .P
  1195. When creating a Granular Access Token with \fBnpm token create\fR, this limits the token access to specific packages.
  1196. .SS "\fBpackages-all\fR"
  1197. .RS 0
  1198. .IP \(bu 4
  1199. Default: false
  1200. .IP \(bu 4
  1201. Type: Boolean
  1202. .RE 0
  1203. .P
  1204. When creating a Granular Access Token with \fBnpm token create\fR, grants the token access to all packages instead of limiting to specific packages.
  1205. .SS "\fBpackages-and-scopes-permission\fR"
  1206. .RS 0
  1207. .IP \(bu 4
  1208. Default: null
  1209. .IP \(bu 4
  1210. Type: null, "read-only", "read-write", or "no-access"
  1211. .RE 0
  1212. .P
  1213. When creating a Granular Access Token with \fBnpm token create\fR, sets the permission level for packages and scopes. Options are "read-only", "read-write", or "no-access".
  1214. .SS "\fBparseable\fR"
  1215. .RS 0
  1216. .IP \(bu 4
  1217. Default: false
  1218. .IP \(bu 4
  1219. Type: Boolean
  1220. .RE 0
  1221. .P
  1222. Output parseable results from commands that write to standard output. For \fBnpm search\fR, this will be tab-separated table format.
  1223. .SS "\fBpassword\fR"
  1224. .RS 0
  1225. .IP \(bu 4
  1226. Default: null
  1227. .IP \(bu 4
  1228. Type: null or String
  1229. .RE 0
  1230. .P
  1231. Password for authentication. Can be provided via command line when creating tokens, though it's generally safer to be prompted for it.
  1232. .SS "\fBprefer-dedupe\fR"
  1233. .RS 0
  1234. .IP \(bu 4
  1235. Default: false
  1236. .IP \(bu 4
  1237. Type: Boolean
  1238. .RE 0
  1239. .P
  1240. Prefer to deduplicate packages if possible, rather than choosing a newer version of a dependency.
  1241. .SS "\fBprefer-offline\fR"
  1242. .RS 0
  1243. .IP \(bu 4
  1244. Default: false
  1245. .IP \(bu 4
  1246. Type: Boolean
  1247. .RE 0
  1248. .P
  1249. If true, staleness checks for cached data will be bypassed, but missing data will be requested from the server. To force full offline mode, use \fB--offline\fR.
  1250. .P
  1251. This config cannot be used with: \fBprefer-online\fR
  1252. .SS "\fBprefer-online\fR"
  1253. .RS 0
  1254. .IP \(bu 4
  1255. Default: false
  1256. .IP \(bu 4
  1257. Type: Boolean
  1258. .RE 0
  1259. .P
  1260. If true, staleness checks for cached data will be forced, making the CLI look for updates immediately even for fresh package data.
  1261. .P
  1262. This config cannot be used with: \fBprefer-offline\fR
  1263. .SS "\fBprefix\fR"
  1264. .RS 0
  1265. .IP \(bu 4
  1266. Default: In global mode, the folder where the node executable is installed. Otherwise, the nearest parent folder containing either a package.json file or a node_modules folder.
  1267. .IP \(bu 4
  1268. Type: Path
  1269. .RE 0
  1270. .P
  1271. The location to install global items. If set on the command line, then it forces non-global commands to run in the specified folder.
  1272. .SS "\fBpreid\fR"
  1273. .RS 0
  1274. .IP \(bu 4
  1275. Default: ""
  1276. .IP \(bu 4
  1277. Type: String
  1278. .RE 0
  1279. .P
  1280. The "prerelease identifier" to use as a prefix for the "prerelease" part of a semver. Like the \fBrc\fR in \fB1.2.0-rc.8\fR.
  1281. .SS "\fBprogress\fR"
  1282. .RS 0
  1283. .IP \(bu 4
  1284. Default: \fBtrue\fR when not in CI and both stderr and stdout are TTYs and not in a dumb terminal
  1285. .IP \(bu 4
  1286. Type: Boolean
  1287. .RE 0
  1288. .P
  1289. When set to \fBtrue\fR, npm will display a progress bar during time intensive operations, if \fBprocess.stderr\fR and \fBprocess.stdout\fR are a TTY.
  1290. .P
  1291. Set to \fBfalse\fR to suppress the progress bar.
  1292. .SS "\fBprovenance\fR"
  1293. .RS 0
  1294. .IP \(bu 4
  1295. Default: false
  1296. .IP \(bu 4
  1297. Type: Boolean
  1298. .RE 0
  1299. .P
  1300. When publishing from a supported cloud CI/CD system, the package will be publicly linked to where it was built and published from.
  1301. .P
  1302. This config cannot be used with: \fBprovenance-file\fR
  1303. .SS "\fBprovenance-file\fR"
  1304. .RS 0
  1305. .IP \(bu 4
  1306. Default: null
  1307. .IP \(bu 4
  1308. Type: Path
  1309. .RE 0
  1310. .P
  1311. When publishing, the provenance bundle at the given path will be used.
  1312. .P
  1313. This config cannot be used with: \fBprovenance\fR
  1314. .SS "\fBproxy\fR"
  1315. .RS 0
  1316. .IP \(bu 4
  1317. Default: null
  1318. .IP \(bu 4
  1319. Type: null, false, or URL
  1320. .RE 0
  1321. .P
  1322. A proxy to use for outgoing http requests. If the \fBHTTP_PROXY\fR or \fBhttp_proxy\fR environment variables are set, proxy settings will be honored by the underlying \fBrequest\fR library.
  1323. .SS "\fBread-only\fR"
  1324. .RS 0
  1325. .IP \(bu 4
  1326. Default: false
  1327. .IP \(bu 4
  1328. Type: Boolean
  1329. .RE 0
  1330. .P
  1331. This is used to mark a token as unable to publish when configuring limited access tokens with the \fBnpm token create\fR command.
  1332. .SS "\fBrebuild-bundle\fR"
  1333. .RS 0
  1334. .IP \(bu 4
  1335. Default: true
  1336. .IP \(bu 4
  1337. Type: Boolean
  1338. .RE 0
  1339. .P
  1340. Rebuild bundled dependencies after installation.
  1341. .SS "\fBregistry\fR"
  1342. .RS 0
  1343. .IP \(bu 4
  1344. Default: "https://registry.npmjs.org/"
  1345. .IP \(bu 4
  1346. Type: URL
  1347. .RE 0
  1348. .P
  1349. The base URL of the npm registry.
  1350. .SS "\fBreplace-registry-host\fR"
  1351. .RS 0
  1352. .IP \(bu 4
  1353. Default: "npmjs"
  1354. .IP \(bu 4
  1355. Type: "npmjs", "never", "always", or String
  1356. .RE 0
  1357. .P
  1358. Defines behavior for replacing the registry host in a lockfile with the configured registry.
  1359. .P
  1360. The default behavior is to replace package dist URLs from the default registry (https://registry.npmjs.org) to the configured registry. If set to "never", then use the registry value. If set to "always", then replace the registry host with the configured host every time.
  1361. .P
  1362. You may also specify a bare hostname (e.g., "registry.npmjs.org").
  1363. .SS "\fBsave\fR"
  1364. .RS 0
  1365. .IP \(bu 4
  1366. Default: \fBtrue\fR unless when using \fBnpm update\fR where it defaults to \fBfalse\fR
  1367. .IP \(bu 4
  1368. Type: Boolean
  1369. .RE 0
  1370. .P
  1371. Save installed packages to a \fBpackage.json\fR file as dependencies.
  1372. .P
  1373. When used with the \fBnpm rm\fR command, removes the dependency from \fBpackage.json\fR.
  1374. .P
  1375. Will also prevent writing to \fBpackage-lock.json\fR if set to \fBfalse\fR.
  1376. .SS "\fBsave-bundle\fR"
  1377. .RS 0
  1378. .IP \(bu 4
  1379. Default: false
  1380. .IP \(bu 4
  1381. Type: Boolean
  1382. .RE 0
  1383. .P
  1384. If a package would be saved at install time by the use of \fB--save\fR, \fB--save-dev\fR, or \fB--save-optional\fR, then also put it in the \fBbundleDependencies\fR list.
  1385. .P
  1386. Ignored if \fB--save-peer\fR is set, since peerDependencies cannot be bundled.
  1387. .SS "\fBsave-dev\fR"
  1388. .RS 0
  1389. .IP \(bu 4
  1390. Default: false
  1391. .IP \(bu 4
  1392. Type: Boolean
  1393. .RE 0
  1394. .P
  1395. Save installed packages to a package.json file as \fBdevDependencies\fR.
  1396. .P
  1397. This config cannot be used with: \fBsave-optional\fR, \fBsave-peer\fR, \fBsave-prod\fR
  1398. .SS "\fBsave-exact\fR"
  1399. .RS 0
  1400. .IP \(bu 4
  1401. Default: false
  1402. .IP \(bu 4
  1403. Type: Boolean
  1404. .RE 0
  1405. .P
  1406. Dependencies saved to package.json will be configured with an exact version rather than using npm's default semver range operator.
  1407. .SS "\fBsave-optional\fR"
  1408. .RS 0
  1409. .IP \(bu 4
  1410. Default: false
  1411. .IP \(bu 4
  1412. Type: Boolean
  1413. .RE 0
  1414. .P
  1415. Save installed packages to a package.json file as \fBoptionalDependencies\fR.
  1416. .P
  1417. This config cannot be used with: \fBsave-dev\fR, \fBsave-peer\fR, \fBsave-prod\fR
  1418. .SS "\fBsave-peer\fR"
  1419. .RS 0
  1420. .IP \(bu 4
  1421. Default: false
  1422. .IP \(bu 4
  1423. Type: Boolean
  1424. .RE 0
  1425. .P
  1426. Save installed packages to a package.json file as \fBpeerDependencies\fR
  1427. .P
  1428. This config cannot be used with: \fBsave-dev\fR, \fBsave-optional\fR, \fBsave-prod\fR
  1429. .SS "\fBsave-prefix\fR"
  1430. .RS 0
  1431. .IP \(bu 4
  1432. Default: "^"
  1433. .IP \(bu 4
  1434. Type: String
  1435. .RE 0
  1436. .P
  1437. Configure how versions of packages installed to a package.json file via \fB--save\fR or \fB--save-dev\fR get prefixed.
  1438. .P
  1439. For example if a package has version \fB1.2.3\fR, by default its version is set to \fB^1.2.3\fR which allows minor upgrades for that package, but after \fBnpm
  1440. config set save-prefix='~'\fR it would be set to \fB~1.2.3\fR which only allows patch upgrades.
  1441. .SS "\fBsave-prod\fR"
  1442. .RS 0
  1443. .IP \(bu 4
  1444. Default: false
  1445. .IP \(bu 4
  1446. Type: Boolean
  1447. .RE 0
  1448. .P
  1449. Save installed packages into \fBdependencies\fR specifically. This is useful if a package already exists in \fBdevDependencies\fR or \fBoptionalDependencies\fR, but you want to move it to be a non-optional production dependency.
  1450. .P
  1451. This is the default behavior if \fB--save\fR is true, and neither \fB--save-dev\fR or \fB--save-optional\fR are true.
  1452. .P
  1453. This config cannot be used with: \fBsave-dev\fR, \fBsave-optional\fR, \fBsave-peer\fR
  1454. .SS "\fBsbom-format\fR"
  1455. .RS 0
  1456. .IP \(bu 4
  1457. Default: null
  1458. .IP \(bu 4
  1459. Type: "cyclonedx" or "spdx"
  1460. .RE 0
  1461. .P
  1462. SBOM format to use when generating SBOMs.
  1463. .SS "\fBsbom-type\fR"
  1464. .RS 0
  1465. .IP \(bu 4
  1466. Default: "library"
  1467. .IP \(bu 4
  1468. Type: "library", "application", or "framework"
  1469. .RE 0
  1470. .P
  1471. The type of package described by the generated SBOM. For SPDX, this is the value for the \fBprimaryPackagePurpose\fR field. For CycloneDX, this is the value for the \fBtype\fR field.
  1472. .SS "\fBscope\fR"
  1473. .RS 0
  1474. .IP \(bu 4
  1475. Default: the scope of the current project, if any, or ""
  1476. .IP \(bu 4
  1477. Type: String
  1478. .RE 0
  1479. .P
  1480. Associate an operation with a scope for a scoped registry.
  1481. .P
  1482. Useful when logging in to or out of a private registry:
  1483. .P
  1484. .RS 2
  1485. .nf
  1486. # log in, linking the scope to the custom registry
  1487. npm login --scope=@mycorp --registry=https://registry.mycorp.com
  1488. # log out, removing the link and the auth token
  1489. npm logout --scope=@mycorp
  1490. .fi
  1491. .RE
  1492. .P
  1493. 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.
  1494. .P
  1495. This will also cause \fBnpm init\fR to create a scoped package.
  1496. .P
  1497. .RS 2
  1498. .nf
  1499. # accept all defaults, and create a package named "@foo/whatever",
  1500. # instead of just named "whatever"
  1501. npm init --scope=@foo --yes
  1502. .fi
  1503. .RE
  1504. .SS "\fBscopes\fR"
  1505. .RS 0
  1506. .IP \(bu 4
  1507. Default: null
  1508. .IP \(bu 4
  1509. Type: null or String (can be set multiple times)
  1510. .RE 0
  1511. .P
  1512. When creating a Granular Access Token with \fBnpm token create\fR, this limits the token access to specific scopes. Provide a scope name (with or without @ prefix).
  1513. .SS "\fBscript-shell\fR"
  1514. .RS 0
  1515. .IP \(bu 4
  1516. Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
  1517. .IP \(bu 4
  1518. Type: null or String
  1519. .RE 0
  1520. .P
  1521. The shell to use for scripts run with the \fBnpm exec\fR, \fBnpm run\fR and \fBnpm
  1522. init <package-spec>\fR commands.
  1523. .SS "\fBsearchexclude\fR"
  1524. .RS 0
  1525. .IP \(bu 4
  1526. Default: ""
  1527. .IP \(bu 4
  1528. Type: String
  1529. .RE 0
  1530. .P
  1531. Space-separated options that limit the results from search.
  1532. .SS "\fBsearchlimit\fR"
  1533. .RS 0
  1534. .IP \(bu 4
  1535. Default: 20
  1536. .IP \(bu 4
  1537. Type: Number
  1538. .RE 0
  1539. .P
  1540. Number of items to limit search results to. Will not apply at all to legacy searches.
  1541. .SS "\fBsearchopts\fR"
  1542. .RS 0
  1543. .IP \(bu 4
  1544. Default: ""
  1545. .IP \(bu 4
  1546. Type: String
  1547. .RE 0
  1548. .P
  1549. Space-separated options that are always passed to search.
  1550. .SS "\fBsearchstaleness\fR"
  1551. .RS 0
  1552. .IP \(bu 4
  1553. Default: 900
  1554. .IP \(bu 4
  1555. Type: Number
  1556. .RE 0
  1557. .P
  1558. The age of the cache, in seconds, before another registry request is made if using legacy search endpoint.
  1559. .SS "\fBshell\fR"
  1560. .RS 0
  1561. .IP \(bu 4
  1562. Default: SHELL environment variable, or "bash" on Posix, or "cmd.exe" on Windows
  1563. .IP \(bu 4
  1564. Type: String
  1565. .RE 0
  1566. .P
  1567. The shell to run for the \fBnpm explore\fR command.
  1568. .SS "\fBsign-git-commit\fR"
  1569. .RS 0
  1570. .IP \(bu 4
  1571. Default: false
  1572. .IP \(bu 4
  1573. Type: Boolean
  1574. .RE 0
  1575. .P
  1576. If set to true, then the \fBnpm version\fR command will commit the new package version using \fB-S\fR to add a signature.
  1577. .P
  1578. Note that git requires you to have set up GPG keys in your git configs for this to work properly.
  1579. .SS "\fBsign-git-tag\fR"
  1580. .RS 0
  1581. .IP \(bu 4
  1582. Default: false
  1583. .IP \(bu 4
  1584. Type: Boolean
  1585. .RE 0
  1586. .P
  1587. If set to true, then the \fBnpm version\fR command will tag the version using \fB-s\fR to add a signature.
  1588. .P
  1589. Note that git requires you to have set up GPG keys in your git configs for this to work properly.
  1590. .SS "\fBstrict-peer-deps\fR"
  1591. .RS 0
  1592. .IP \(bu 4
  1593. Default: false
  1594. .IP \(bu 4
  1595. Type: Boolean
  1596. .RE 0
  1597. .P
  1598. If set to \fBtrue\fR, and \fB--legacy-peer-deps\fR is not set, then \fIany\fR conflicting \fBpeerDependencies\fR will be treated as an install failure, even if npm could reasonably guess the appropriate resolution based on non-peer dependency relationships.
  1599. .P
  1600. By default, conflicting \fBpeerDependencies\fR deep in the dependency graph will be resolved using the nearest non-peer dependency specification, even if doing so will result in some packages receiving a peer dependency outside the range set in their package's \fBpeerDependencies\fR object.
  1601. .P
  1602. When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If \fB--strict-peer-deps\fR is set, then this warning is treated as a failure.
  1603. .SS "\fBstrict-ssl\fR"
  1604. .RS 0
  1605. .IP \(bu 4
  1606. Default: true
  1607. .IP \(bu 4
  1608. Type: Boolean
  1609. .RE 0
  1610. .P
  1611. Whether or not to do SSL key validation when making requests to the registry via https.
  1612. .P
  1613. See also the \fBca\fR config.
  1614. .SS "\fBtag\fR"
  1615. .RS 0
  1616. .IP \(bu 4
  1617. Default: "latest"
  1618. .IP \(bu 4
  1619. Type: String
  1620. .RE 0
  1621. .P
  1622. If you ask npm to install a package and don't tell it a specific version, then it will install the specified tag.
  1623. .P
  1624. It is the tag added to the package@version specified in the \fBnpm dist-tag
  1625. add\fR command, if no explicit tag is given.
  1626. .P
  1627. When used by the \fBnpm diff\fR command, this is the tag used to fetch the tarball that will be compared with the local files by default.
  1628. .P
  1629. If used in the \fBnpm publish\fR command, this is the tag that will be added to the package submitted to the registry.
  1630. .SS "\fBtag-version-prefix\fR"
  1631. .RS 0
  1632. .IP \(bu 4
  1633. Default: "v"
  1634. .IP \(bu 4
  1635. Type: String
  1636. .RE 0
  1637. .P
  1638. If set, alters the prefix used when tagging a new version when performing a version increment using \fBnpm version\fR. To remove the prefix altogether, set it to the empty string: \fB""\fR.
  1639. .P
  1640. Because other tools may rely on the convention that npm version tags look like \fBv1.0.0\fR, \fIonly use this property if it is absolutely necessary\fR. In particular, use care when overriding this setting for public packages.
  1641. .SS "\fBtiming\fR"
  1642. .RS 0
  1643. .IP \(bu 4
  1644. Default: false
  1645. .IP \(bu 4
  1646. Type: Boolean
  1647. .RE 0
  1648. .P
  1649. If true, writes timing information to a process specific json file in the cache or \fBlogs-dir\fR. The file name ends with \fB-timing.json\fR.
  1650. .P
  1651. You can quickly view it with this \fBjson\fR \fI\(lahttps://npm.im/json\(ra\fR command line: \fBcat ~/.npm/_logs/*-timing.json | npm exec -- json -g\fR.
  1652. .P
  1653. Timing information will also be reported in the terminal. To suppress this while still writing the timing file, use \fB--silent\fR.
  1654. .SS "\fBtoken-description\fR"
  1655. .RS 0
  1656. .IP \(bu 4
  1657. Default: null
  1658. .IP \(bu 4
  1659. Type: null or String
  1660. .RE 0
  1661. .P
  1662. Description text for the token when using \fBnpm token create\fR.
  1663. .SS "\fBumask\fR"
  1664. .RS 0
  1665. .IP \(bu 4
  1666. Default: 0
  1667. .IP \(bu 4
  1668. Type: Octal numeric string in range 0000..0777 (0..511)
  1669. .RE 0
  1670. .P
  1671. The "umask" value to use when setting the file creation mode on files and folders.
  1672. .P
  1673. Folders and executables are given a mode which is \fB0o777\fR masked against this value. Other files are given a mode which is \fB0o666\fR masked against this value.
  1674. .P
  1675. Note that the underlying system will \fIalso\fR apply its own umask value to files and folders that are created, and npm does not circumvent this, but rather adds the \fB--umask\fR config to it.
  1676. .P
  1677. Thus, the effective default umask value on most POSIX systems is 0o22, meaning that folders and executables are created with a mode of 0o755 and other files are created with a mode of 0o644.
  1678. .SS "\fBunicode\fR"
  1679. .RS 0
  1680. .IP \(bu 4
  1681. Default: false on windows, true on mac/unix systems with a unicode locale, as defined by the \fBLC_ALL\fR, \fBLC_CTYPE\fR, or \fBLANG\fR environment variables.
  1682. .IP \(bu 4
  1683. Type: Boolean
  1684. .RE 0
  1685. .P
  1686. When set to true, npm uses unicode characters in the tree output. When false, it uses ascii characters instead of unicode glyphs.
  1687. .SS "\fBupdate-notifier\fR"
  1688. .RS 0
  1689. .IP \(bu 4
  1690. Default: true
  1691. .IP \(bu 4
  1692. Type: Boolean
  1693. .RE 0
  1694. .P
  1695. Set to false to suppress the update notification when using an older version of npm than the latest.
  1696. .SS "\fBusage\fR"
  1697. .RS 0
  1698. .IP \(bu 4
  1699. Default: false
  1700. .IP \(bu 4
  1701. Type: Boolean
  1702. .RE 0
  1703. .P
  1704. Show short usage output about the command specified.
  1705. .SS "\fBuser-agent\fR"
  1706. .RS 0
  1707. .IP \(bu 4
  1708. Default: "npm/{npm-version} node/{node-version} {platform} {arch} workspaces/{workspaces} {ci}"
  1709. .IP \(bu 4
  1710. Type: String
  1711. .RE 0
  1712. .P
  1713. Sets the User-Agent request header. The following fields are replaced with their actual counterparts:
  1714. .RS 0
  1715. .IP \(bu 4
  1716. \fB{npm-version}\fR - The npm version in use
  1717. .IP \(bu 4
  1718. \fB{node-version}\fR - The Node.js version in use
  1719. .IP \(bu 4
  1720. \fB{platform}\fR - The value of \fBprocess.platform\fR
  1721. .IP \(bu 4
  1722. \fB{arch}\fR - The value of \fBprocess.arch\fR
  1723. .IP \(bu 4
  1724. \fB{workspaces}\fR - Set to \fBtrue\fR if the \fBworkspaces\fR or \fBworkspace\fR options are set.
  1725. .IP \(bu 4
  1726. \fB{ci}\fR - The value of the \fBci-name\fR config, if set, prefixed with \fBci/\fR, or an empty string if \fBci-name\fR is empty.
  1727. .RE 0
  1728. .SS "\fBuserconfig\fR"
  1729. .RS 0
  1730. .IP \(bu 4
  1731. Default: "~/.npmrc"
  1732. .IP \(bu 4
  1733. Type: Path
  1734. .RE 0
  1735. .P
  1736. The location of user-level configuration settings.
  1737. .P
  1738. This may be overridden by the \fBnpm_config_userconfig\fR environment variable or the \fB--userconfig\fR command line option, but may \fInot\fR be overridden by settings in the \fBglobalconfig\fR file.
  1739. .SS "\fBversion\fR"
  1740. .RS 0
  1741. .IP \(bu 4
  1742. Default: false
  1743. .IP \(bu 4
  1744. Type: Boolean
  1745. .RE 0
  1746. .P
  1747. If true, output the npm version and exit successfully.
  1748. .P
  1749. Only relevant when specified explicitly on the command line.
  1750. .SS "\fBversions\fR"
  1751. .RS 0
  1752. .IP \(bu 4
  1753. Default: false
  1754. .IP \(bu 4
  1755. Type: Boolean
  1756. .RE 0
  1757. .P
  1758. If true, output the npm version as well as node's \fBprocess.versions\fR map and the version in the current working directory's \fBpackage.json\fR file if one exists, and exit successfully.
  1759. .P
  1760. Only relevant when specified explicitly on the command line.
  1761. .SS "\fBviewer\fR"
  1762. .RS 0
  1763. .IP \(bu 4
  1764. Default: "man" on Posix, "browser" on Windows
  1765. .IP \(bu 4
  1766. Type: String
  1767. .RE 0
  1768. .P
  1769. The program to use to view help content.
  1770. .P
  1771. Set to \fB"browser"\fR to view html help content in the default web browser.
  1772. .SS "\fBwhich\fR"
  1773. .RS 0
  1774. .IP \(bu 4
  1775. Default: null
  1776. .IP \(bu 4
  1777. Type: null or Number
  1778. .RE 0
  1779. .P
  1780. If there are multiple funding sources, which 1-indexed source URL to open.
  1781. .SS "\fBworkspace\fR"
  1782. .RS 0
  1783. .IP \(bu 4
  1784. Default:
  1785. .IP \(bu 4
  1786. Type: String (can be set multiple times)
  1787. .RE 0
  1788. .P
  1789. Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option.
  1790. .P
  1791. Valid values for the \fBworkspace\fR config are either:
  1792. .RS 0
  1793. .IP \(bu 4
  1794. Workspace names
  1795. .IP \(bu 4
  1796. Path to a workspace directory
  1797. .IP \(bu 4
  1798. Path to a parent workspace directory (will result in selecting all workspaces within that folder)
  1799. .RE 0
  1800. .P
  1801. When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project.
  1802. .P
  1803. This value is not exported to the environment for child processes.
  1804. .SS "\fBworkspaces\fR"
  1805. .RS 0
  1806. .IP \(bu 4
  1807. Default: null
  1808. .IP \(bu 4
  1809. Type: null or Boolean
  1810. .RE 0
  1811. .P
  1812. Set to true to run the command in the context of \fBall\fR configured workspaces.
  1813. .P
  1814. Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly:
  1815. .RS 0
  1816. .IP \(bu 4
  1817. Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config.
  1818. .RE 0
  1819. .P
  1820. This value is not exported to the environment for child processes.
  1821. .SS "\fBworkspaces-update\fR"
  1822. .RS 0
  1823. .IP \(bu 4
  1824. Default: true
  1825. .IP \(bu 4
  1826. Type: Boolean
  1827. .RE 0
  1828. .P
  1829. If set to true, the npm cli will run an update after operations that may possibly change the workspaces installed to the \fBnode_modules\fR folder.
  1830. .SS "\fByes\fR"
  1831. .RS 0
  1832. .IP \(bu 4
  1833. Default: null
  1834. .IP \(bu 4
  1835. Type: null or Boolean
  1836. .RE 0
  1837. .P
  1838. Automatically answer "yes" to any prompts that npm might print on the command line.
  1839. .SS "\fBalso\fR"
  1840. .RS 0
  1841. .IP \(bu 4
  1842. Default: null
  1843. .IP \(bu 4
  1844. Type: null, "dev", or "development"
  1845. .IP \(bu 4
  1846. DEPRECATED: Please use --include=dev instead.
  1847. .RE 0
  1848. .P
  1849. When set to \fBdev\fR or \fBdevelopment\fR, this is an alias for \fB--include=dev\fR.
  1850. .SS "\fBcache-max\fR"
  1851. .RS 0
  1852. .IP \(bu 4
  1853. Default: Infinity
  1854. .IP \(bu 4
  1855. Type: Number
  1856. .IP \(bu 4
  1857. DEPRECATED: This option has been deprecated in favor of \fB--prefer-online\fR
  1858. .RE 0
  1859. .P
  1860. \fB--cache-max=0\fR is an alias for \fB--prefer-online\fR
  1861. .SS "\fBcache-min\fR"
  1862. .RS 0
  1863. .IP \(bu 4
  1864. Default: 0
  1865. .IP \(bu 4
  1866. Type: Number
  1867. .IP \(bu 4
  1868. DEPRECATED: This option has been deprecated in favor of \fB--prefer-offline\fR.
  1869. .RE 0
  1870. .P
  1871. \fB--cache-min=9999 (or bigger)\fR is an alias for \fB--prefer-offline\fR.
  1872. .SS "\fBcert\fR"
  1873. .RS 0
  1874. .IP \(bu 4
  1875. Default: null
  1876. .IP \(bu 4
  1877. Type: null or String
  1878. .IP \(bu 4
  1879. DEPRECATED: \fBkey\fR and \fBcert\fR are no longer used for most registry operations. Use registry scoped \fBkeyfile\fR and \fBcertfile\fR instead. Example: //other-registry.tld/:keyfile=/path/to/key.pem //other-registry.tld/:certfile=/path/to/cert.crt
  1880. .RE 0
  1881. .P
  1882. A client certificate to pass when accessing the registry. Values should be in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with newlines replaced by the string "\[rs]n". For example:
  1883. .P
  1884. .RS 2
  1885. .nf
  1886. cert="-----BEGIN CERTIFICATE-----\[rs]nXXXX\[rs]nXXXX\[rs]n-----END CERTIFICATE-----"
  1887. .fi
  1888. .RE
  1889. .P
  1890. It is \fInot\fR the path to a certificate file, though you can set a registry-scoped "certfile" path like "//other-registry.tld/:certfile=/path/to/cert.pem".
  1891. .SS "\fBdev\fR"
  1892. .RS 0
  1893. .IP \(bu 4
  1894. Default: false
  1895. .IP \(bu 4
  1896. Type: Boolean
  1897. .IP \(bu 4
  1898. DEPRECATED: Please use --include=dev instead.
  1899. .RE 0
  1900. .P
  1901. Alias for \fB--include=dev\fR.
  1902. .SS "\fBglobal-style\fR"
  1903. .RS 0
  1904. .IP \(bu 4
  1905. Default: false
  1906. .IP \(bu 4
  1907. Type: Boolean
  1908. .IP \(bu 4
  1909. DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=shallow\fR
  1910. .RE 0
  1911. .P
  1912. Only install direct dependencies in the top level \fBnode_modules\fR, but hoist on deeper dependencies. Sets \fB--install-strategy=shallow\fR.
  1913. .SS "\fBinit.author.email\fR"
  1914. .RS 0
  1915. .IP \(bu 4
  1916. Default: ""
  1917. .IP \(bu 4
  1918. Type: String
  1919. .IP \(bu 4
  1920. DEPRECATED: Use \fB--init-author-email\fR instead.
  1921. .RE 0
  1922. .P
  1923. Alias for \fB--init-author-email\fR
  1924. .SS "\fBinit.author.name\fR"
  1925. .RS 0
  1926. .IP \(bu 4
  1927. Default: ""
  1928. .IP \(bu 4
  1929. Type: String
  1930. .IP \(bu 4
  1931. DEPRECATED: Use \fB--init-author-name\fR instead.
  1932. .RE 0
  1933. .P
  1934. Alias for \fB--init-author-name\fR
  1935. .SS "\fBinit.author.url\fR"
  1936. .RS 0
  1937. .IP \(bu 4
  1938. Default: ""
  1939. .IP \(bu 4
  1940. Type: "" or URL
  1941. .IP \(bu 4
  1942. DEPRECATED: Use \fB--init-author-url\fR instead.
  1943. .RE 0
  1944. .P
  1945. Alias for \fB--init-author-url\fR
  1946. .SS "\fBinit.license\fR"
  1947. .RS 0
  1948. .IP \(bu 4
  1949. Default: "ISC"
  1950. .IP \(bu 4
  1951. Type: String
  1952. .IP \(bu 4
  1953. DEPRECATED: Use \fB--init-license\fR instead.
  1954. .RE 0
  1955. .P
  1956. Alias for \fB--init-license\fR
  1957. .SS "\fBinit.module\fR"
  1958. .RS 0
  1959. .IP \(bu 4
  1960. Default: "~/.npm-init.js"
  1961. .IP \(bu 4
  1962. Type: Path
  1963. .IP \(bu 4
  1964. DEPRECATED: Use \fB--init-module\fR instead.
  1965. .RE 0
  1966. .P
  1967. Alias for \fB--init-module\fR
  1968. .SS "\fBinit.version\fR"
  1969. .RS 0
  1970. .IP \(bu 4
  1971. Default: "1.0.0"
  1972. .IP \(bu 4
  1973. Type: SemVer string
  1974. .IP \(bu 4
  1975. DEPRECATED: Use \fB--init-version\fR instead.
  1976. .RE 0
  1977. .P
  1978. Alias for \fB--init-version\fR
  1979. .SS "\fBkey\fR"
  1980. .RS 0
  1981. .IP \(bu 4
  1982. Default: null
  1983. .IP \(bu 4
  1984. Type: null or String
  1985. .IP \(bu 4
  1986. DEPRECATED: \fBkey\fR and \fBcert\fR are no longer used for most registry operations. Use registry scoped \fBkeyfile\fR and \fBcertfile\fR instead. Example: //other-registry.tld/:keyfile=/path/to/key.pem //other-registry.tld/:certfile=/path/to/cert.crt
  1987. .RE 0
  1988. .P
  1989. A client key to pass when accessing the registry. Values should be in PEM format with newlines replaced by the string "\[rs]n". For example:
  1990. .P
  1991. .RS 2
  1992. .nf
  1993. key="-----BEGIN PRIVATE KEY-----\[rs]nXXXX\[rs]nXXXX\[rs]n-----END PRIVATE KEY-----"
  1994. .fi
  1995. .RE
  1996. .P
  1997. It is \fInot\fR the path to a key file, though you can set a registry-scoped "keyfile" path like "//other-registry.tld/:keyfile=/path/to/key.pem".
  1998. .SS "\fBlegacy-bundling\fR"
  1999. .RS 0
  2000. .IP \(bu 4
  2001. Default: false
  2002. .IP \(bu 4
  2003. Type: Boolean
  2004. .IP \(bu 4
  2005. DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=nested\fR
  2006. .RE 0
  2007. .P
  2008. Instead of hoisting package installs in \fBnode_modules\fR, install packages in the same manner that they are depended on. This may cause very deep directory structures and duplicate package installs as there is no de-duplicating. Sets \fB--install-strategy=nested\fR.
  2009. .SS "\fBonly\fR"
  2010. .RS 0
  2011. .IP \(bu 4
  2012. Default: null
  2013. .IP \(bu 4
  2014. Type: null, "prod", or "production"
  2015. .IP \(bu 4
  2016. DEPRECATED: Use \fB--omit=dev\fR to omit dev dependencies from the install.
  2017. .RE 0
  2018. .P
  2019. When set to \fBprod\fR or \fBproduction\fR, this is an alias for \fB--omit=dev\fR.
  2020. .SS "\fBoptional\fR"
  2021. .RS 0
  2022. .IP \(bu 4
  2023. Default: null
  2024. .IP \(bu 4
  2025. Type: null or Boolean
  2026. .IP \(bu 4
  2027. DEPRECATED: Use \fB--omit=optional\fR to exclude optional dependencies, or \fB--include=optional\fR to include them.
  2028. .RE 0
  2029. .P
  2030. Default value does install optional deps unless otherwise omitted.
  2031. .P
  2032. Alias for --include=optional or --omit=optional
  2033. .SS "\fBproduction\fR"
  2034. .RS 0
  2035. .IP \(bu 4
  2036. Default: null
  2037. .IP \(bu 4
  2038. Type: null or Boolean
  2039. .IP \(bu 4
  2040. DEPRECATED: Use \fB--omit=dev\fR instead.
  2041. .RE 0
  2042. .P
  2043. Alias for \fB--omit=dev\fR
  2044. .SS "\fBshrinkwrap\fR"
  2045. .RS 0
  2046. .IP \(bu 4
  2047. Default: true
  2048. .IP \(bu 4
  2049. Type: Boolean
  2050. .IP \(bu 4
  2051. DEPRECATED: Use the --package-lock setting instead.
  2052. .RE 0
  2053. .P
  2054. Alias for --package-lock
  2055. .SS "See also"
  2056. .RS 0
  2057. .IP \(bu 4
  2058. npm help config
  2059. .IP \(bu 4
  2060. npm help npmrc
  2061. .IP \(bu 4
  2062. npm help scripts
  2063. .IP \(bu 4
  2064. npm help folders
  2065. .IP \(bu 4
  2066. npm help npm
  2067. .RE 0