config.html 83 KB

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