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