11cb0ef41Sopenharmony_ci<!DOCTYPE html><html><head> 21cb0ef41Sopenharmony_ci<meta charset="utf-8"> 31cb0ef41Sopenharmony_ci<title>config</title> 41cb0ef41Sopenharmony_ci<style> 51cb0ef41Sopenharmony_cibody { 61cb0ef41Sopenharmony_ci background-color: #ffffff; 71cb0ef41Sopenharmony_ci color: #24292e; 81cb0ef41Sopenharmony_ci 91cb0ef41Sopenharmony_ci margin: 0; 101cb0ef41Sopenharmony_ci 111cb0ef41Sopenharmony_ci line-height: 1.5; 121cb0ef41Sopenharmony_ci 131cb0ef41Sopenharmony_ci font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; 141cb0ef41Sopenharmony_ci} 151cb0ef41Sopenharmony_ci#rainbar { 161cb0ef41Sopenharmony_ci height: 10px; 171cb0ef41Sopenharmony_ci background-image: linear-gradient(139deg, #fb8817, #ff4b01, #c12127, #e02aff); 181cb0ef41Sopenharmony_ci} 191cb0ef41Sopenharmony_ci 201cb0ef41Sopenharmony_cia { 211cb0ef41Sopenharmony_ci text-decoration: none; 221cb0ef41Sopenharmony_ci color: #0366d6; 231cb0ef41Sopenharmony_ci} 241cb0ef41Sopenharmony_cia:hover { 251cb0ef41Sopenharmony_ci text-decoration: underline; 261cb0ef41Sopenharmony_ci} 271cb0ef41Sopenharmony_ci 281cb0ef41Sopenharmony_cipre { 291cb0ef41Sopenharmony_ci margin: 1em 0px; 301cb0ef41Sopenharmony_ci padding: 1em; 311cb0ef41Sopenharmony_ci border: solid 1px #e1e4e8; 321cb0ef41Sopenharmony_ci border-radius: 6px; 331cb0ef41Sopenharmony_ci 341cb0ef41Sopenharmony_ci display: block; 351cb0ef41Sopenharmony_ci overflow: auto; 361cb0ef41Sopenharmony_ci 371cb0ef41Sopenharmony_ci white-space: pre; 381cb0ef41Sopenharmony_ci 391cb0ef41Sopenharmony_ci background-color: #f6f8fa; 401cb0ef41Sopenharmony_ci color: #393a34; 411cb0ef41Sopenharmony_ci} 421cb0ef41Sopenharmony_cicode { 431cb0ef41Sopenharmony_ci font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; 441cb0ef41Sopenharmony_ci font-size: 85%; 451cb0ef41Sopenharmony_ci padding: 0.2em 0.4em; 461cb0ef41Sopenharmony_ci background-color: #f6f8fa; 471cb0ef41Sopenharmony_ci color: #393a34; 481cb0ef41Sopenharmony_ci} 491cb0ef41Sopenharmony_cipre > code { 501cb0ef41Sopenharmony_ci padding: 0; 511cb0ef41Sopenharmony_ci background-color: inherit; 521cb0ef41Sopenharmony_ci color: inherit; 531cb0ef41Sopenharmony_ci} 541cb0ef41Sopenharmony_cih1, h2, h3 { 551cb0ef41Sopenharmony_ci font-weight: 600; 561cb0ef41Sopenharmony_ci} 571cb0ef41Sopenharmony_ci 581cb0ef41Sopenharmony_ci#logobar { 591cb0ef41Sopenharmony_ci background-color: #333333; 601cb0ef41Sopenharmony_ci margin: 0 auto; 611cb0ef41Sopenharmony_ci padding: 1em 4em; 621cb0ef41Sopenharmony_ci} 631cb0ef41Sopenharmony_ci#logobar .logo { 641cb0ef41Sopenharmony_ci float: left; 651cb0ef41Sopenharmony_ci} 661cb0ef41Sopenharmony_ci#logobar .title { 671cb0ef41Sopenharmony_ci font-weight: 600; 681cb0ef41Sopenharmony_ci color: #dddddd; 691cb0ef41Sopenharmony_ci float: left; 701cb0ef41Sopenharmony_ci margin: 5px 0 0 1em; 711cb0ef41Sopenharmony_ci} 721cb0ef41Sopenharmony_ci#logobar:after { 731cb0ef41Sopenharmony_ci content: ""; 741cb0ef41Sopenharmony_ci display: block; 751cb0ef41Sopenharmony_ci clear: both; 761cb0ef41Sopenharmony_ci} 771cb0ef41Sopenharmony_ci 781cb0ef41Sopenharmony_ci#content { 791cb0ef41Sopenharmony_ci margin: 0 auto; 801cb0ef41Sopenharmony_ci padding: 0 4em; 811cb0ef41Sopenharmony_ci} 821cb0ef41Sopenharmony_ci 831cb0ef41Sopenharmony_ci#table_of_contents > h2 { 841cb0ef41Sopenharmony_ci font-size: 1.17em; 851cb0ef41Sopenharmony_ci} 861cb0ef41Sopenharmony_ci#table_of_contents ul:first-child { 871cb0ef41Sopenharmony_ci border: solid 1px #e1e4e8; 881cb0ef41Sopenharmony_ci border-radius: 6px; 891cb0ef41Sopenharmony_ci padding: 1em; 901cb0ef41Sopenharmony_ci background-color: #f6f8fa; 911cb0ef41Sopenharmony_ci color: #393a34; 921cb0ef41Sopenharmony_ci} 931cb0ef41Sopenharmony_ci#table_of_contents ul { 941cb0ef41Sopenharmony_ci list-style-type: none; 951cb0ef41Sopenharmony_ci padding-left: 1.5em; 961cb0ef41Sopenharmony_ci} 971cb0ef41Sopenharmony_ci#table_of_contents li { 981cb0ef41Sopenharmony_ci font-size: 0.9em; 991cb0ef41Sopenharmony_ci} 1001cb0ef41Sopenharmony_ci#table_of_contents li a { 1011cb0ef41Sopenharmony_ci color: #000000; 1021cb0ef41Sopenharmony_ci} 1031cb0ef41Sopenharmony_ci 1041cb0ef41Sopenharmony_ciheader.title { 1051cb0ef41Sopenharmony_ci border-bottom: solid 1px #e1e4e8; 1061cb0ef41Sopenharmony_ci} 1071cb0ef41Sopenharmony_ciheader.title > h1 { 1081cb0ef41Sopenharmony_ci margin-bottom: 0.25em; 1091cb0ef41Sopenharmony_ci} 1101cb0ef41Sopenharmony_ciheader.title > .description { 1111cb0ef41Sopenharmony_ci display: block; 1121cb0ef41Sopenharmony_ci margin-bottom: 0.5em; 1131cb0ef41Sopenharmony_ci line-height: 1; 1141cb0ef41Sopenharmony_ci} 1151cb0ef41Sopenharmony_ci 1161cb0ef41Sopenharmony_cifooter#edit { 1171cb0ef41Sopenharmony_ci border-top: solid 1px #e1e4e8; 1181cb0ef41Sopenharmony_ci margin: 3em 0 4em 0; 1191cb0ef41Sopenharmony_ci padding-top: 2em; 1201cb0ef41Sopenharmony_ci} 1211cb0ef41Sopenharmony_ci</style> 1221cb0ef41Sopenharmony_ci</head> 1231cb0ef41Sopenharmony_ci<body> 1241cb0ef41Sopenharmony_ci<div id="banner"> 1251cb0ef41Sopenharmony_ci<div id="rainbar"></div> 1261cb0ef41Sopenharmony_ci<div id="logobar"> 1271cb0ef41Sopenharmony_ci<svg class="logo" role="img" height="32" width="32" viewBox="0 0 700 700"> 1281cb0ef41Sopenharmony_ci<polygon fill="#cb0000" points="0,700 700,700 700,0 0,0"></polygon> 1291cb0ef41Sopenharmony_ci<polygon fill="#ffffff" points="150,550 350,550 350,250 450,250 450,550 550,550 550,150 150,150"></polygon> 1301cb0ef41Sopenharmony_ci</svg> 1311cb0ef41Sopenharmony_ci<div class="title"> 1321cb0ef41Sopenharmony_cinpm command-line interface 1331cb0ef41Sopenharmony_ci</div> 1341cb0ef41Sopenharmony_ci</div> 1351cb0ef41Sopenharmony_ci</div> 1361cb0ef41Sopenharmony_ci 1371cb0ef41Sopenharmony_ci<section id="content"> 1381cb0ef41Sopenharmony_ci<header class="title"> 1391cb0ef41Sopenharmony_ci<h1 id="config">config</h1> 1401cb0ef41Sopenharmony_ci<span class="description">More than you probably want to know about npm configuration</span> 1411cb0ef41Sopenharmony_ci</header> 1421cb0ef41Sopenharmony_ci 1431cb0ef41Sopenharmony_ci<section id="table_of_contents"> 1441cb0ef41Sopenharmony_ci<h2 id="table-of-contents">Table of contents</h2> 1451cb0ef41Sopenharmony_ci<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> 1461cb0ef41Sopenharmony_ci</section> 1471cb0ef41Sopenharmony_ci 1481cb0ef41Sopenharmony_ci<div id="_content"><h3 id="description">Description</h3> 1491cb0ef41Sopenharmony_ci<p>This article details npm configuration in general. To learn about the <code>config</code> command, 1501cb0ef41Sopenharmony_cisee <a href="../commands/npm-config.html"><code>npm config</code></a>.</p> 1511cb0ef41Sopenharmony_ci<p>npm gets its configuration values from the following sources, sorted by priority:</p> 1521cb0ef41Sopenharmony_ci<h4 id="command-line-flags">Command Line Flags</h4> 1531cb0ef41Sopenharmony_ci<p>Putting <code>--foo bar</code> on the command line sets the <code>foo</code> configuration 1541cb0ef41Sopenharmony_ciparameter to <code>"bar"</code>. A <code>--</code> argument tells the cli parser to stop 1551cb0ef41Sopenharmony_cireading flags. Using <code>--flag</code> without specifying any value will set 1561cb0ef41Sopenharmony_cithe value to <code>true</code>.</p> 1571cb0ef41Sopenharmony_ci<p>Example: <code>--flag1 --flag2</code> will set both configuration parameters 1581cb0ef41Sopenharmony_cito <code>true</code>, while <code>--flag1 --flag2 bar</code> will set <code>flag1</code> to <code>true</code>, 1591cb0ef41Sopenharmony_ciand <code>flag2</code> to <code>bar</code>. Finally, <code>--flag1 --flag2 -- bar</code> will set 1601cb0ef41Sopenharmony_ciboth configuration parameters to <code>true</code>, and the <code>bar</code> is taken 1611cb0ef41Sopenharmony_cias a command argument.</p> 1621cb0ef41Sopenharmony_ci<h4 id="environment-variables">Environment Variables</h4> 1631cb0ef41Sopenharmony_ci<p>Any environment variables that start with <code>npm_config_</code> will be 1641cb0ef41Sopenharmony_ciinterpreted as a configuration parameter. For example, putting 1651cb0ef41Sopenharmony_ci<code>npm_config_foo=bar</code> in your environment will set the <code>foo</code> 1661cb0ef41Sopenharmony_ciconfiguration parameter to <code>bar</code>. Any environment configurations that 1671cb0ef41Sopenharmony_ciare not given a value will be given the value of <code>true</code>. Config 1681cb0ef41Sopenharmony_civalues are case-insensitive, so <code>NPM_CONFIG_FOO=bar</code> will work the 1691cb0ef41Sopenharmony_cisame. However, please note that inside <a href="../using-npm/scripts.html"><code>scripts</code></a> 1701cb0ef41Sopenharmony_cinpm will set its own environment variables and Node will prefer 1711cb0ef41Sopenharmony_cithose lowercase versions over any uppercase ones that you might set. 1721cb0ef41Sopenharmony_ciFor details see <a href="https://github.com/npm/npm/issues/14528">this issue</a>.</p> 1731cb0ef41Sopenharmony_ci<p>Notice that you need to use underscores instead of dashes, so <code>--allow-same-version</code> 1741cb0ef41Sopenharmony_ciwould become <code>npm_config_allow_same_version=true</code>.</p> 1751cb0ef41Sopenharmony_ci<h4 id="npmrc-files">npmrc Files</h4> 1761cb0ef41Sopenharmony_ci<p>The four relevant files are:</p> 1771cb0ef41Sopenharmony_ci<ul> 1781cb0ef41Sopenharmony_ci<li>per-project configuration file (<code>/path/to/my/project/.npmrc</code>)</li> 1791cb0ef41Sopenharmony_ci<li>per-user configuration file (defaults to <code>$HOME/.npmrc</code>; configurable via CLI 1801cb0ef41Sopenharmony_cioption <code>--userconfig</code> or environment variable <code>$NPM_CONFIG_USERCONFIG</code>)</li> 1811cb0ef41Sopenharmony_ci<li>global configuration file (defaults to <code>$PREFIX/etc/npmrc</code>; configurable via 1821cb0ef41Sopenharmony_ciCLI option <code>--globalconfig</code> or environment variable <code>$NPM_CONFIG_GLOBALCONFIG</code>)</li> 1831cb0ef41Sopenharmony_ci<li>npm's built-in configuration file (<code>/path/to/npm/npmrc</code>)</li> 1841cb0ef41Sopenharmony_ci</ul> 1851cb0ef41Sopenharmony_ci<p>See <a href="../configuring-npm/npmrc.html">npmrc</a> for more details.</p> 1861cb0ef41Sopenharmony_ci<h4 id="default-configs">Default Configs</h4> 1871cb0ef41Sopenharmony_ci<p>Run <code>npm config ls -l</code> to see a set of configuration parameters that are 1881cb0ef41Sopenharmony_ciinternal to npm, and are defaults if nothing else is specified.</p> 1891cb0ef41Sopenharmony_ci<h3 id="shorthands-and-other-cli-niceties">Shorthands and Other CLI Niceties</h3> 1901cb0ef41Sopenharmony_ci<p>The following shorthands are parsed on the command-line:</p> 1911cb0ef41Sopenharmony_ci<ul> 1921cb0ef41Sopenharmony_ci<li><code>-a</code>: <code>--all</code></li> 1931cb0ef41Sopenharmony_ci<li><code>--enjoy-by</code>: <code>--before</code></li> 1941cb0ef41Sopenharmony_ci<li><code>-c</code>: <code>--call</code></li> 1951cb0ef41Sopenharmony_ci<li><code>--desc</code>: <code>--description</code></li> 1961cb0ef41Sopenharmony_ci<li><code>-f</code>: <code>--force</code></li> 1971cb0ef41Sopenharmony_ci<li><code>-g</code>: <code>--global</code></li> 1981cb0ef41Sopenharmony_ci<li><code>--iwr</code>: <code>--include-workspace-root</code></li> 1991cb0ef41Sopenharmony_ci<li><code>-L</code>: <code>--location</code></li> 2001cb0ef41Sopenharmony_ci<li><code>-d</code>: <code>--loglevel info</code></li> 2011cb0ef41Sopenharmony_ci<li><code>-s</code>: <code>--loglevel silent</code></li> 2021cb0ef41Sopenharmony_ci<li><code>--silent</code>: <code>--loglevel silent</code></li> 2031cb0ef41Sopenharmony_ci<li><code>--ddd</code>: <code>--loglevel silly</code></li> 2041cb0ef41Sopenharmony_ci<li><code>--dd</code>: <code>--loglevel verbose</code></li> 2051cb0ef41Sopenharmony_ci<li><code>--verbose</code>: <code>--loglevel verbose</code></li> 2061cb0ef41Sopenharmony_ci<li><code>-q</code>: <code>--loglevel warn</code></li> 2071cb0ef41Sopenharmony_ci<li><code>--quiet</code>: <code>--loglevel warn</code></li> 2081cb0ef41Sopenharmony_ci<li><code>-l</code>: <code>--long</code></li> 2091cb0ef41Sopenharmony_ci<li><code>-m</code>: <code>--message</code></li> 2101cb0ef41Sopenharmony_ci<li><code>--local</code>: <code>--no-global</code></li> 2111cb0ef41Sopenharmony_ci<li><code>-n</code>: <code>--no-yes</code></li> 2121cb0ef41Sopenharmony_ci<li><code>--no</code>: <code>--no-yes</code></li> 2131cb0ef41Sopenharmony_ci<li><code>-p</code>: <code>--parseable</code></li> 2141cb0ef41Sopenharmony_ci<li><code>--porcelain</code>: <code>--parseable</code></li> 2151cb0ef41Sopenharmony_ci<li><code>-C</code>: <code>--prefix</code></li> 2161cb0ef41Sopenharmony_ci<li><code>--readonly</code>: <code>--read-only</code></li> 2171cb0ef41Sopenharmony_ci<li><code>--reg</code>: <code>--registry</code></li> 2181cb0ef41Sopenharmony_ci<li><code>-S</code>: <code>--save</code></li> 2191cb0ef41Sopenharmony_ci<li><code>-B</code>: <code>--save-bundle</code></li> 2201cb0ef41Sopenharmony_ci<li><code>-D</code>: <code>--save-dev</code></li> 2211cb0ef41Sopenharmony_ci<li><code>-E</code>: <code>--save-exact</code></li> 2221cb0ef41Sopenharmony_ci<li><code>-O</code>: <code>--save-optional</code></li> 2231cb0ef41Sopenharmony_ci<li><code>-P</code>: <code>--save-prod</code></li> 2241cb0ef41Sopenharmony_ci<li><code>-?</code>: <code>--usage</code></li> 2251cb0ef41Sopenharmony_ci<li><code>-h</code>: <code>--usage</code></li> 2261cb0ef41Sopenharmony_ci<li><code>-H</code>: <code>--usage</code></li> 2271cb0ef41Sopenharmony_ci<li><code>--help</code>: <code>--usage</code></li> 2281cb0ef41Sopenharmony_ci<li><code>-v</code>: <code>--version</code></li> 2291cb0ef41Sopenharmony_ci<li><code>-w</code>: <code>--workspace</code></li> 2301cb0ef41Sopenharmony_ci<li><code>--ws</code>: <code>--workspaces</code></li> 2311cb0ef41Sopenharmony_ci<li><code>-y</code>: <code>--yes</code></li> 2321cb0ef41Sopenharmony_ci</ul> 2331cb0ef41Sopenharmony_ci<p>If the specified configuration param resolves unambiguously to a known 2341cb0ef41Sopenharmony_ciconfiguration parameter, then it is expanded to that configuration 2351cb0ef41Sopenharmony_ciparameter. For example:</p> 2361cb0ef41Sopenharmony_ci<pre><code class="language-bash">npm ls --par 2371cb0ef41Sopenharmony_ci# same as: 2381cb0ef41Sopenharmony_cinpm ls --parseable 2391cb0ef41Sopenharmony_ci</code></pre> 2401cb0ef41Sopenharmony_ci<p>If multiple single-character shorthands are strung together, and the 2411cb0ef41Sopenharmony_ciresulting combination is unambiguously not some other configuration 2421cb0ef41Sopenharmony_ciparam, then it is expanded to its various component pieces. For 2431cb0ef41Sopenharmony_ciexample:</p> 2441cb0ef41Sopenharmony_ci<pre><code class="language-bash">npm ls -gpld 2451cb0ef41Sopenharmony_ci# same as: 2461cb0ef41Sopenharmony_cinpm ls --global --parseable --long --loglevel info 2471cb0ef41Sopenharmony_ci</code></pre> 2481cb0ef41Sopenharmony_ci<h3 id="config-settings">Config Settings</h3> 2491cb0ef41Sopenharmony_ci<h4 id="auth"><code>_auth</code></h4> 2501cb0ef41Sopenharmony_ci<ul> 2511cb0ef41Sopenharmony_ci<li>Default: null</li> 2521cb0ef41Sopenharmony_ci<li>Type: null or String</li> 2531cb0ef41Sopenharmony_ci</ul> 2541cb0ef41Sopenharmony_ci<p>A basic-auth string to use when authenticating against the npm registry. 2551cb0ef41Sopenharmony_ciThis will ONLY be used to authenticate against the npm registry. For other 2561cb0ef41Sopenharmony_ciregistries you will need to scope it like "//other-registry.tld/:_auth"</p> 2571cb0ef41Sopenharmony_ci<p>Warning: This should generally not be set via a command-line option. It is 2581cb0ef41Sopenharmony_cisafer to use a registry-provided authentication bearer token stored in the 2591cb0ef41Sopenharmony_ci~/.npmrc file by running <code>npm login</code>.</p> 2601cb0ef41Sopenharmony_ci<h4 id="access"><code>access</code></h4> 2611cb0ef41Sopenharmony_ci<ul> 2621cb0ef41Sopenharmony_ci<li>Default: 'public' for new packages, existing packages it will not change the 2631cb0ef41Sopenharmony_cicurrent level</li> 2641cb0ef41Sopenharmony_ci<li>Type: null, "restricted", or "public"</li> 2651cb0ef41Sopenharmony_ci</ul> 2661cb0ef41Sopenharmony_ci<p>If you do not want your scoped package to be publicly viewable (and 2671cb0ef41Sopenharmony_ciinstallable) set <code>--access=restricted</code>.</p> 2681cb0ef41Sopenharmony_ci<p>Unscoped packages can not be set to <code>restricted</code>.</p> 2691cb0ef41Sopenharmony_ci<p>Note: This defaults to not changing the current access level for existing 2701cb0ef41Sopenharmony_cipackages. Specifying a value of <code>restricted</code> or <code>public</code> during publish will 2711cb0ef41Sopenharmony_cichange the access for an existing package the same way that <code>npm access set status</code> would.</p> 2721cb0ef41Sopenharmony_ci<h4 id="all"><code>all</code></h4> 2731cb0ef41Sopenharmony_ci<ul> 2741cb0ef41Sopenharmony_ci<li>Default: false</li> 2751cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 2761cb0ef41Sopenharmony_ci</ul> 2771cb0ef41Sopenharmony_ci<p>When running <code>npm outdated</code> and <code>npm ls</code>, setting <code>--all</code> will show all 2781cb0ef41Sopenharmony_cioutdated or installed packages, rather than only those directly depended 2791cb0ef41Sopenharmony_ciupon by the current project.</p> 2801cb0ef41Sopenharmony_ci<h4 id="allow-same-version"><code>allow-same-version</code></h4> 2811cb0ef41Sopenharmony_ci<ul> 2821cb0ef41Sopenharmony_ci<li>Default: false</li> 2831cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 2841cb0ef41Sopenharmony_ci</ul> 2851cb0ef41Sopenharmony_ci<p>Prevents throwing an error when <code>npm version</code> is used to set the new version 2861cb0ef41Sopenharmony_cito the same value as the current version.</p> 2871cb0ef41Sopenharmony_ci<h4 id="audit"><code>audit</code></h4> 2881cb0ef41Sopenharmony_ci<ul> 2891cb0ef41Sopenharmony_ci<li>Default: true</li> 2901cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 2911cb0ef41Sopenharmony_ci</ul> 2921cb0ef41Sopenharmony_ci<p>When "true" submit audit reports alongside the current npm command to the 2931cb0ef41Sopenharmony_cidefault registry and all registries configured for scopes. See the 2941cb0ef41Sopenharmony_cidocumentation for <a href="../commands/npm-audit.html"><code>npm audit</code></a> for details on what is 2951cb0ef41Sopenharmony_cisubmitted.</p> 2961cb0ef41Sopenharmony_ci<h4 id="audit-level"><code>audit-level</code></h4> 2971cb0ef41Sopenharmony_ci<ul> 2981cb0ef41Sopenharmony_ci<li>Default: null</li> 2991cb0ef41Sopenharmony_ci<li>Type: null, "info", "low", "moderate", "high", "critical", or "none"</li> 3001cb0ef41Sopenharmony_ci</ul> 3011cb0ef41Sopenharmony_ci<p>The minimum level of vulnerability for <code>npm audit</code> to exit with a non-zero 3021cb0ef41Sopenharmony_ciexit code.</p> 3031cb0ef41Sopenharmony_ci<h4 id="auth-type"><code>auth-type</code></h4> 3041cb0ef41Sopenharmony_ci<ul> 3051cb0ef41Sopenharmony_ci<li>Default: "web"</li> 3061cb0ef41Sopenharmony_ci<li>Type: "legacy" or "web"</li> 3071cb0ef41Sopenharmony_ci</ul> 3081cb0ef41Sopenharmony_ci<p>What authentication strategy to use with <code>login</code>. Note that if an <code>otp</code> 3091cb0ef41Sopenharmony_ciconfig is given, this value will always be set to <code>legacy</code>.</p> 3101cb0ef41Sopenharmony_ci<h4 id="before"><code>before</code></h4> 3111cb0ef41Sopenharmony_ci<ul> 3121cb0ef41Sopenharmony_ci<li>Default: null</li> 3131cb0ef41Sopenharmony_ci<li>Type: null or Date</li> 3141cb0ef41Sopenharmony_ci</ul> 3151cb0ef41Sopenharmony_ci<p>If passed to <code>npm install</code>, will rebuild the npm tree such that only 3161cb0ef41Sopenharmony_civersions that were available <strong>on or before</strong> the <code>--before</code> time get 3171cb0ef41Sopenharmony_ciinstalled. If there's no versions available for the current set of direct 3181cb0ef41Sopenharmony_cidependencies, the command will error.</p> 3191cb0ef41Sopenharmony_ci<p>If the requested version is a <code>dist-tag</code> and the given tag does not pass the 3201cb0ef41Sopenharmony_ci<code>--before</code> filter, the most recent version less than or equal to that tag 3211cb0ef41Sopenharmony_ciwill be used. For example, <code>foo@latest</code> might install <code>foo@1.2</code> even though 3221cb0ef41Sopenharmony_ci<code>latest</code> is <code>2.0</code>.</p> 3231cb0ef41Sopenharmony_ci<h4 id="bin-links"><code>bin-links</code></h4> 3241cb0ef41Sopenharmony_ci<ul> 3251cb0ef41Sopenharmony_ci<li>Default: true</li> 3261cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 3271cb0ef41Sopenharmony_ci</ul> 3281cb0ef41Sopenharmony_ci<p>Tells npm to create symlinks (or <code>.cmd</code> shims on Windows) for package 3291cb0ef41Sopenharmony_ciexecutables.</p> 3301cb0ef41Sopenharmony_ci<p>Set to false to have it not do this. This can be used to work around the 3311cb0ef41Sopenharmony_cifact that some file systems don't support symlinks, even on ostensibly Unix 3321cb0ef41Sopenharmony_cisystems.</p> 3331cb0ef41Sopenharmony_ci<h4 id="browser"><code>browser</code></h4> 3341cb0ef41Sopenharmony_ci<ul> 3351cb0ef41Sopenharmony_ci<li>Default: OS X: <code>"open"</code>, Windows: <code>"start"</code>, Others: <code>"xdg-open"</code></li> 3361cb0ef41Sopenharmony_ci<li>Type: null, Boolean, or String</li> 3371cb0ef41Sopenharmony_ci</ul> 3381cb0ef41Sopenharmony_ci<p>The browser that is called by npm commands to open websites.</p> 3391cb0ef41Sopenharmony_ci<p>Set to <code>false</code> to suppress browser behavior and instead print urls to 3401cb0ef41Sopenharmony_citerminal.</p> 3411cb0ef41Sopenharmony_ci<p>Set to <code>true</code> to use default system URL opener.</p> 3421cb0ef41Sopenharmony_ci<h4 id="ca"><code>ca</code></h4> 3431cb0ef41Sopenharmony_ci<ul> 3441cb0ef41Sopenharmony_ci<li>Default: null</li> 3451cb0ef41Sopenharmony_ci<li>Type: null or String (can be set multiple times)</li> 3461cb0ef41Sopenharmony_ci</ul> 3471cb0ef41Sopenharmony_ci<p>The Certificate Authority signing certificate that is trusted for SSL 3481cb0ef41Sopenharmony_ciconnections to the registry. Values should be in PEM format (Windows calls 3491cb0ef41Sopenharmony_ciit "Base-64 encoded X.509 (.CER)") with newlines replaced by the string 3501cb0ef41Sopenharmony_ci"\n". For example:</p> 3511cb0ef41Sopenharmony_ci<pre><code class="language-ini">ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----" 3521cb0ef41Sopenharmony_ci</code></pre> 3531cb0ef41Sopenharmony_ci<p>Set to <code>null</code> to only allow "known" registrars, or to a specific CA cert to 3541cb0ef41Sopenharmony_citrust only that specific signing authority.</p> 3551cb0ef41Sopenharmony_ci<p>Multiple CAs can be trusted by specifying an array of certificates:</p> 3561cb0ef41Sopenharmony_ci<pre><code class="language-ini">ca[]="..." 3571cb0ef41Sopenharmony_cica[]="..." 3581cb0ef41Sopenharmony_ci</code></pre> 3591cb0ef41Sopenharmony_ci<p>See also the <code>strict-ssl</code> config.</p> 3601cb0ef41Sopenharmony_ci<h4 id="cache"><code>cache</code></h4> 3611cb0ef41Sopenharmony_ci<ul> 3621cb0ef41Sopenharmony_ci<li>Default: Windows: <code>%LocalAppData%\npm-cache</code>, Posix: <code>~/.npm</code></li> 3631cb0ef41Sopenharmony_ci<li>Type: Path</li> 3641cb0ef41Sopenharmony_ci</ul> 3651cb0ef41Sopenharmony_ci<p>The location of npm's cache directory.</p> 3661cb0ef41Sopenharmony_ci<h4 id="cafile"><code>cafile</code></h4> 3671cb0ef41Sopenharmony_ci<ul> 3681cb0ef41Sopenharmony_ci<li>Default: null</li> 3691cb0ef41Sopenharmony_ci<li>Type: Path</li> 3701cb0ef41Sopenharmony_ci</ul> 3711cb0ef41Sopenharmony_ci<p>A path to a file containing one or multiple Certificate Authority signing 3721cb0ef41Sopenharmony_cicertificates. Similar to the <code>ca</code> setting, but allows for multiple CA's, as 3731cb0ef41Sopenharmony_ciwell as for the CA information to be stored in a file on disk.</p> 3741cb0ef41Sopenharmony_ci<h4 id="call"><code>call</code></h4> 3751cb0ef41Sopenharmony_ci<ul> 3761cb0ef41Sopenharmony_ci<li>Default: ""</li> 3771cb0ef41Sopenharmony_ci<li>Type: String</li> 3781cb0ef41Sopenharmony_ci</ul> 3791cb0ef41Sopenharmony_ci<p>Optional companion option for <code>npm exec</code>, <code>npx</code> that allows for specifying a 3801cb0ef41Sopenharmony_cicustom command to be run along with the installed packages.</p> 3811cb0ef41Sopenharmony_ci<pre><code class="language-bash">npm exec --package yo --package generator-node --call "yo node" 3821cb0ef41Sopenharmony_ci</code></pre> 3831cb0ef41Sopenharmony_ci<h4 id="cidr"><code>cidr</code></h4> 3841cb0ef41Sopenharmony_ci<ul> 3851cb0ef41Sopenharmony_ci<li>Default: null</li> 3861cb0ef41Sopenharmony_ci<li>Type: null or String (can be set multiple times)</li> 3871cb0ef41Sopenharmony_ci</ul> 3881cb0ef41Sopenharmony_ci<p>This is a list of CIDR address to be used when configuring limited access 3891cb0ef41Sopenharmony_citokens with the <code>npm token create</code> command.</p> 3901cb0ef41Sopenharmony_ci<h4 id="color"><code>color</code></h4> 3911cb0ef41Sopenharmony_ci<ul> 3921cb0ef41Sopenharmony_ci<li>Default: true unless the NO_COLOR environ is set to something other than '0'</li> 3931cb0ef41Sopenharmony_ci<li>Type: "always" or Boolean</li> 3941cb0ef41Sopenharmony_ci</ul> 3951cb0ef41Sopenharmony_ci<p>If false, never shows colors. If <code>"always"</code> then always shows colors. If 3961cb0ef41Sopenharmony_citrue, then only prints color codes for tty file descriptors.</p> 3971cb0ef41Sopenharmony_ci<h4 id="commit-hooks"><code>commit-hooks</code></h4> 3981cb0ef41Sopenharmony_ci<ul> 3991cb0ef41Sopenharmony_ci<li>Default: true</li> 4001cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 4011cb0ef41Sopenharmony_ci</ul> 4021cb0ef41Sopenharmony_ci<p>Run git commit hooks when using the <code>npm version</code> command.</p> 4031cb0ef41Sopenharmony_ci<h4 id="cpu"><code>cpu</code></h4> 4041cb0ef41Sopenharmony_ci<ul> 4051cb0ef41Sopenharmony_ci<li>Default: null</li> 4061cb0ef41Sopenharmony_ci<li>Type: null or String</li> 4071cb0ef41Sopenharmony_ci</ul> 4081cb0ef41Sopenharmony_ci<p>Override CPU architecture of native modules to install. Acceptable values 4091cb0ef41Sopenharmony_ciare same as <code>cpu</code> field of package.json, which comes from <code>process.arch</code>.</p> 4101cb0ef41Sopenharmony_ci<h4 id="depth"><code>depth</code></h4> 4111cb0ef41Sopenharmony_ci<ul> 4121cb0ef41Sopenharmony_ci<li>Default: <code>Infinity</code> if <code>--all</code> is set, otherwise <code>1</code></li> 4131cb0ef41Sopenharmony_ci<li>Type: null or Number</li> 4141cb0ef41Sopenharmony_ci</ul> 4151cb0ef41Sopenharmony_ci<p>The depth to go when recursing packages for <code>npm ls</code>.</p> 4161cb0ef41Sopenharmony_ci<p>If not set, <code>npm ls</code> will show only the immediate dependencies of the root 4171cb0ef41Sopenharmony_ciproject. If <code>--all</code> is set, then npm will show all dependencies by default.</p> 4181cb0ef41Sopenharmony_ci<h4 id="description2"><code>description</code></h4> 4191cb0ef41Sopenharmony_ci<ul> 4201cb0ef41Sopenharmony_ci<li>Default: true</li> 4211cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 4221cb0ef41Sopenharmony_ci</ul> 4231cb0ef41Sopenharmony_ci<p>Show the description in <code>npm search</code></p> 4241cb0ef41Sopenharmony_ci<h4 id="diff"><code>diff</code></h4> 4251cb0ef41Sopenharmony_ci<ul> 4261cb0ef41Sopenharmony_ci<li>Default:</li> 4271cb0ef41Sopenharmony_ci<li>Type: String (can be set multiple times)</li> 4281cb0ef41Sopenharmony_ci</ul> 4291cb0ef41Sopenharmony_ci<p>Define arguments to compare in <code>npm diff</code>.</p> 4301cb0ef41Sopenharmony_ci<h4 id="diff-dst-prefix"><code>diff-dst-prefix</code></h4> 4311cb0ef41Sopenharmony_ci<ul> 4321cb0ef41Sopenharmony_ci<li>Default: "b/"</li> 4331cb0ef41Sopenharmony_ci<li>Type: String</li> 4341cb0ef41Sopenharmony_ci</ul> 4351cb0ef41Sopenharmony_ci<p>Destination prefix to be used in <code>npm diff</code> output.</p> 4361cb0ef41Sopenharmony_ci<h4 id="diff-ignore-all-space"><code>diff-ignore-all-space</code></h4> 4371cb0ef41Sopenharmony_ci<ul> 4381cb0ef41Sopenharmony_ci<li>Default: false</li> 4391cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 4401cb0ef41Sopenharmony_ci</ul> 4411cb0ef41Sopenharmony_ci<p>Ignore whitespace when comparing lines in <code>npm diff</code>.</p> 4421cb0ef41Sopenharmony_ci<h4 id="diff-name-only"><code>diff-name-only</code></h4> 4431cb0ef41Sopenharmony_ci<ul> 4441cb0ef41Sopenharmony_ci<li>Default: false</li> 4451cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 4461cb0ef41Sopenharmony_ci</ul> 4471cb0ef41Sopenharmony_ci<p>Prints only filenames when using <code>npm diff</code>.</p> 4481cb0ef41Sopenharmony_ci<h4 id="diff-no-prefix"><code>diff-no-prefix</code></h4> 4491cb0ef41Sopenharmony_ci<ul> 4501cb0ef41Sopenharmony_ci<li>Default: false</li> 4511cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 4521cb0ef41Sopenharmony_ci</ul> 4531cb0ef41Sopenharmony_ci<p>Do not show any source or destination prefix in <code>npm diff</code> output.</p> 4541cb0ef41Sopenharmony_ci<p>Note: this causes <code>npm diff</code> to ignore the <code>--diff-src-prefix</code> and 4551cb0ef41Sopenharmony_ci<code>--diff-dst-prefix</code> configs.</p> 4561cb0ef41Sopenharmony_ci<h4 id="diff-src-prefix"><code>diff-src-prefix</code></h4> 4571cb0ef41Sopenharmony_ci<ul> 4581cb0ef41Sopenharmony_ci<li>Default: "a/"</li> 4591cb0ef41Sopenharmony_ci<li>Type: String</li> 4601cb0ef41Sopenharmony_ci</ul> 4611cb0ef41Sopenharmony_ci<p>Source prefix to be used in <code>npm diff</code> output.</p> 4621cb0ef41Sopenharmony_ci<h4 id="diff-text"><code>diff-text</code></h4> 4631cb0ef41Sopenharmony_ci<ul> 4641cb0ef41Sopenharmony_ci<li>Default: false</li> 4651cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 4661cb0ef41Sopenharmony_ci</ul> 4671cb0ef41Sopenharmony_ci<p>Treat all files as text in <code>npm diff</code>.</p> 4681cb0ef41Sopenharmony_ci<h4 id="diff-unified"><code>diff-unified</code></h4> 4691cb0ef41Sopenharmony_ci<ul> 4701cb0ef41Sopenharmony_ci<li>Default: 3</li> 4711cb0ef41Sopenharmony_ci<li>Type: Number</li> 4721cb0ef41Sopenharmony_ci</ul> 4731cb0ef41Sopenharmony_ci<p>The number of lines of context to print in <code>npm diff</code>.</p> 4741cb0ef41Sopenharmony_ci<h4 id="dry-run"><code>dry-run</code></h4> 4751cb0ef41Sopenharmony_ci<ul> 4761cb0ef41Sopenharmony_ci<li>Default: false</li> 4771cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 4781cb0ef41Sopenharmony_ci</ul> 4791cb0ef41Sopenharmony_ci<p>Indicates that you don't want npm to make any changes and that it should 4801cb0ef41Sopenharmony_cionly report what it would have done. This can be passed into any of the 4811cb0ef41Sopenharmony_cicommands that modify your local installation, eg, <code>install</code>, <code>update</code>, 4821cb0ef41Sopenharmony_ci<code>dedupe</code>, <code>uninstall</code>, as well as <code>pack</code> and <code>publish</code>.</p> 4831cb0ef41Sopenharmony_ci<p>Note: This is NOT honored by other network related commands, eg <code>dist-tags</code>, 4841cb0ef41Sopenharmony_ci<code>owner</code>, etc.</p> 4851cb0ef41Sopenharmony_ci<h4 id="editor"><code>editor</code></h4> 4861cb0ef41Sopenharmony_ci<ul> 4871cb0ef41Sopenharmony_ci<li>Default: The EDITOR or VISUAL environment variables, or 4881cb0ef41Sopenharmony_ci'%SYSTEMROOT%\notepad.exe' on Windows, or 'vi' on Unix systems</li> 4891cb0ef41Sopenharmony_ci<li>Type: String</li> 4901cb0ef41Sopenharmony_ci</ul> 4911cb0ef41Sopenharmony_ci<p>The command to run for <code>npm edit</code> and <code>npm config edit</code>.</p> 4921cb0ef41Sopenharmony_ci<h4 id="engine-strict"><code>engine-strict</code></h4> 4931cb0ef41Sopenharmony_ci<ul> 4941cb0ef41Sopenharmony_ci<li>Default: false</li> 4951cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 4961cb0ef41Sopenharmony_ci</ul> 4971cb0ef41Sopenharmony_ci<p>If set to true, then npm will stubbornly refuse to install (or even consider 4981cb0ef41Sopenharmony_ciinstalling) any package that claims to not be compatible with the current 4991cb0ef41Sopenharmony_ciNode.js version.</p> 5001cb0ef41Sopenharmony_ci<p>This can be overridden by setting the <code>--force</code> flag.</p> 5011cb0ef41Sopenharmony_ci<h4 id="expect-result-count"><code>expect-result-count</code></h4> 5021cb0ef41Sopenharmony_ci<ul> 5031cb0ef41Sopenharmony_ci<li>Default: null</li> 5041cb0ef41Sopenharmony_ci<li>Type: null or Number</li> 5051cb0ef41Sopenharmony_ci</ul> 5061cb0ef41Sopenharmony_ci<p>Tells to expect a specific number of results from the command.</p> 5071cb0ef41Sopenharmony_ci<p>This config can not be used with: <code>expect-results</code></p> 5081cb0ef41Sopenharmony_ci<h4 id="expect-results"><code>expect-results</code></h4> 5091cb0ef41Sopenharmony_ci<ul> 5101cb0ef41Sopenharmony_ci<li>Default: null</li> 5111cb0ef41Sopenharmony_ci<li>Type: null or Boolean</li> 5121cb0ef41Sopenharmony_ci</ul> 5131cb0ef41Sopenharmony_ci<p>Tells npm whether or not to expect results from the command. Can be either 5141cb0ef41Sopenharmony_citrue (expect some results) or false (expect no results).</p> 5151cb0ef41Sopenharmony_ci<p>This config can not be used with: <code>expect-result-count</code></p> 5161cb0ef41Sopenharmony_ci<h4 id="fetch-retries"><code>fetch-retries</code></h4> 5171cb0ef41Sopenharmony_ci<ul> 5181cb0ef41Sopenharmony_ci<li>Default: 2</li> 5191cb0ef41Sopenharmony_ci<li>Type: Number</li> 5201cb0ef41Sopenharmony_ci</ul> 5211cb0ef41Sopenharmony_ci<p>The "retries" config for the <code>retry</code> module to use when fetching packages 5221cb0ef41Sopenharmony_cifrom the registry.</p> 5231cb0ef41Sopenharmony_ci<p>npm will retry idempotent read requests to the registry in the case of 5241cb0ef41Sopenharmony_cinetwork failures or 5xx HTTP errors.</p> 5251cb0ef41Sopenharmony_ci<h4 id="fetch-retry-factor"><code>fetch-retry-factor</code></h4> 5261cb0ef41Sopenharmony_ci<ul> 5271cb0ef41Sopenharmony_ci<li>Default: 10</li> 5281cb0ef41Sopenharmony_ci<li>Type: Number</li> 5291cb0ef41Sopenharmony_ci</ul> 5301cb0ef41Sopenharmony_ci<p>The "factor" config for the <code>retry</code> module to use when fetching packages.</p> 5311cb0ef41Sopenharmony_ci<h4 id="fetch-retry-maxtimeout"><code>fetch-retry-maxtimeout</code></h4> 5321cb0ef41Sopenharmony_ci<ul> 5331cb0ef41Sopenharmony_ci<li>Default: 60000 (1 minute)</li> 5341cb0ef41Sopenharmony_ci<li>Type: Number</li> 5351cb0ef41Sopenharmony_ci</ul> 5361cb0ef41Sopenharmony_ci<p>The "maxTimeout" config for the <code>retry</code> module to use when fetching 5371cb0ef41Sopenharmony_cipackages.</p> 5381cb0ef41Sopenharmony_ci<h4 id="fetch-retry-mintimeout"><code>fetch-retry-mintimeout</code></h4> 5391cb0ef41Sopenharmony_ci<ul> 5401cb0ef41Sopenharmony_ci<li>Default: 10000 (10 seconds)</li> 5411cb0ef41Sopenharmony_ci<li>Type: Number</li> 5421cb0ef41Sopenharmony_ci</ul> 5431cb0ef41Sopenharmony_ci<p>The "minTimeout" config for the <code>retry</code> module to use when fetching 5441cb0ef41Sopenharmony_cipackages.</p> 5451cb0ef41Sopenharmony_ci<h4 id="fetch-timeout"><code>fetch-timeout</code></h4> 5461cb0ef41Sopenharmony_ci<ul> 5471cb0ef41Sopenharmony_ci<li>Default: 300000 (5 minutes)</li> 5481cb0ef41Sopenharmony_ci<li>Type: Number</li> 5491cb0ef41Sopenharmony_ci</ul> 5501cb0ef41Sopenharmony_ci<p>The maximum amount of time to wait for HTTP requests to complete.</p> 5511cb0ef41Sopenharmony_ci<h4 id="force"><code>force</code></h4> 5521cb0ef41Sopenharmony_ci<ul> 5531cb0ef41Sopenharmony_ci<li>Default: false</li> 5541cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 5551cb0ef41Sopenharmony_ci</ul> 5561cb0ef41Sopenharmony_ci<p>Removes various protections against unfortunate side effects, common 5571cb0ef41Sopenharmony_cimistakes, unnecessary performance degradation, and malicious input.</p> 5581cb0ef41Sopenharmony_ci<ul> 5591cb0ef41Sopenharmony_ci<li>Allow clobbering non-npm files in global installs.</li> 5601cb0ef41Sopenharmony_ci<li>Allow the <code>npm version</code> command to work on an unclean git repository.</li> 5611cb0ef41Sopenharmony_ci<li>Allow deleting the cache folder with <code>npm cache clean</code>.</li> 5621cb0ef41Sopenharmony_ci<li>Allow installing packages that have an <code>engines</code> declaration requiring a 5631cb0ef41Sopenharmony_cidifferent version of npm.</li> 5641cb0ef41Sopenharmony_ci<li>Allow installing packages that have an <code>engines</code> declaration requiring a 5651cb0ef41Sopenharmony_cidifferent version of <code>node</code>, even if <code>--engine-strict</code> is enabled.</li> 5661cb0ef41Sopenharmony_ci<li>Allow <code>npm audit fix</code> to install modules outside your stated dependency 5671cb0ef41Sopenharmony_cirange (including SemVer-major changes).</li> 5681cb0ef41Sopenharmony_ci<li>Allow unpublishing all versions of a published package.</li> 5691cb0ef41Sopenharmony_ci<li>Allow conflicting peerDependencies to be installed in the root project.</li> 5701cb0ef41Sopenharmony_ci<li>Implicitly set <code>--yes</code> during <code>npm init</code>.</li> 5711cb0ef41Sopenharmony_ci<li>Allow clobbering existing values in <code>npm pkg</code></li> 5721cb0ef41Sopenharmony_ci<li>Allow unpublishing of entire packages (not just a single version).</li> 5731cb0ef41Sopenharmony_ci</ul> 5741cb0ef41Sopenharmony_ci<p>If you don't have a clear idea of what you want to do, it is strongly 5751cb0ef41Sopenharmony_cirecommended that you do not use this option!</p> 5761cb0ef41Sopenharmony_ci<h4 id="foreground-scripts"><code>foreground-scripts</code></h4> 5771cb0ef41Sopenharmony_ci<ul> 5781cb0ef41Sopenharmony_ci<li>Default: <code>false</code> unless when using <code>npm pack</code> or <code>npm publish</code> where it 5791cb0ef41Sopenharmony_cidefaults to <code>true</code></li> 5801cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 5811cb0ef41Sopenharmony_ci</ul> 5821cb0ef41Sopenharmony_ci<p>Run all build scripts (ie, <code>preinstall</code>, <code>install</code>, and <code>postinstall</code>) 5831cb0ef41Sopenharmony_ciscripts for installed packages in the foreground process, sharing standard 5841cb0ef41Sopenharmony_ciinput, output, and error with the main npm process.</p> 5851cb0ef41Sopenharmony_ci<p>Note that this will generally make installs run slower, and be much noisier, 5861cb0ef41Sopenharmony_cibut can be useful for debugging.</p> 5871cb0ef41Sopenharmony_ci<h4 id="format-package-lock"><code>format-package-lock</code></h4> 5881cb0ef41Sopenharmony_ci<ul> 5891cb0ef41Sopenharmony_ci<li>Default: true</li> 5901cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 5911cb0ef41Sopenharmony_ci</ul> 5921cb0ef41Sopenharmony_ci<p>Format <code>package-lock.json</code> or <code>npm-shrinkwrap.json</code> as a human readable 5931cb0ef41Sopenharmony_cifile.</p> 5941cb0ef41Sopenharmony_ci<h4 id="fund"><code>fund</code></h4> 5951cb0ef41Sopenharmony_ci<ul> 5961cb0ef41Sopenharmony_ci<li>Default: true</li> 5971cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 5981cb0ef41Sopenharmony_ci</ul> 5991cb0ef41Sopenharmony_ci<p>When "true" displays the message at the end of each <code>npm install</code> 6001cb0ef41Sopenharmony_ciacknowledging the number of dependencies looking for funding. See <a href="../commands/npm-fund.html"><code>npm fund</code></a> for details.</p> 6011cb0ef41Sopenharmony_ci<h4 id="git"><code>git</code></h4> 6021cb0ef41Sopenharmony_ci<ul> 6031cb0ef41Sopenharmony_ci<li>Default: "git"</li> 6041cb0ef41Sopenharmony_ci<li>Type: String</li> 6051cb0ef41Sopenharmony_ci</ul> 6061cb0ef41Sopenharmony_ci<p>The command to use for git commands. If git is installed on the computer, 6071cb0ef41Sopenharmony_cibut is not in the <code>PATH</code>, then set this to the full path to the git binary.</p> 6081cb0ef41Sopenharmony_ci<h4 id="git-tag-version"><code>git-tag-version</code></h4> 6091cb0ef41Sopenharmony_ci<ul> 6101cb0ef41Sopenharmony_ci<li>Default: true</li> 6111cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 6121cb0ef41Sopenharmony_ci</ul> 6131cb0ef41Sopenharmony_ci<p>Tag the commit when using the <code>npm version</code> command. Setting this to false 6141cb0ef41Sopenharmony_ciresults in no commit being made at all.</p> 6151cb0ef41Sopenharmony_ci<h4 id="global"><code>global</code></h4> 6161cb0ef41Sopenharmony_ci<ul> 6171cb0ef41Sopenharmony_ci<li>Default: false</li> 6181cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 6191cb0ef41Sopenharmony_ci</ul> 6201cb0ef41Sopenharmony_ci<p>Operates in "global" mode, so that packages are installed into the <code>prefix</code> 6211cb0ef41Sopenharmony_cifolder instead of the current working directory. See 6221cb0ef41Sopenharmony_ci<a href="../configuring-npm/folders.html">folders</a> for more on the differences in behavior.</p> 6231cb0ef41Sopenharmony_ci<ul> 6241cb0ef41Sopenharmony_ci<li>packages are installed into the <code>{prefix}/lib/node_modules</code> folder, instead 6251cb0ef41Sopenharmony_ciof the current working directory.</li> 6261cb0ef41Sopenharmony_ci<li>bin files are linked to <code>{prefix}/bin</code></li> 6271cb0ef41Sopenharmony_ci<li>man pages are linked to <code>{prefix}/share/man</code></li> 6281cb0ef41Sopenharmony_ci</ul> 6291cb0ef41Sopenharmony_ci<h4 id="globalconfig"><code>globalconfig</code></h4> 6301cb0ef41Sopenharmony_ci<ul> 6311cb0ef41Sopenharmony_ci<li>Default: The global --prefix setting plus 'etc/npmrc'. For example, 6321cb0ef41Sopenharmony_ci'/usr/local/etc/npmrc'</li> 6331cb0ef41Sopenharmony_ci<li>Type: Path</li> 6341cb0ef41Sopenharmony_ci</ul> 6351cb0ef41Sopenharmony_ci<p>The config file to read for global config options.</p> 6361cb0ef41Sopenharmony_ci<h4 id="heading"><code>heading</code></h4> 6371cb0ef41Sopenharmony_ci<ul> 6381cb0ef41Sopenharmony_ci<li>Default: "npm"</li> 6391cb0ef41Sopenharmony_ci<li>Type: String</li> 6401cb0ef41Sopenharmony_ci</ul> 6411cb0ef41Sopenharmony_ci<p>The string that starts all the debugging log output.</p> 6421cb0ef41Sopenharmony_ci<h4 id="https-proxy"><code>https-proxy</code></h4> 6431cb0ef41Sopenharmony_ci<ul> 6441cb0ef41Sopenharmony_ci<li>Default: null</li> 6451cb0ef41Sopenharmony_ci<li>Type: null or URL</li> 6461cb0ef41Sopenharmony_ci</ul> 6471cb0ef41Sopenharmony_ci<p>A proxy to use for outgoing https requests. If the <code>HTTPS_PROXY</code> or 6481cb0ef41Sopenharmony_ci<code>https_proxy</code> or <code>HTTP_PROXY</code> or <code>http_proxy</code> environment variables are set, 6491cb0ef41Sopenharmony_ciproxy settings will be honored by the underlying <code>make-fetch-happen</code> 6501cb0ef41Sopenharmony_cilibrary.</p> 6511cb0ef41Sopenharmony_ci<h4 id="if-present"><code>if-present</code></h4> 6521cb0ef41Sopenharmony_ci<ul> 6531cb0ef41Sopenharmony_ci<li>Default: false</li> 6541cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 6551cb0ef41Sopenharmony_ci</ul> 6561cb0ef41Sopenharmony_ci<p>If true, npm will not exit with an error code when <code>run-script</code> is invoked 6571cb0ef41Sopenharmony_cifor a script that isn't defined in the <code>scripts</code> section of <code>package.json</code>. 6581cb0ef41Sopenharmony_ciThis option can be used when it's desirable to optionally run a script when 6591cb0ef41Sopenharmony_ciit's present and fail if the script fails. This is useful, for example, when 6601cb0ef41Sopenharmony_cirunning scripts that may only apply for some builds in an otherwise generic 6611cb0ef41Sopenharmony_ciCI setup.</p> 6621cb0ef41Sopenharmony_ci<p>This value is not exported to the environment for child processes.</p> 6631cb0ef41Sopenharmony_ci<h4 id="ignore-scripts"><code>ignore-scripts</code></h4> 6641cb0ef41Sopenharmony_ci<ul> 6651cb0ef41Sopenharmony_ci<li>Default: false</li> 6661cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 6671cb0ef41Sopenharmony_ci</ul> 6681cb0ef41Sopenharmony_ci<p>If true, npm does not run scripts specified in package.json files.</p> 6691cb0ef41Sopenharmony_ci<p>Note that commands explicitly intended to run a particular script, such as 6701cb0ef41Sopenharmony_ci<code>npm start</code>, <code>npm stop</code>, <code>npm restart</code>, <code>npm test</code>, and <code>npm run-script</code> 6711cb0ef41Sopenharmony_ciwill still run their intended script if <code>ignore-scripts</code> is set, but they 6721cb0ef41Sopenharmony_ciwill <em>not</em> run any pre- or post-scripts.</p> 6731cb0ef41Sopenharmony_ci<h4 id="include"><code>include</code></h4> 6741cb0ef41Sopenharmony_ci<ul> 6751cb0ef41Sopenharmony_ci<li>Default:</li> 6761cb0ef41Sopenharmony_ci<li>Type: "prod", "dev", "optional", or "peer" (can be set multiple times)</li> 6771cb0ef41Sopenharmony_ci</ul> 6781cb0ef41Sopenharmony_ci<p>Option that allows for defining which types of dependencies to install.</p> 6791cb0ef41Sopenharmony_ci<p>This is the inverse of <code>--omit=<type></code>.</p> 6801cb0ef41Sopenharmony_ci<p>Dependency types specified in <code>--include</code> will not be omitted, regardless of 6811cb0ef41Sopenharmony_cithe order in which omit/include are specified on the command-line.</p> 6821cb0ef41Sopenharmony_ci<h4 id="include-staged"><code>include-staged</code></h4> 6831cb0ef41Sopenharmony_ci<ul> 6841cb0ef41Sopenharmony_ci<li>Default: false</li> 6851cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 6861cb0ef41Sopenharmony_ci</ul> 6871cb0ef41Sopenharmony_ci<p>Allow installing "staged" published packages, as defined by <a href="https://github.com/npm/rfcs/pull/92">npm RFC PR 6881cb0ef41Sopenharmony_ci#92</a>.</p> 6891cb0ef41Sopenharmony_ci<p>This is experimental, and not implemented by the npm public registry.</p> 6901cb0ef41Sopenharmony_ci<h4 id="include-workspace-root"><code>include-workspace-root</code></h4> 6911cb0ef41Sopenharmony_ci<ul> 6921cb0ef41Sopenharmony_ci<li>Default: false</li> 6931cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 6941cb0ef41Sopenharmony_ci</ul> 6951cb0ef41Sopenharmony_ci<p>Include the workspace root when workspaces are enabled for a command.</p> 6961cb0ef41Sopenharmony_ci<p>When false, specifying individual workspaces via the <code>workspace</code> config, or 6971cb0ef41Sopenharmony_ciall workspaces via the <code>workspaces</code> flag, will cause npm to operate only on 6981cb0ef41Sopenharmony_cithe specified workspaces, and not on the root project.</p> 6991cb0ef41Sopenharmony_ci<p>This value is not exported to the environment for child processes.</p> 7001cb0ef41Sopenharmony_ci<h4 id="init-author-email"><code>init-author-email</code></h4> 7011cb0ef41Sopenharmony_ci<ul> 7021cb0ef41Sopenharmony_ci<li>Default: ""</li> 7031cb0ef41Sopenharmony_ci<li>Type: String</li> 7041cb0ef41Sopenharmony_ci</ul> 7051cb0ef41Sopenharmony_ci<p>The value <code>npm init</code> should use by default for the package author's email.</p> 7061cb0ef41Sopenharmony_ci<h4 id="init-author-name"><code>init-author-name</code></h4> 7071cb0ef41Sopenharmony_ci<ul> 7081cb0ef41Sopenharmony_ci<li>Default: ""</li> 7091cb0ef41Sopenharmony_ci<li>Type: String</li> 7101cb0ef41Sopenharmony_ci</ul> 7111cb0ef41Sopenharmony_ci<p>The value <code>npm init</code> should use by default for the package author's name.</p> 7121cb0ef41Sopenharmony_ci<h4 id="init-author-url"><code>init-author-url</code></h4> 7131cb0ef41Sopenharmony_ci<ul> 7141cb0ef41Sopenharmony_ci<li>Default: ""</li> 7151cb0ef41Sopenharmony_ci<li>Type: "" or URL</li> 7161cb0ef41Sopenharmony_ci</ul> 7171cb0ef41Sopenharmony_ci<p>The value <code>npm init</code> should use by default for the package author's 7181cb0ef41Sopenharmony_cihomepage.</p> 7191cb0ef41Sopenharmony_ci<h4 id="init-license"><code>init-license</code></h4> 7201cb0ef41Sopenharmony_ci<ul> 7211cb0ef41Sopenharmony_ci<li>Default: "ISC"</li> 7221cb0ef41Sopenharmony_ci<li>Type: String</li> 7231cb0ef41Sopenharmony_ci</ul> 7241cb0ef41Sopenharmony_ci<p>The value <code>npm init</code> should use by default for the package license.</p> 7251cb0ef41Sopenharmony_ci<h4 id="init-module"><code>init-module</code></h4> 7261cb0ef41Sopenharmony_ci<ul> 7271cb0ef41Sopenharmony_ci<li>Default: "~/.npm-init.js"</li> 7281cb0ef41Sopenharmony_ci<li>Type: Path</li> 7291cb0ef41Sopenharmony_ci</ul> 7301cb0ef41Sopenharmony_ci<p>A module that will be loaded by the <code>npm init</code> command. See the 7311cb0ef41Sopenharmony_cidocumentation for the 7321cb0ef41Sopenharmony_ci<a href="https://github.com/npm/init-package-json">init-package-json</a> module for 7331cb0ef41Sopenharmony_cimore information, or <a href="../commands/npm-init.html">npm init</a>.</p> 7341cb0ef41Sopenharmony_ci<h4 id="init-version"><code>init-version</code></h4> 7351cb0ef41Sopenharmony_ci<ul> 7361cb0ef41Sopenharmony_ci<li>Default: "1.0.0"</li> 7371cb0ef41Sopenharmony_ci<li>Type: SemVer string</li> 7381cb0ef41Sopenharmony_ci</ul> 7391cb0ef41Sopenharmony_ci<p>The value that <code>npm init</code> should use by default for the package version 7401cb0ef41Sopenharmony_cinumber, if not already set in package.json.</p> 7411cb0ef41Sopenharmony_ci<h4 id="install-links"><code>install-links</code></h4> 7421cb0ef41Sopenharmony_ci<ul> 7431cb0ef41Sopenharmony_ci<li>Default: false</li> 7441cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 7451cb0ef41Sopenharmony_ci</ul> 7461cb0ef41Sopenharmony_ci<p>When set file: protocol dependencies will be packed and installed as regular 7471cb0ef41Sopenharmony_cidependencies instead of creating a symlink. This option has no effect on 7481cb0ef41Sopenharmony_ciworkspaces.</p> 7491cb0ef41Sopenharmony_ci<h4 id="install-strategy"><code>install-strategy</code></h4> 7501cb0ef41Sopenharmony_ci<ul> 7511cb0ef41Sopenharmony_ci<li>Default: "hoisted"</li> 7521cb0ef41Sopenharmony_ci<li>Type: "hoisted", "nested", "shallow", or "linked"</li> 7531cb0ef41Sopenharmony_ci</ul> 7541cb0ef41Sopenharmony_ci<p>Sets the strategy for installing packages in node_modules. hoisted 7551cb0ef41Sopenharmony_ci(default): Install non-duplicated in top-level, and duplicated as necessary 7561cb0ef41Sopenharmony_ciwithin directory structure. nested: (formerly --legacy-bundling) install in 7571cb0ef41Sopenharmony_ciplace, no hoisting. shallow (formerly --global-style) only install direct 7581cb0ef41Sopenharmony_cideps at top-level. linked: (experimental) install in node_modules/.store, 7591cb0ef41Sopenharmony_cilink in place, unhoisted.</p> 7601cb0ef41Sopenharmony_ci<h4 id="json"><code>json</code></h4> 7611cb0ef41Sopenharmony_ci<ul> 7621cb0ef41Sopenharmony_ci<li>Default: false</li> 7631cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 7641cb0ef41Sopenharmony_ci</ul> 7651cb0ef41Sopenharmony_ci<p>Whether or not to output JSON data, rather than the normal output.</p> 7661cb0ef41Sopenharmony_ci<ul> 7671cb0ef41Sopenharmony_ci<li>In <code>npm pkg set</code> it enables parsing set values with JSON.parse() before 7681cb0ef41Sopenharmony_cisaving them to your <code>package.json</code>.</li> 7691cb0ef41Sopenharmony_ci</ul> 7701cb0ef41Sopenharmony_ci<p>Not supported by all npm commands.</p> 7711cb0ef41Sopenharmony_ci<h4 id="legacy-peer-deps"><code>legacy-peer-deps</code></h4> 7721cb0ef41Sopenharmony_ci<ul> 7731cb0ef41Sopenharmony_ci<li>Default: false</li> 7741cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 7751cb0ef41Sopenharmony_ci</ul> 7761cb0ef41Sopenharmony_ci<p>Causes npm to completely ignore <code>peerDependencies</code> when building a package 7771cb0ef41Sopenharmony_citree, as in npm versions 3 through 6.</p> 7781cb0ef41Sopenharmony_ci<p>If a package cannot be installed because of overly strict <code>peerDependencies</code> 7791cb0ef41Sopenharmony_cithat collide, it provides a way to move forward resolving the situation.</p> 7801cb0ef41Sopenharmony_ci<p>This differs from <code>--omit=peer</code>, in that <code>--omit=peer</code> will avoid unpacking 7811cb0ef41Sopenharmony_ci<code>peerDependencies</code> on disk, but will still design a tree such that 7821cb0ef41Sopenharmony_ci<code>peerDependencies</code> <em>could</em> be unpacked in a correct place.</p> 7831cb0ef41Sopenharmony_ci<p>Use of <code>legacy-peer-deps</code> is not recommended, as it will not enforce the 7841cb0ef41Sopenharmony_ci<code>peerDependencies</code> contract that meta-dependencies may rely on.</p> 7851cb0ef41Sopenharmony_ci<h4 id="libc"><code>libc</code></h4> 7861cb0ef41Sopenharmony_ci<ul> 7871cb0ef41Sopenharmony_ci<li>Default: null</li> 7881cb0ef41Sopenharmony_ci<li>Type: null or String</li> 7891cb0ef41Sopenharmony_ci</ul> 7901cb0ef41Sopenharmony_ci<p>Override libc of native modules to install. Acceptable values are same as 7911cb0ef41Sopenharmony_ci<code>libc</code> field of package.json</p> 7921cb0ef41Sopenharmony_ci<h4 id="link"><code>link</code></h4> 7931cb0ef41Sopenharmony_ci<ul> 7941cb0ef41Sopenharmony_ci<li>Default: false</li> 7951cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 7961cb0ef41Sopenharmony_ci</ul> 7971cb0ef41Sopenharmony_ci<p>Used with <code>npm ls</code>, limiting output to only those packages that are linked.</p> 7981cb0ef41Sopenharmony_ci<h4 id="local-address"><code>local-address</code></h4> 7991cb0ef41Sopenharmony_ci<ul> 8001cb0ef41Sopenharmony_ci<li>Default: null</li> 8011cb0ef41Sopenharmony_ci<li>Type: IP Address</li> 8021cb0ef41Sopenharmony_ci</ul> 8031cb0ef41Sopenharmony_ci<p>The IP address of the local interface to use when making connections to the 8041cb0ef41Sopenharmony_cinpm registry. Must be IPv4 in versions of Node prior to 0.12.</p> 8051cb0ef41Sopenharmony_ci<h4 id="location"><code>location</code></h4> 8061cb0ef41Sopenharmony_ci<ul> 8071cb0ef41Sopenharmony_ci<li>Default: "user" unless <code>--global</code> is passed, which will also set this value 8081cb0ef41Sopenharmony_cito "global"</li> 8091cb0ef41Sopenharmony_ci<li>Type: "global", "user", or "project"</li> 8101cb0ef41Sopenharmony_ci</ul> 8111cb0ef41Sopenharmony_ci<p>When passed to <code>npm config</code> this refers to which config file to use.</p> 8121cb0ef41Sopenharmony_ci<p>When set to "global" mode, packages are installed into the <code>prefix</code> folder 8131cb0ef41Sopenharmony_ciinstead of the current working directory. See 8141cb0ef41Sopenharmony_ci<a href="../configuring-npm/folders.html">folders</a> for more on the differences in behavior.</p> 8151cb0ef41Sopenharmony_ci<ul> 8161cb0ef41Sopenharmony_ci<li>packages are installed into the <code>{prefix}/lib/node_modules</code> folder, instead 8171cb0ef41Sopenharmony_ciof the current working directory.</li> 8181cb0ef41Sopenharmony_ci<li>bin files are linked to <code>{prefix}/bin</code></li> 8191cb0ef41Sopenharmony_ci<li>man pages are linked to <code>{prefix}/share/man</code></li> 8201cb0ef41Sopenharmony_ci</ul> 8211cb0ef41Sopenharmony_ci<h4 id="lockfile-version"><code>lockfile-version</code></h4> 8221cb0ef41Sopenharmony_ci<ul> 8231cb0ef41Sopenharmony_ci<li>Default: Version 3 if no lockfile, auto-converting v1 lockfiles to v3, 8241cb0ef41Sopenharmony_ciotherwise maintain current lockfile version.</li> 8251cb0ef41Sopenharmony_ci<li>Type: null, 1, 2, 3, "1", "2", or "3"</li> 8261cb0ef41Sopenharmony_ci</ul> 8271cb0ef41Sopenharmony_ci<p>Set the lockfile format version to be used in package-lock.json and 8281cb0ef41Sopenharmony_cinpm-shrinkwrap-json files. Possible options are:</p> 8291cb0ef41Sopenharmony_ci<p>1: The lockfile version used by npm versions 5 and 6. Lacks some data that 8301cb0ef41Sopenharmony_ciis used during the install, resulting in slower and possibly less 8311cb0ef41Sopenharmony_cideterministic installs. Prevents lockfile churn when interoperating with 8321cb0ef41Sopenharmony_ciolder npm versions.</p> 8331cb0ef41Sopenharmony_ci<p>2: The default lockfile version used by npm version 7 and 8. Includes both 8341cb0ef41Sopenharmony_cithe version 1 lockfile data and version 3 lockfile data, for maximum 8351cb0ef41Sopenharmony_cideterminism and interoperability, at the expense of more bytes on disk.</p> 8361cb0ef41Sopenharmony_ci<p>3: Only the new lockfile information introduced in npm version 7. Smaller on 8371cb0ef41Sopenharmony_cidisk than lockfile version 2, but not interoperable with older npm versions. 8381cb0ef41Sopenharmony_ciIdeal if all users are on npm version 7 and higher.</p> 8391cb0ef41Sopenharmony_ci<h4 id="loglevel"><code>loglevel</code></h4> 8401cb0ef41Sopenharmony_ci<ul> 8411cb0ef41Sopenharmony_ci<li>Default: "notice"</li> 8421cb0ef41Sopenharmony_ci<li>Type: "silent", "error", "warn", "notice", "http", "info", "verbose", or 8431cb0ef41Sopenharmony_ci"silly"</li> 8441cb0ef41Sopenharmony_ci</ul> 8451cb0ef41Sopenharmony_ci<p>What level of logs to report. All logs are written to a debug log, with the 8461cb0ef41Sopenharmony_cipath to that file printed if the execution of a command fails.</p> 8471cb0ef41Sopenharmony_ci<p>Any logs of a higher level than the setting are shown. The default is 8481cb0ef41Sopenharmony_ci"notice".</p> 8491cb0ef41Sopenharmony_ci<p>See also the <code>foreground-scripts</code> config.</p> 8501cb0ef41Sopenharmony_ci<h4 id="logs-dir"><code>logs-dir</code></h4> 8511cb0ef41Sopenharmony_ci<ul> 8521cb0ef41Sopenharmony_ci<li>Default: A directory named <code>_logs</code> inside the cache</li> 8531cb0ef41Sopenharmony_ci<li>Type: null or Path</li> 8541cb0ef41Sopenharmony_ci</ul> 8551cb0ef41Sopenharmony_ci<p>The location of npm's log directory. See <a href="../using-npm/logging.html"><code>npm logging</code></a> 8561cb0ef41Sopenharmony_cifor more information.</p> 8571cb0ef41Sopenharmony_ci<h4 id="logs-max"><code>logs-max</code></h4> 8581cb0ef41Sopenharmony_ci<ul> 8591cb0ef41Sopenharmony_ci<li>Default: 10</li> 8601cb0ef41Sopenharmony_ci<li>Type: Number</li> 8611cb0ef41Sopenharmony_ci</ul> 8621cb0ef41Sopenharmony_ci<p>The maximum number of log files to store.</p> 8631cb0ef41Sopenharmony_ci<p>If set to 0, no log files will be written for the current run.</p> 8641cb0ef41Sopenharmony_ci<h4 id="long"><code>long</code></h4> 8651cb0ef41Sopenharmony_ci<ul> 8661cb0ef41Sopenharmony_ci<li>Default: false</li> 8671cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 8681cb0ef41Sopenharmony_ci</ul> 8691cb0ef41Sopenharmony_ci<p>Show extended information in <code>ls</code>, <code>search</code>, and <code>help-search</code>.</p> 8701cb0ef41Sopenharmony_ci<h4 id="maxsockets"><code>maxsockets</code></h4> 8711cb0ef41Sopenharmony_ci<ul> 8721cb0ef41Sopenharmony_ci<li>Default: 15</li> 8731cb0ef41Sopenharmony_ci<li>Type: Number</li> 8741cb0ef41Sopenharmony_ci</ul> 8751cb0ef41Sopenharmony_ci<p>The maximum number of connections to use per origin (protocol/host/port 8761cb0ef41Sopenharmony_cicombination).</p> 8771cb0ef41Sopenharmony_ci<h4 id="message"><code>message</code></h4> 8781cb0ef41Sopenharmony_ci<ul> 8791cb0ef41Sopenharmony_ci<li>Default: "%s"</li> 8801cb0ef41Sopenharmony_ci<li>Type: String</li> 8811cb0ef41Sopenharmony_ci</ul> 8821cb0ef41Sopenharmony_ci<p>Commit message which is used by <code>npm version</code> when creating version commit.</p> 8831cb0ef41Sopenharmony_ci<p>Any "%s" in the message will be replaced with the version number.</p> 8841cb0ef41Sopenharmony_ci<h4 id="node-options"><code>node-options</code></h4> 8851cb0ef41Sopenharmony_ci<ul> 8861cb0ef41Sopenharmony_ci<li>Default: null</li> 8871cb0ef41Sopenharmony_ci<li>Type: null or String</li> 8881cb0ef41Sopenharmony_ci</ul> 8891cb0ef41Sopenharmony_ci<p>Options to pass through to Node.js via the <code>NODE_OPTIONS</code> environment 8901cb0ef41Sopenharmony_civariable. This does not impact how npm itself is executed but it does impact 8911cb0ef41Sopenharmony_cihow lifecycle scripts are called.</p> 8921cb0ef41Sopenharmony_ci<h4 id="noproxy"><code>noproxy</code></h4> 8931cb0ef41Sopenharmony_ci<ul> 8941cb0ef41Sopenharmony_ci<li>Default: The value of the NO_PROXY environment variable</li> 8951cb0ef41Sopenharmony_ci<li>Type: String (can be set multiple times)</li> 8961cb0ef41Sopenharmony_ci</ul> 8971cb0ef41Sopenharmony_ci<p>Domain extensions that should bypass any proxies.</p> 8981cb0ef41Sopenharmony_ci<p>Also accepts a comma-delimited string.</p> 8991cb0ef41Sopenharmony_ci<h4 id="offline"><code>offline</code></h4> 9001cb0ef41Sopenharmony_ci<ul> 9011cb0ef41Sopenharmony_ci<li>Default: false</li> 9021cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 9031cb0ef41Sopenharmony_ci</ul> 9041cb0ef41Sopenharmony_ci<p>Force offline mode: no network requests will be done during install. To 9051cb0ef41Sopenharmony_ciallow the CLI to fill in missing cache data, see <code>--prefer-offline</code>.</p> 9061cb0ef41Sopenharmony_ci<h4 id="omit"><code>omit</code></h4> 9071cb0ef41Sopenharmony_ci<ul> 9081cb0ef41Sopenharmony_ci<li>Default: 'dev' if the <code>NODE_ENV</code> environment variable is set to 9091cb0ef41Sopenharmony_ci'production', otherwise empty.</li> 9101cb0ef41Sopenharmony_ci<li>Type: "dev", "optional", or "peer" (can be set multiple times)</li> 9111cb0ef41Sopenharmony_ci</ul> 9121cb0ef41Sopenharmony_ci<p>Dependency types to omit from the installation tree on disk.</p> 9131cb0ef41Sopenharmony_ci<p>Note that these dependencies <em>are</em> still resolved and added to the 9141cb0ef41Sopenharmony_ci<code>package-lock.json</code> or <code>npm-shrinkwrap.json</code> file. They are just not 9151cb0ef41Sopenharmony_ciphysically installed on disk.</p> 9161cb0ef41Sopenharmony_ci<p>If a package type appears in both the <code>--include</code> and <code>--omit</code> lists, then 9171cb0ef41Sopenharmony_ciit will be included.</p> 9181cb0ef41Sopenharmony_ci<p>If the resulting omit list includes <code>'dev'</code>, then the <code>NODE_ENV</code> environment 9191cb0ef41Sopenharmony_civariable will be set to <code>'production'</code> for all lifecycle scripts.</p> 9201cb0ef41Sopenharmony_ci<h4 id="omit-lockfile-registry-resolved"><code>omit-lockfile-registry-resolved</code></h4> 9211cb0ef41Sopenharmony_ci<ul> 9221cb0ef41Sopenharmony_ci<li>Default: false</li> 9231cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 9241cb0ef41Sopenharmony_ci</ul> 9251cb0ef41Sopenharmony_ci<p>This option causes npm to create lock files without a <code>resolved</code> key for 9261cb0ef41Sopenharmony_ciregistry dependencies. Subsequent installs will need to resolve tarball 9271cb0ef41Sopenharmony_ciendpoints with the configured registry, likely resulting in a longer install 9281cb0ef41Sopenharmony_citime.</p> 9291cb0ef41Sopenharmony_ci<h4 id="os"><code>os</code></h4> 9301cb0ef41Sopenharmony_ci<ul> 9311cb0ef41Sopenharmony_ci<li>Default: null</li> 9321cb0ef41Sopenharmony_ci<li>Type: null or String</li> 9331cb0ef41Sopenharmony_ci</ul> 9341cb0ef41Sopenharmony_ci<p>Override OS of native modules to install. Acceptable values are same as <code>os</code> 9351cb0ef41Sopenharmony_cifield of package.json, which comes from <code>process.platform</code>.</p> 9361cb0ef41Sopenharmony_ci<h4 id="otp"><code>otp</code></h4> 9371cb0ef41Sopenharmony_ci<ul> 9381cb0ef41Sopenharmony_ci<li>Default: null</li> 9391cb0ef41Sopenharmony_ci<li>Type: null or String</li> 9401cb0ef41Sopenharmony_ci</ul> 9411cb0ef41Sopenharmony_ci<p>This is a one-time password from a two-factor authenticator. It's needed 9421cb0ef41Sopenharmony_ciwhen publishing or changing package permissions with <code>npm access</code>.</p> 9431cb0ef41Sopenharmony_ci<p>If not set, and a registry response fails with a challenge for a one-time 9441cb0ef41Sopenharmony_cipassword, npm will prompt on the command line for one.</p> 9451cb0ef41Sopenharmony_ci<h4 id="pack-destination"><code>pack-destination</code></h4> 9461cb0ef41Sopenharmony_ci<ul> 9471cb0ef41Sopenharmony_ci<li>Default: "."</li> 9481cb0ef41Sopenharmony_ci<li>Type: String</li> 9491cb0ef41Sopenharmony_ci</ul> 9501cb0ef41Sopenharmony_ci<p>Directory in which <code>npm pack</code> will save tarballs.</p> 9511cb0ef41Sopenharmony_ci<h4 id="package"><code>package</code></h4> 9521cb0ef41Sopenharmony_ci<ul> 9531cb0ef41Sopenharmony_ci<li>Default:</li> 9541cb0ef41Sopenharmony_ci<li>Type: String (can be set multiple times)</li> 9551cb0ef41Sopenharmony_ci</ul> 9561cb0ef41Sopenharmony_ci<p>The package or packages to install for <a href="../commands/npm-exec.html"><code>npm exec</code></a></p> 9571cb0ef41Sopenharmony_ci<h4 id="package-lock"><code>package-lock</code></h4> 9581cb0ef41Sopenharmony_ci<ul> 9591cb0ef41Sopenharmony_ci<li>Default: true</li> 9601cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 9611cb0ef41Sopenharmony_ci</ul> 9621cb0ef41Sopenharmony_ci<p>If set to false, then ignore <code>package-lock.json</code> files when installing. This 9631cb0ef41Sopenharmony_ciwill also prevent <em>writing</em> <code>package-lock.json</code> if <code>save</code> is true.</p> 9641cb0ef41Sopenharmony_ci<h4 id="package-lock-only"><code>package-lock-only</code></h4> 9651cb0ef41Sopenharmony_ci<ul> 9661cb0ef41Sopenharmony_ci<li>Default: false</li> 9671cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 9681cb0ef41Sopenharmony_ci</ul> 9691cb0ef41Sopenharmony_ci<p>If set to true, the current operation will only use the <code>package-lock.json</code>, 9701cb0ef41Sopenharmony_ciignoring <code>node_modules</code>.</p> 9711cb0ef41Sopenharmony_ci<p>For <code>update</code> this means only the <code>package-lock.json</code> will be updated, 9721cb0ef41Sopenharmony_ciinstead of checking <code>node_modules</code> and downloading dependencies.</p> 9731cb0ef41Sopenharmony_ci<p>For <code>list</code> this means the output will be based on the tree described by the 9741cb0ef41Sopenharmony_ci<code>package-lock.json</code>, rather than the contents of <code>node_modules</code>.</p> 9751cb0ef41Sopenharmony_ci<h4 id="parseable"><code>parseable</code></h4> 9761cb0ef41Sopenharmony_ci<ul> 9771cb0ef41Sopenharmony_ci<li>Default: false</li> 9781cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 9791cb0ef41Sopenharmony_ci</ul> 9801cb0ef41Sopenharmony_ci<p>Output parseable results from commands that write to standard output. For 9811cb0ef41Sopenharmony_ci<code>npm search</code>, this will be tab-separated table format.</p> 9821cb0ef41Sopenharmony_ci<h4 id="prefer-dedupe"><code>prefer-dedupe</code></h4> 9831cb0ef41Sopenharmony_ci<ul> 9841cb0ef41Sopenharmony_ci<li>Default: false</li> 9851cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 9861cb0ef41Sopenharmony_ci</ul> 9871cb0ef41Sopenharmony_ci<p>Prefer to deduplicate packages if possible, rather than choosing a newer 9881cb0ef41Sopenharmony_civersion of a dependency.</p> 9891cb0ef41Sopenharmony_ci<h4 id="prefer-offline"><code>prefer-offline</code></h4> 9901cb0ef41Sopenharmony_ci<ul> 9911cb0ef41Sopenharmony_ci<li>Default: false</li> 9921cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 9931cb0ef41Sopenharmony_ci</ul> 9941cb0ef41Sopenharmony_ci<p>If true, staleness checks for cached data will be bypassed, but missing data 9951cb0ef41Sopenharmony_ciwill be requested from the server. To force full offline mode, use 9961cb0ef41Sopenharmony_ci<code>--offline</code>.</p> 9971cb0ef41Sopenharmony_ci<h4 id="prefer-online"><code>prefer-online</code></h4> 9981cb0ef41Sopenharmony_ci<ul> 9991cb0ef41Sopenharmony_ci<li>Default: false</li> 10001cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 10011cb0ef41Sopenharmony_ci</ul> 10021cb0ef41Sopenharmony_ci<p>If true, staleness checks for cached data will be forced, making the CLI 10031cb0ef41Sopenharmony_cilook for updates immediately even for fresh package data.</p> 10041cb0ef41Sopenharmony_ci<h4 id="prefix"><code>prefix</code></h4> 10051cb0ef41Sopenharmony_ci<ul> 10061cb0ef41Sopenharmony_ci<li>Default: In global mode, the folder where the node executable is installed. 10071cb0ef41Sopenharmony_ciOtherwise, the nearest parent folder containing either a package.json file 10081cb0ef41Sopenharmony_cior a node_modules folder.</li> 10091cb0ef41Sopenharmony_ci<li>Type: Path</li> 10101cb0ef41Sopenharmony_ci</ul> 10111cb0ef41Sopenharmony_ci<p>The location to install global items. If set on the command line, then it 10121cb0ef41Sopenharmony_ciforces non-global commands to run in the specified folder.</p> 10131cb0ef41Sopenharmony_ci<h4 id="preid"><code>preid</code></h4> 10141cb0ef41Sopenharmony_ci<ul> 10151cb0ef41Sopenharmony_ci<li>Default: ""</li> 10161cb0ef41Sopenharmony_ci<li>Type: String</li> 10171cb0ef41Sopenharmony_ci</ul> 10181cb0ef41Sopenharmony_ci<p>The "prerelease identifier" to use as a prefix for the "prerelease" part of 10191cb0ef41Sopenharmony_cia semver. Like the <code>rc</code> in <code>1.2.0-rc.8</code>.</p> 10201cb0ef41Sopenharmony_ci<h4 id="progress"><code>progress</code></h4> 10211cb0ef41Sopenharmony_ci<ul> 10221cb0ef41Sopenharmony_ci<li>Default: <code>true</code> unless running in a known CI system</li> 10231cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 10241cb0ef41Sopenharmony_ci</ul> 10251cb0ef41Sopenharmony_ci<p>When set to <code>true</code>, npm will display a progress bar during time intensive 10261cb0ef41Sopenharmony_cioperations, if <code>process.stderr</code> is a TTY.</p> 10271cb0ef41Sopenharmony_ci<p>Set to <code>false</code> to suppress the progress bar.</p> 10281cb0ef41Sopenharmony_ci<h4 id="provenance"><code>provenance</code></h4> 10291cb0ef41Sopenharmony_ci<ul> 10301cb0ef41Sopenharmony_ci<li>Default: false</li> 10311cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 10321cb0ef41Sopenharmony_ci</ul> 10331cb0ef41Sopenharmony_ci<p>When publishing from a supported cloud CI/CD system, the package will be 10341cb0ef41Sopenharmony_cipublicly linked to where it was built and published from.</p> 10351cb0ef41Sopenharmony_ci<p>This config can not be used with: <code>provenance-file</code></p> 10361cb0ef41Sopenharmony_ci<h4 id="provenance-file"><code>provenance-file</code></h4> 10371cb0ef41Sopenharmony_ci<ul> 10381cb0ef41Sopenharmony_ci<li>Default: null</li> 10391cb0ef41Sopenharmony_ci<li>Type: Path</li> 10401cb0ef41Sopenharmony_ci</ul> 10411cb0ef41Sopenharmony_ci<p>When publishing, the provenance bundle at the given path will be used.</p> 10421cb0ef41Sopenharmony_ci<p>This config can not be used with: <code>provenance</code></p> 10431cb0ef41Sopenharmony_ci<h4 id="proxy"><code>proxy</code></h4> 10441cb0ef41Sopenharmony_ci<ul> 10451cb0ef41Sopenharmony_ci<li>Default: null</li> 10461cb0ef41Sopenharmony_ci<li>Type: null, false, or URL</li> 10471cb0ef41Sopenharmony_ci</ul> 10481cb0ef41Sopenharmony_ci<p>A proxy to use for outgoing http requests. If the <code>HTTP_PROXY</code> or 10491cb0ef41Sopenharmony_ci<code>http_proxy</code> environment variables are set, proxy settings will be honored 10501cb0ef41Sopenharmony_ciby the underlying <code>request</code> library.</p> 10511cb0ef41Sopenharmony_ci<h4 id="read-only"><code>read-only</code></h4> 10521cb0ef41Sopenharmony_ci<ul> 10531cb0ef41Sopenharmony_ci<li>Default: false</li> 10541cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 10551cb0ef41Sopenharmony_ci</ul> 10561cb0ef41Sopenharmony_ci<p>This is used to mark a token as unable to publish when configuring limited 10571cb0ef41Sopenharmony_ciaccess tokens with the <code>npm token create</code> command.</p> 10581cb0ef41Sopenharmony_ci<h4 id="rebuild-bundle"><code>rebuild-bundle</code></h4> 10591cb0ef41Sopenharmony_ci<ul> 10601cb0ef41Sopenharmony_ci<li>Default: true</li> 10611cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 10621cb0ef41Sopenharmony_ci</ul> 10631cb0ef41Sopenharmony_ci<p>Rebuild bundled dependencies after installation.</p> 10641cb0ef41Sopenharmony_ci<h4 id="registry"><code>registry</code></h4> 10651cb0ef41Sopenharmony_ci<ul> 10661cb0ef41Sopenharmony_ci<li>Default: "<a href="https://registry.npmjs.org/">https://registry.npmjs.org/</a>"</li> 10671cb0ef41Sopenharmony_ci<li>Type: URL</li> 10681cb0ef41Sopenharmony_ci</ul> 10691cb0ef41Sopenharmony_ci<p>The base URL of the npm registry.</p> 10701cb0ef41Sopenharmony_ci<h4 id="replace-registry-host"><code>replace-registry-host</code></h4> 10711cb0ef41Sopenharmony_ci<ul> 10721cb0ef41Sopenharmony_ci<li>Default: "npmjs"</li> 10731cb0ef41Sopenharmony_ci<li>Type: "npmjs", "never", "always", or String</li> 10741cb0ef41Sopenharmony_ci</ul> 10751cb0ef41Sopenharmony_ci<p>Defines behavior for replacing the registry host in a lockfile with the 10761cb0ef41Sopenharmony_ciconfigured registry.</p> 10771cb0ef41Sopenharmony_ci<p>The default behavior is to replace package dist URLs from the default 10781cb0ef41Sopenharmony_ciregistry (<a href="https://registry.npmjs.org">https://registry.npmjs.org</a>) to the configured registry. If set to 10791cb0ef41Sopenharmony_ci"never", then use the registry value. If set to "always", then replace the 10801cb0ef41Sopenharmony_ciregistry host with the configured host every time.</p> 10811cb0ef41Sopenharmony_ci<p>You may also specify a bare hostname (e.g., "registry.npmjs.org").</p> 10821cb0ef41Sopenharmony_ci<h4 id="save"><code>save</code></h4> 10831cb0ef41Sopenharmony_ci<ul> 10841cb0ef41Sopenharmony_ci<li>Default: <code>true</code> unless when using <code>npm update</code> where it defaults to <code>false</code></li> 10851cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 10861cb0ef41Sopenharmony_ci</ul> 10871cb0ef41Sopenharmony_ci<p>Save installed packages to a <code>package.json</code> file as dependencies.</p> 10881cb0ef41Sopenharmony_ci<p>When used with the <code>npm rm</code> command, removes the dependency from 10891cb0ef41Sopenharmony_ci<code>package.json</code>.</p> 10901cb0ef41Sopenharmony_ci<p>Will also prevent writing to <code>package-lock.json</code> if set to <code>false</code>.</p> 10911cb0ef41Sopenharmony_ci<h4 id="save-bundle"><code>save-bundle</code></h4> 10921cb0ef41Sopenharmony_ci<ul> 10931cb0ef41Sopenharmony_ci<li>Default: false</li> 10941cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 10951cb0ef41Sopenharmony_ci</ul> 10961cb0ef41Sopenharmony_ci<p>If a package would be saved at install time by the use of <code>--save</code>, 10971cb0ef41Sopenharmony_ci<code>--save-dev</code>, or <code>--save-optional</code>, then also put it in the 10981cb0ef41Sopenharmony_ci<code>bundleDependencies</code> list.</p> 10991cb0ef41Sopenharmony_ci<p>Ignored if <code>--save-peer</code> is set, since peerDependencies cannot be bundled.</p> 11001cb0ef41Sopenharmony_ci<h4 id="save-dev"><code>save-dev</code></h4> 11011cb0ef41Sopenharmony_ci<ul> 11021cb0ef41Sopenharmony_ci<li>Default: false</li> 11031cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 11041cb0ef41Sopenharmony_ci</ul> 11051cb0ef41Sopenharmony_ci<p>Save installed packages to a package.json file as <code>devDependencies</code>.</p> 11061cb0ef41Sopenharmony_ci<h4 id="save-exact"><code>save-exact</code></h4> 11071cb0ef41Sopenharmony_ci<ul> 11081cb0ef41Sopenharmony_ci<li>Default: false</li> 11091cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 11101cb0ef41Sopenharmony_ci</ul> 11111cb0ef41Sopenharmony_ci<p>Dependencies saved to package.json will be configured with an exact version 11121cb0ef41Sopenharmony_cirather than using npm's default semver range operator.</p> 11131cb0ef41Sopenharmony_ci<h4 id="save-optional"><code>save-optional</code></h4> 11141cb0ef41Sopenharmony_ci<ul> 11151cb0ef41Sopenharmony_ci<li>Default: false</li> 11161cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 11171cb0ef41Sopenharmony_ci</ul> 11181cb0ef41Sopenharmony_ci<p>Save installed packages to a package.json file as <code>optionalDependencies</code>.</p> 11191cb0ef41Sopenharmony_ci<h4 id="save-peer"><code>save-peer</code></h4> 11201cb0ef41Sopenharmony_ci<ul> 11211cb0ef41Sopenharmony_ci<li>Default: false</li> 11221cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 11231cb0ef41Sopenharmony_ci</ul> 11241cb0ef41Sopenharmony_ci<p>Save installed packages to a package.json file as <code>peerDependencies</code></p> 11251cb0ef41Sopenharmony_ci<h4 id="save-prefix"><code>save-prefix</code></h4> 11261cb0ef41Sopenharmony_ci<ul> 11271cb0ef41Sopenharmony_ci<li>Default: "^"</li> 11281cb0ef41Sopenharmony_ci<li>Type: String</li> 11291cb0ef41Sopenharmony_ci</ul> 11301cb0ef41Sopenharmony_ci<p>Configure how versions of packages installed to a package.json file via 11311cb0ef41Sopenharmony_ci<code>--save</code> or <code>--save-dev</code> get prefixed.</p> 11321cb0ef41Sopenharmony_ci<p>For example if a package has version <code>1.2.3</code>, by default its version is set 11331cb0ef41Sopenharmony_cito <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 11341cb0ef41Sopenharmony_cipatch upgrades.</p> 11351cb0ef41Sopenharmony_ci<h4 id="save-prod"><code>save-prod</code></h4> 11361cb0ef41Sopenharmony_ci<ul> 11371cb0ef41Sopenharmony_ci<li>Default: false</li> 11381cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 11391cb0ef41Sopenharmony_ci</ul> 11401cb0ef41Sopenharmony_ci<p>Save installed packages into <code>dependencies</code> specifically. This is useful if 11411cb0ef41Sopenharmony_cia package already exists in <code>devDependencies</code> or <code>optionalDependencies</code>, but 11421cb0ef41Sopenharmony_ciyou want to move it to be a non-optional production dependency.</p> 11431cb0ef41Sopenharmony_ci<p>This is the default behavior if <code>--save</code> is true, and neither <code>--save-dev</code> 11441cb0ef41Sopenharmony_cior <code>--save-optional</code> are true.</p> 11451cb0ef41Sopenharmony_ci<h4 id="sbom-format"><code>sbom-format</code></h4> 11461cb0ef41Sopenharmony_ci<ul> 11471cb0ef41Sopenharmony_ci<li>Default: null</li> 11481cb0ef41Sopenharmony_ci<li>Type: "cyclonedx" or "spdx"</li> 11491cb0ef41Sopenharmony_ci</ul> 11501cb0ef41Sopenharmony_ci<p>SBOM format to use when generating SBOMs.</p> 11511cb0ef41Sopenharmony_ci<h4 id="sbom-type"><code>sbom-type</code></h4> 11521cb0ef41Sopenharmony_ci<ul> 11531cb0ef41Sopenharmony_ci<li>Default: "library"</li> 11541cb0ef41Sopenharmony_ci<li>Type: "library", "application", or "framework"</li> 11551cb0ef41Sopenharmony_ci</ul> 11561cb0ef41Sopenharmony_ci<p>The type of package described by the generated SBOM. For SPDX, this is the 11571cb0ef41Sopenharmony_civalue for the <code>primaryPackagePurpose</code> field. For CycloneDX, this is the 11581cb0ef41Sopenharmony_civalue for the <code>type</code> field.</p> 11591cb0ef41Sopenharmony_ci<h4 id="scope"><code>scope</code></h4> 11601cb0ef41Sopenharmony_ci<ul> 11611cb0ef41Sopenharmony_ci<li>Default: the scope of the current project, if any, or ""</li> 11621cb0ef41Sopenharmony_ci<li>Type: String</li> 11631cb0ef41Sopenharmony_ci</ul> 11641cb0ef41Sopenharmony_ci<p>Associate an operation with a scope for a scoped registry.</p> 11651cb0ef41Sopenharmony_ci<p>Useful when logging in to or out of a private registry:</p> 11661cb0ef41Sopenharmony_ci<pre><code># log in, linking the scope to the custom registry 11671cb0ef41Sopenharmony_cinpm login --scope=@mycorp --registry=https://registry.mycorp.com 11681cb0ef41Sopenharmony_ci 11691cb0ef41Sopenharmony_ci# log out, removing the link and the auth token 11701cb0ef41Sopenharmony_cinpm logout --scope=@mycorp 11711cb0ef41Sopenharmony_ci</code></pre> 11721cb0ef41Sopenharmony_ci<p>This will cause <code>@mycorp</code> to be mapped to the registry for future 11731cb0ef41Sopenharmony_ciinstallation of packages specified according to the pattern 11741cb0ef41Sopenharmony_ci<code>@mycorp/package</code>.</p> 11751cb0ef41Sopenharmony_ci<p>This will also cause <code>npm init</code> to create a scoped package.</p> 11761cb0ef41Sopenharmony_ci<pre><code># accept all defaults, and create a package named "@foo/whatever", 11771cb0ef41Sopenharmony_ci# instead of just named "whatever" 11781cb0ef41Sopenharmony_cinpm init --scope=@foo --yes 11791cb0ef41Sopenharmony_ci</code></pre> 11801cb0ef41Sopenharmony_ci<h4 id="script-shell"><code>script-shell</code></h4> 11811cb0ef41Sopenharmony_ci<ul> 11821cb0ef41Sopenharmony_ci<li>Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows</li> 11831cb0ef41Sopenharmony_ci<li>Type: null or String</li> 11841cb0ef41Sopenharmony_ci</ul> 11851cb0ef41Sopenharmony_ci<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> 11861cb0ef41Sopenharmony_ci<h4 id="searchexclude"><code>searchexclude</code></h4> 11871cb0ef41Sopenharmony_ci<ul> 11881cb0ef41Sopenharmony_ci<li>Default: ""</li> 11891cb0ef41Sopenharmony_ci<li>Type: String</li> 11901cb0ef41Sopenharmony_ci</ul> 11911cb0ef41Sopenharmony_ci<p>Space-separated options that limit the results from search.</p> 11921cb0ef41Sopenharmony_ci<h4 id="searchlimit"><code>searchlimit</code></h4> 11931cb0ef41Sopenharmony_ci<ul> 11941cb0ef41Sopenharmony_ci<li>Default: 20</li> 11951cb0ef41Sopenharmony_ci<li>Type: Number</li> 11961cb0ef41Sopenharmony_ci</ul> 11971cb0ef41Sopenharmony_ci<p>Number of items to limit search results to. Will not apply at all to legacy 11981cb0ef41Sopenharmony_cisearches.</p> 11991cb0ef41Sopenharmony_ci<h4 id="searchopts"><code>searchopts</code></h4> 12001cb0ef41Sopenharmony_ci<ul> 12011cb0ef41Sopenharmony_ci<li>Default: ""</li> 12021cb0ef41Sopenharmony_ci<li>Type: String</li> 12031cb0ef41Sopenharmony_ci</ul> 12041cb0ef41Sopenharmony_ci<p>Space-separated options that are always passed to search.</p> 12051cb0ef41Sopenharmony_ci<h4 id="searchstaleness"><code>searchstaleness</code></h4> 12061cb0ef41Sopenharmony_ci<ul> 12071cb0ef41Sopenharmony_ci<li>Default: 900</li> 12081cb0ef41Sopenharmony_ci<li>Type: Number</li> 12091cb0ef41Sopenharmony_ci</ul> 12101cb0ef41Sopenharmony_ci<p>The age of the cache, in seconds, before another registry request is made if 12111cb0ef41Sopenharmony_ciusing legacy search endpoint.</p> 12121cb0ef41Sopenharmony_ci<h4 id="shell"><code>shell</code></h4> 12131cb0ef41Sopenharmony_ci<ul> 12141cb0ef41Sopenharmony_ci<li>Default: SHELL environment variable, or "bash" on Posix, or "cmd.exe" on 12151cb0ef41Sopenharmony_ciWindows</li> 12161cb0ef41Sopenharmony_ci<li>Type: String</li> 12171cb0ef41Sopenharmony_ci</ul> 12181cb0ef41Sopenharmony_ci<p>The shell to run for the <code>npm explore</code> command.</p> 12191cb0ef41Sopenharmony_ci<h4 id="sign-git-commit"><code>sign-git-commit</code></h4> 12201cb0ef41Sopenharmony_ci<ul> 12211cb0ef41Sopenharmony_ci<li>Default: false</li> 12221cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 12231cb0ef41Sopenharmony_ci</ul> 12241cb0ef41Sopenharmony_ci<p>If set to true, then the <code>npm version</code> command will commit the new package 12251cb0ef41Sopenharmony_civersion using <code>-S</code> to add a signature.</p> 12261cb0ef41Sopenharmony_ci<p>Note that git requires you to have set up GPG keys in your git configs for 12271cb0ef41Sopenharmony_cithis to work properly.</p> 12281cb0ef41Sopenharmony_ci<h4 id="sign-git-tag"><code>sign-git-tag</code></h4> 12291cb0ef41Sopenharmony_ci<ul> 12301cb0ef41Sopenharmony_ci<li>Default: false</li> 12311cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 12321cb0ef41Sopenharmony_ci</ul> 12331cb0ef41Sopenharmony_ci<p>If set to true, then the <code>npm version</code> command will tag the version using 12341cb0ef41Sopenharmony_ci<code>-s</code> to add a signature.</p> 12351cb0ef41Sopenharmony_ci<p>Note that git requires you to have set up GPG keys in your git configs for 12361cb0ef41Sopenharmony_cithis to work properly.</p> 12371cb0ef41Sopenharmony_ci<h4 id="strict-peer-deps"><code>strict-peer-deps</code></h4> 12381cb0ef41Sopenharmony_ci<ul> 12391cb0ef41Sopenharmony_ci<li>Default: false</li> 12401cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 12411cb0ef41Sopenharmony_ci</ul> 12421cb0ef41Sopenharmony_ci<p>If set to <code>true</code>, and <code>--legacy-peer-deps</code> is not set, then <em>any</em> 12431cb0ef41Sopenharmony_ciconflicting <code>peerDependencies</code> will be treated as an install failure, even 12441cb0ef41Sopenharmony_ciif npm could reasonably guess the appropriate resolution based on non-peer 12451cb0ef41Sopenharmony_cidependency relationships.</p> 12461cb0ef41Sopenharmony_ci<p>By default, conflicting <code>peerDependencies</code> deep in the dependency graph will 12471cb0ef41Sopenharmony_cibe resolved using the nearest non-peer dependency specification, even if 12481cb0ef41Sopenharmony_cidoing so will result in some packages receiving a peer dependency outside 12491cb0ef41Sopenharmony_cithe range set in their package's <code>peerDependencies</code> object.</p> 12501cb0ef41Sopenharmony_ci<p>When such an override is performed, a warning is printed, explaining the 12511cb0ef41Sopenharmony_ciconflict and the packages involved. If <code>--strict-peer-deps</code> is set, then 12521cb0ef41Sopenharmony_cithis warning is treated as a failure.</p> 12531cb0ef41Sopenharmony_ci<h4 id="strict-ssl"><code>strict-ssl</code></h4> 12541cb0ef41Sopenharmony_ci<ul> 12551cb0ef41Sopenharmony_ci<li>Default: true</li> 12561cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 12571cb0ef41Sopenharmony_ci</ul> 12581cb0ef41Sopenharmony_ci<p>Whether or not to do SSL key validation when making requests to the registry 12591cb0ef41Sopenharmony_civia https.</p> 12601cb0ef41Sopenharmony_ci<p>See also the <code>ca</code> config.</p> 12611cb0ef41Sopenharmony_ci<h4 id="tag"><code>tag</code></h4> 12621cb0ef41Sopenharmony_ci<ul> 12631cb0ef41Sopenharmony_ci<li>Default: "latest"</li> 12641cb0ef41Sopenharmony_ci<li>Type: String</li> 12651cb0ef41Sopenharmony_ci</ul> 12661cb0ef41Sopenharmony_ci<p>If you ask npm to install a package and don't tell it a specific version, 12671cb0ef41Sopenharmony_cithen it will install the specified tag.</p> 12681cb0ef41Sopenharmony_ci<p>Also the tag that is added to the package@version specified by the <code>npm tag</code> 12691cb0ef41Sopenharmony_cicommand, if no explicit tag is given.</p> 12701cb0ef41Sopenharmony_ci<p>When used by the <code>npm diff</code> command, this is the tag used to fetch the 12711cb0ef41Sopenharmony_citarball that will be compared with the local files by default.</p> 12721cb0ef41Sopenharmony_ci<h4 id="tag-version-prefix"><code>tag-version-prefix</code></h4> 12731cb0ef41Sopenharmony_ci<ul> 12741cb0ef41Sopenharmony_ci<li>Default: "v"</li> 12751cb0ef41Sopenharmony_ci<li>Type: String</li> 12761cb0ef41Sopenharmony_ci</ul> 12771cb0ef41Sopenharmony_ci<p>If set, alters the prefix used when tagging a new version when performing a 12781cb0ef41Sopenharmony_civersion increment using <code>npm version</code>. To remove the prefix altogether, set 12791cb0ef41Sopenharmony_ciit to the empty string: <code>""</code>.</p> 12801cb0ef41Sopenharmony_ci<p>Because other tools may rely on the convention that npm version tags look 12811cb0ef41Sopenharmony_cilike <code>v1.0.0</code>, <em>only use this property if it is absolutely necessary</em>. In 12821cb0ef41Sopenharmony_ciparticular, use care when overriding this setting for public packages.</p> 12831cb0ef41Sopenharmony_ci<h4 id="timing"><code>timing</code></h4> 12841cb0ef41Sopenharmony_ci<ul> 12851cb0ef41Sopenharmony_ci<li>Default: false</li> 12861cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 12871cb0ef41Sopenharmony_ci</ul> 12881cb0ef41Sopenharmony_ci<p>If true, writes timing information to a process specific json file in the 12891cb0ef41Sopenharmony_cicache or <code>logs-dir</code>. The file name ends with <code>-timing.json</code>.</p> 12901cb0ef41Sopenharmony_ci<p>You can quickly view it with this <a href="https://npm.im/json">json</a> command line: 12911cb0ef41Sopenharmony_ci<code>cat ~/.npm/_logs/*-timing.json | npm exec -- json -g</code>.</p> 12921cb0ef41Sopenharmony_ci<p>Timing information will also be reported in the terminal. To suppress this 12931cb0ef41Sopenharmony_ciwhile still writing the timing file, use <code>--silent</code>.</p> 12941cb0ef41Sopenharmony_ci<h4 id="umask"><code>umask</code></h4> 12951cb0ef41Sopenharmony_ci<ul> 12961cb0ef41Sopenharmony_ci<li>Default: 0</li> 12971cb0ef41Sopenharmony_ci<li>Type: Octal numeric string in range 0000..0777 (0..511)</li> 12981cb0ef41Sopenharmony_ci</ul> 12991cb0ef41Sopenharmony_ci<p>The "umask" value to use when setting the file creation mode on files and 13001cb0ef41Sopenharmony_cifolders.</p> 13011cb0ef41Sopenharmony_ci<p>Folders and executables are given a mode which is <code>0o777</code> masked against 13021cb0ef41Sopenharmony_cithis value. Other files are given a mode which is <code>0o666</code> masked against 13031cb0ef41Sopenharmony_cithis value.</p> 13041cb0ef41Sopenharmony_ci<p>Note that the underlying system will <em>also</em> apply its own umask value to 13051cb0ef41Sopenharmony_cifiles and folders that are created, and npm does not circumvent this, but 13061cb0ef41Sopenharmony_cirather adds the <code>--umask</code> config to it.</p> 13071cb0ef41Sopenharmony_ci<p>Thus, the effective default umask value on most POSIX systems is 0o22, 13081cb0ef41Sopenharmony_cimeaning that folders and executables are created with a mode of 0o755 and 13091cb0ef41Sopenharmony_ciother files are created with a mode of 0o644.</p> 13101cb0ef41Sopenharmony_ci<h4 id="unicode"><code>unicode</code></h4> 13111cb0ef41Sopenharmony_ci<ul> 13121cb0ef41Sopenharmony_ci<li>Default: false on windows, true on mac/unix systems with a unicode locale, 13131cb0ef41Sopenharmony_cias defined by the <code>LC_ALL</code>, <code>LC_CTYPE</code>, or <code>LANG</code> environment variables.</li> 13141cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 13151cb0ef41Sopenharmony_ci</ul> 13161cb0ef41Sopenharmony_ci<p>When set to true, npm uses unicode characters in the tree output. When 13171cb0ef41Sopenharmony_cifalse, it uses ascii characters instead of unicode glyphs.</p> 13181cb0ef41Sopenharmony_ci<h4 id="update-notifier"><code>update-notifier</code></h4> 13191cb0ef41Sopenharmony_ci<ul> 13201cb0ef41Sopenharmony_ci<li>Default: true</li> 13211cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 13221cb0ef41Sopenharmony_ci</ul> 13231cb0ef41Sopenharmony_ci<p>Set to false to suppress the update notification when using an older version 13241cb0ef41Sopenharmony_ciof npm than the latest.</p> 13251cb0ef41Sopenharmony_ci<h4 id="usage"><code>usage</code></h4> 13261cb0ef41Sopenharmony_ci<ul> 13271cb0ef41Sopenharmony_ci<li>Default: false</li> 13281cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 13291cb0ef41Sopenharmony_ci</ul> 13301cb0ef41Sopenharmony_ci<p>Show short usage output about the command specified.</p> 13311cb0ef41Sopenharmony_ci<h4 id="user-agent"><code>user-agent</code></h4> 13321cb0ef41Sopenharmony_ci<ul> 13331cb0ef41Sopenharmony_ci<li>Default: "npm/{npm-version} node/{node-version} {platform} {arch} 13341cb0ef41Sopenharmony_ciworkspaces/{workspaces} {ci}"</li> 13351cb0ef41Sopenharmony_ci<li>Type: String</li> 13361cb0ef41Sopenharmony_ci</ul> 13371cb0ef41Sopenharmony_ci<p>Sets the User-Agent request header. The following fields are replaced with 13381cb0ef41Sopenharmony_citheir actual counterparts:</p> 13391cb0ef41Sopenharmony_ci<ul> 13401cb0ef41Sopenharmony_ci<li><code>{npm-version}</code> - The npm version in use</li> 13411cb0ef41Sopenharmony_ci<li><code>{node-version}</code> - The Node.js version in use</li> 13421cb0ef41Sopenharmony_ci<li><code>{platform}</code> - The value of <code>process.platform</code></li> 13431cb0ef41Sopenharmony_ci<li><code>{arch}</code> - The value of <code>process.arch</code></li> 13441cb0ef41Sopenharmony_ci<li><code>{workspaces}</code> - Set to <code>true</code> if the <code>workspaces</code> or <code>workspace</code> options 13451cb0ef41Sopenharmony_ciare set.</li> 13461cb0ef41Sopenharmony_ci<li><code>{ci}</code> - The value of the <code>ci-name</code> config, if set, prefixed with <code>ci/</code>, or 13471cb0ef41Sopenharmony_cian empty string if <code>ci-name</code> is empty.</li> 13481cb0ef41Sopenharmony_ci</ul> 13491cb0ef41Sopenharmony_ci<h4 id="userconfig"><code>userconfig</code></h4> 13501cb0ef41Sopenharmony_ci<ul> 13511cb0ef41Sopenharmony_ci<li>Default: "~/.npmrc"</li> 13521cb0ef41Sopenharmony_ci<li>Type: Path</li> 13531cb0ef41Sopenharmony_ci</ul> 13541cb0ef41Sopenharmony_ci<p>The location of user-level configuration settings.</p> 13551cb0ef41Sopenharmony_ci<p>This may be overridden by the <code>npm_config_userconfig</code> environment variable 13561cb0ef41Sopenharmony_cior the <code>--userconfig</code> command line option, but may <em>not</em> be overridden by 13571cb0ef41Sopenharmony_cisettings in the <code>globalconfig</code> file.</p> 13581cb0ef41Sopenharmony_ci<h4 id="version"><code>version</code></h4> 13591cb0ef41Sopenharmony_ci<ul> 13601cb0ef41Sopenharmony_ci<li>Default: false</li> 13611cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 13621cb0ef41Sopenharmony_ci</ul> 13631cb0ef41Sopenharmony_ci<p>If true, output the npm version and exit successfully.</p> 13641cb0ef41Sopenharmony_ci<p>Only relevant when specified explicitly on the command line.</p> 13651cb0ef41Sopenharmony_ci<h4 id="versions"><code>versions</code></h4> 13661cb0ef41Sopenharmony_ci<ul> 13671cb0ef41Sopenharmony_ci<li>Default: false</li> 13681cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 13691cb0ef41Sopenharmony_ci</ul> 13701cb0ef41Sopenharmony_ci<p>If true, output the npm version as well as node's <code>process.versions</code> map and 13711cb0ef41Sopenharmony_cithe version in the current working directory's <code>package.json</code> file if one 13721cb0ef41Sopenharmony_ciexists, and exit successfully.</p> 13731cb0ef41Sopenharmony_ci<p>Only relevant when specified explicitly on the command line.</p> 13741cb0ef41Sopenharmony_ci<h4 id="viewer"><code>viewer</code></h4> 13751cb0ef41Sopenharmony_ci<ul> 13761cb0ef41Sopenharmony_ci<li>Default: "man" on Posix, "browser" on Windows</li> 13771cb0ef41Sopenharmony_ci<li>Type: String</li> 13781cb0ef41Sopenharmony_ci</ul> 13791cb0ef41Sopenharmony_ci<p>The program to use to view help content.</p> 13801cb0ef41Sopenharmony_ci<p>Set to <code>"browser"</code> to view html help content in the default web browser.</p> 13811cb0ef41Sopenharmony_ci<h4 id="which"><code>which</code></h4> 13821cb0ef41Sopenharmony_ci<ul> 13831cb0ef41Sopenharmony_ci<li>Default: null</li> 13841cb0ef41Sopenharmony_ci<li>Type: null or Number</li> 13851cb0ef41Sopenharmony_ci</ul> 13861cb0ef41Sopenharmony_ci<p>If there are multiple funding sources, which 1-indexed source URL to open.</p> 13871cb0ef41Sopenharmony_ci<h4 id="workspace"><code>workspace</code></h4> 13881cb0ef41Sopenharmony_ci<ul> 13891cb0ef41Sopenharmony_ci<li>Default:</li> 13901cb0ef41Sopenharmony_ci<li>Type: String (can be set multiple times)</li> 13911cb0ef41Sopenharmony_ci</ul> 13921cb0ef41Sopenharmony_ci<p>Enable running a command in the context of the configured workspaces of the 13931cb0ef41Sopenharmony_cicurrent project while filtering by running only the workspaces defined by 13941cb0ef41Sopenharmony_cithis configuration option.</p> 13951cb0ef41Sopenharmony_ci<p>Valid values for the <code>workspace</code> config are either:</p> 13961cb0ef41Sopenharmony_ci<ul> 13971cb0ef41Sopenharmony_ci<li>Workspace names</li> 13981cb0ef41Sopenharmony_ci<li>Path to a workspace directory</li> 13991cb0ef41Sopenharmony_ci<li>Path to a parent workspace directory (will result in selecting all 14001cb0ef41Sopenharmony_ciworkspaces within that folder)</li> 14011cb0ef41Sopenharmony_ci</ul> 14021cb0ef41Sopenharmony_ci<p>When set for the <code>npm init</code> command, this may be set to the folder of a 14031cb0ef41Sopenharmony_ciworkspace which does not yet exist, to create the folder and set it up as a 14041cb0ef41Sopenharmony_cibrand new workspace within the project.</p> 14051cb0ef41Sopenharmony_ci<p>This value is not exported to the environment for child processes.</p> 14061cb0ef41Sopenharmony_ci<h4 id="workspaces"><code>workspaces</code></h4> 14071cb0ef41Sopenharmony_ci<ul> 14081cb0ef41Sopenharmony_ci<li>Default: null</li> 14091cb0ef41Sopenharmony_ci<li>Type: null or Boolean</li> 14101cb0ef41Sopenharmony_ci</ul> 14111cb0ef41Sopenharmony_ci<p>Set to true to run the command in the context of <strong>all</strong> configured 14121cb0ef41Sopenharmony_ciworkspaces.</p> 14131cb0ef41Sopenharmony_ci<p>Explicitly setting this to false will cause commands like <code>install</code> to 14141cb0ef41Sopenharmony_ciignore workspaces altogether. When not set explicitly:</p> 14151cb0ef41Sopenharmony_ci<ul> 14161cb0ef41Sopenharmony_ci<li>Commands that operate on the <code>node_modules</code> tree (install, update, etc.) 14171cb0ef41Sopenharmony_ciwill link workspaces into the <code>node_modules</code> folder. - Commands that do 14181cb0ef41Sopenharmony_ciother things (test, exec, publish, etc.) will operate on the root project, 14191cb0ef41Sopenharmony_ci<em>unless</em> one or more workspaces are specified in the <code>workspace</code> config.</li> 14201cb0ef41Sopenharmony_ci</ul> 14211cb0ef41Sopenharmony_ci<p>This value is not exported to the environment for child processes.</p> 14221cb0ef41Sopenharmony_ci<h4 id="workspaces-update"><code>workspaces-update</code></h4> 14231cb0ef41Sopenharmony_ci<ul> 14241cb0ef41Sopenharmony_ci<li>Default: true</li> 14251cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 14261cb0ef41Sopenharmony_ci</ul> 14271cb0ef41Sopenharmony_ci<p>If set to true, the npm cli will run an update after operations that may 14281cb0ef41Sopenharmony_cipossibly change the workspaces installed to the <code>node_modules</code> folder.</p> 14291cb0ef41Sopenharmony_ci<h4 id="yes"><code>yes</code></h4> 14301cb0ef41Sopenharmony_ci<ul> 14311cb0ef41Sopenharmony_ci<li>Default: null</li> 14321cb0ef41Sopenharmony_ci<li>Type: null or Boolean</li> 14331cb0ef41Sopenharmony_ci</ul> 14341cb0ef41Sopenharmony_ci<p>Automatically answer "yes" to any prompts that npm might print on the 14351cb0ef41Sopenharmony_cicommand line.</p> 14361cb0ef41Sopenharmony_ci<h4 id="also"><code>also</code></h4> 14371cb0ef41Sopenharmony_ci<ul> 14381cb0ef41Sopenharmony_ci<li>Default: null</li> 14391cb0ef41Sopenharmony_ci<li>Type: null, "dev", or "development"</li> 14401cb0ef41Sopenharmony_ci<li>DEPRECATED: Please use --include=dev instead.</li> 14411cb0ef41Sopenharmony_ci</ul> 14421cb0ef41Sopenharmony_ci<p>When set to <code>dev</code> or <code>development</code>, this is an alias for <code>--include=dev</code>.</p> 14431cb0ef41Sopenharmony_ci<h4 id="cache-max"><code>cache-max</code></h4> 14441cb0ef41Sopenharmony_ci<ul> 14451cb0ef41Sopenharmony_ci<li>Default: Infinity</li> 14461cb0ef41Sopenharmony_ci<li>Type: Number</li> 14471cb0ef41Sopenharmony_ci<li>DEPRECATED: This option has been deprecated in favor of <code>--prefer-online</code></li> 14481cb0ef41Sopenharmony_ci</ul> 14491cb0ef41Sopenharmony_ci<p><code>--cache-max=0</code> is an alias for <code>--prefer-online</code></p> 14501cb0ef41Sopenharmony_ci<h4 id="cache-min"><code>cache-min</code></h4> 14511cb0ef41Sopenharmony_ci<ul> 14521cb0ef41Sopenharmony_ci<li>Default: 0</li> 14531cb0ef41Sopenharmony_ci<li>Type: Number</li> 14541cb0ef41Sopenharmony_ci<li>DEPRECATED: This option has been deprecated in favor of <code>--prefer-offline</code>.</li> 14551cb0ef41Sopenharmony_ci</ul> 14561cb0ef41Sopenharmony_ci<p><code>--cache-min=9999 (or bigger)</code> is an alias for <code>--prefer-offline</code>.</p> 14571cb0ef41Sopenharmony_ci<h4 id="cert"><code>cert</code></h4> 14581cb0ef41Sopenharmony_ci<ul> 14591cb0ef41Sopenharmony_ci<li>Default: null</li> 14601cb0ef41Sopenharmony_ci<li>Type: null or String</li> 14611cb0ef41Sopenharmony_ci<li>DEPRECATED: <code>key</code> and <code>cert</code> are no longer used for most registry 14621cb0ef41Sopenharmony_cioperations. Use registry scoped <code>keyfile</code> and <code>certfile</code> instead. Example: 14631cb0ef41Sopenharmony_ci//other-registry.tld/:keyfile=/path/to/key.pem 14641cb0ef41Sopenharmony_ci//other-registry.tld/:certfile=/path/to/cert.crt</li> 14651cb0ef41Sopenharmony_ci</ul> 14661cb0ef41Sopenharmony_ci<p>A client certificate to pass when accessing the registry. Values should be 14671cb0ef41Sopenharmony_ciin PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with 14681cb0ef41Sopenharmony_cinewlines replaced by the string "\n". For example:</p> 14691cb0ef41Sopenharmony_ci<pre><code class="language-ini">cert="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----" 14701cb0ef41Sopenharmony_ci</code></pre> 14711cb0ef41Sopenharmony_ci<p>It is <em>not</em> the path to a certificate file, though you can set a 14721cb0ef41Sopenharmony_ciregistry-scoped "certfile" path like 14731cb0ef41Sopenharmony_ci"//other-registry.tld/:certfile=/path/to/cert.pem".</p> 14741cb0ef41Sopenharmony_ci<h4 id="dev"><code>dev</code></h4> 14751cb0ef41Sopenharmony_ci<ul> 14761cb0ef41Sopenharmony_ci<li>Default: false</li> 14771cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 14781cb0ef41Sopenharmony_ci<li>DEPRECATED: Please use --include=dev instead.</li> 14791cb0ef41Sopenharmony_ci</ul> 14801cb0ef41Sopenharmony_ci<p>Alias for <code>--include=dev</code>.</p> 14811cb0ef41Sopenharmony_ci<h4 id="global-style"><code>global-style</code></h4> 14821cb0ef41Sopenharmony_ci<ul> 14831cb0ef41Sopenharmony_ci<li>Default: false</li> 14841cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 14851cb0ef41Sopenharmony_ci<li>DEPRECATED: This option has been deprecated in favor of 14861cb0ef41Sopenharmony_ci<code>--install-strategy=shallow</code></li> 14871cb0ef41Sopenharmony_ci</ul> 14881cb0ef41Sopenharmony_ci<p>Only install direct dependencies in the top level <code>node_modules</code>, but hoist 14891cb0ef41Sopenharmony_cion deeper dependencies. Sets <code>--install-strategy=shallow</code>.</p> 14901cb0ef41Sopenharmony_ci<h4 id="initauthoremail"><code>init.author.email</code></h4> 14911cb0ef41Sopenharmony_ci<ul> 14921cb0ef41Sopenharmony_ci<li>Default: ""</li> 14931cb0ef41Sopenharmony_ci<li>Type: String</li> 14941cb0ef41Sopenharmony_ci<li>DEPRECATED: Use <code>--init-author-email</code> instead.</li> 14951cb0ef41Sopenharmony_ci</ul> 14961cb0ef41Sopenharmony_ci<p>Alias for <code>--init-author-email</code></p> 14971cb0ef41Sopenharmony_ci<h4 id="initauthorname"><code>init.author.name</code></h4> 14981cb0ef41Sopenharmony_ci<ul> 14991cb0ef41Sopenharmony_ci<li>Default: ""</li> 15001cb0ef41Sopenharmony_ci<li>Type: String</li> 15011cb0ef41Sopenharmony_ci<li>DEPRECATED: Use <code>--init-author-name</code> instead.</li> 15021cb0ef41Sopenharmony_ci</ul> 15031cb0ef41Sopenharmony_ci<p>Alias for <code>--init-author-name</code></p> 15041cb0ef41Sopenharmony_ci<h4 id="initauthorurl"><code>init.author.url</code></h4> 15051cb0ef41Sopenharmony_ci<ul> 15061cb0ef41Sopenharmony_ci<li>Default: ""</li> 15071cb0ef41Sopenharmony_ci<li>Type: "" or URL</li> 15081cb0ef41Sopenharmony_ci<li>DEPRECATED: Use <code>--init-author-url</code> instead.</li> 15091cb0ef41Sopenharmony_ci</ul> 15101cb0ef41Sopenharmony_ci<p>Alias for <code>--init-author-url</code></p> 15111cb0ef41Sopenharmony_ci<h4 id="initlicense"><code>init.license</code></h4> 15121cb0ef41Sopenharmony_ci<ul> 15131cb0ef41Sopenharmony_ci<li>Default: "ISC"</li> 15141cb0ef41Sopenharmony_ci<li>Type: String</li> 15151cb0ef41Sopenharmony_ci<li>DEPRECATED: Use <code>--init-license</code> instead.</li> 15161cb0ef41Sopenharmony_ci</ul> 15171cb0ef41Sopenharmony_ci<p>Alias for <code>--init-license</code></p> 15181cb0ef41Sopenharmony_ci<h4 id="initmodule"><code>init.module</code></h4> 15191cb0ef41Sopenharmony_ci<ul> 15201cb0ef41Sopenharmony_ci<li>Default: "~/.npm-init.js"</li> 15211cb0ef41Sopenharmony_ci<li>Type: Path</li> 15221cb0ef41Sopenharmony_ci<li>DEPRECATED: Use <code>--init-module</code> instead.</li> 15231cb0ef41Sopenharmony_ci</ul> 15241cb0ef41Sopenharmony_ci<p>Alias for <code>--init-module</code></p> 15251cb0ef41Sopenharmony_ci<h4 id="initversion"><code>init.version</code></h4> 15261cb0ef41Sopenharmony_ci<ul> 15271cb0ef41Sopenharmony_ci<li>Default: "1.0.0"</li> 15281cb0ef41Sopenharmony_ci<li>Type: SemVer string</li> 15291cb0ef41Sopenharmony_ci<li>DEPRECATED: Use <code>--init-version</code> instead.</li> 15301cb0ef41Sopenharmony_ci</ul> 15311cb0ef41Sopenharmony_ci<p>Alias for <code>--init-version</code></p> 15321cb0ef41Sopenharmony_ci<h4 id="key"><code>key</code></h4> 15331cb0ef41Sopenharmony_ci<ul> 15341cb0ef41Sopenharmony_ci<li>Default: null</li> 15351cb0ef41Sopenharmony_ci<li>Type: null or String</li> 15361cb0ef41Sopenharmony_ci<li>DEPRECATED: <code>key</code> and <code>cert</code> are no longer used for most registry 15371cb0ef41Sopenharmony_cioperations. Use registry scoped <code>keyfile</code> and <code>certfile</code> instead. Example: 15381cb0ef41Sopenharmony_ci//other-registry.tld/:keyfile=/path/to/key.pem 15391cb0ef41Sopenharmony_ci//other-registry.tld/:certfile=/path/to/cert.crt</li> 15401cb0ef41Sopenharmony_ci</ul> 15411cb0ef41Sopenharmony_ci<p>A client key to pass when accessing the registry. Values should be in PEM 15421cb0ef41Sopenharmony_ciformat with newlines replaced by the string "\n". For example:</p> 15431cb0ef41Sopenharmony_ci<pre><code class="language-ini">key="-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----" 15441cb0ef41Sopenharmony_ci</code></pre> 15451cb0ef41Sopenharmony_ci<p>It is <em>not</em> the path to a key file, though you can set a registry-scoped 15461cb0ef41Sopenharmony_ci"keyfile" path like "//other-registry.tld/:keyfile=/path/to/key.pem".</p> 15471cb0ef41Sopenharmony_ci<h4 id="legacy-bundling"><code>legacy-bundling</code></h4> 15481cb0ef41Sopenharmony_ci<ul> 15491cb0ef41Sopenharmony_ci<li>Default: false</li> 15501cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 15511cb0ef41Sopenharmony_ci<li>DEPRECATED: This option has been deprecated in favor of 15521cb0ef41Sopenharmony_ci<code>--install-strategy=nested</code></li> 15531cb0ef41Sopenharmony_ci</ul> 15541cb0ef41Sopenharmony_ci<p>Instead of hoisting package installs in <code>node_modules</code>, install packages in 15551cb0ef41Sopenharmony_cithe same manner that they are depended on. This may cause very deep 15561cb0ef41Sopenharmony_cidirectory structures and duplicate package installs as there is no 15571cb0ef41Sopenharmony_cide-duplicating. Sets <code>--install-strategy=nested</code>.</p> 15581cb0ef41Sopenharmony_ci<h4 id="only"><code>only</code></h4> 15591cb0ef41Sopenharmony_ci<ul> 15601cb0ef41Sopenharmony_ci<li>Default: null</li> 15611cb0ef41Sopenharmony_ci<li>Type: null, "prod", or "production"</li> 15621cb0ef41Sopenharmony_ci<li>DEPRECATED: Use <code>--omit=dev</code> to omit dev dependencies from the install.</li> 15631cb0ef41Sopenharmony_ci</ul> 15641cb0ef41Sopenharmony_ci<p>When set to <code>prod</code> or <code>production</code>, this is an alias for <code>--omit=dev</code>.</p> 15651cb0ef41Sopenharmony_ci<h4 id="optional"><code>optional</code></h4> 15661cb0ef41Sopenharmony_ci<ul> 15671cb0ef41Sopenharmony_ci<li>Default: null</li> 15681cb0ef41Sopenharmony_ci<li>Type: null or Boolean</li> 15691cb0ef41Sopenharmony_ci<li>DEPRECATED: Use <code>--omit=optional</code> to exclude optional dependencies, or 15701cb0ef41Sopenharmony_ci<code>--include=optional</code> to include them.</li> 15711cb0ef41Sopenharmony_ci</ul> 15721cb0ef41Sopenharmony_ci<p>Default value does install optional deps unless otherwise omitted.</p> 15731cb0ef41Sopenharmony_ci<p>Alias for --include=optional or --omit=optional</p> 15741cb0ef41Sopenharmony_ci<h4 id="production"><code>production</code></h4> 15751cb0ef41Sopenharmony_ci<ul> 15761cb0ef41Sopenharmony_ci<li>Default: null</li> 15771cb0ef41Sopenharmony_ci<li>Type: null or Boolean</li> 15781cb0ef41Sopenharmony_ci<li>DEPRECATED: Use <code>--omit=dev</code> instead.</li> 15791cb0ef41Sopenharmony_ci</ul> 15801cb0ef41Sopenharmony_ci<p>Alias for <code>--omit=dev</code></p> 15811cb0ef41Sopenharmony_ci<h4 id="shrinkwrap"><code>shrinkwrap</code></h4> 15821cb0ef41Sopenharmony_ci<ul> 15831cb0ef41Sopenharmony_ci<li>Default: true</li> 15841cb0ef41Sopenharmony_ci<li>Type: Boolean</li> 15851cb0ef41Sopenharmony_ci<li>DEPRECATED: Use the --package-lock setting instead.</li> 15861cb0ef41Sopenharmony_ci</ul> 15871cb0ef41Sopenharmony_ci<p>Alias for --package-lock</p> 15881cb0ef41Sopenharmony_ci<h3 id="see-also">See also</h3> 15891cb0ef41Sopenharmony_ci<ul> 15901cb0ef41Sopenharmony_ci<li><a href="../commands/npm-config.html">npm config</a></li> 15911cb0ef41Sopenharmony_ci<li><a href="../configuring-npm/npmrc.html">npmrc</a></li> 15921cb0ef41Sopenharmony_ci<li><a href="../using-npm/scripts.html">npm scripts</a></li> 15931cb0ef41Sopenharmony_ci<li><a href="../configuring-npm/folders.html">npm folders</a></li> 15941cb0ef41Sopenharmony_ci<li><a href="../commands/npm.html">npm</a></li> 15951cb0ef41Sopenharmony_ci</ul></div> 15961cb0ef41Sopenharmony_ci 15971cb0ef41Sopenharmony_ci<footer id="edit"> 15981cb0ef41Sopenharmony_ci<a href="https://github.com/npm/cli/edit/latest/docs/content/using-npm/config.md"> 15991cb0ef41Sopenharmony_ci<svg role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentcolor" style="vertical-align: text-bottom; margin-right: 0.3em;"> 16001cb0ef41Sopenharmony_ci<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> 16011cb0ef41Sopenharmony_ci</svg> 16021cb0ef41Sopenharmony_ciEdit this page on GitHub 16031cb0ef41Sopenharmony_ci</a> 16041cb0ef41Sopenharmony_ci</footer> 16051cb0ef41Sopenharmony_ci</section> 16061cb0ef41Sopenharmony_ci 16071cb0ef41Sopenharmony_ci 16081cb0ef41Sopenharmony_ci 16091cb0ef41Sopenharmony_ci</body></html>