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