codekingpro/portable-devtools
115k
1<!DOCTYPE html><html><head>
2<meta charset="utf-8">
3<title>Config</title>
4<style>
5body {
6 background-color: #ffffff;
7 color: #24292e;
8
9 margin: 0;
10
11 line-height: 1.5;
12
13 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
14}
15#rainbar {
16 height: 10px;
17 background-image: linear-gradient(139deg, #fb8817, #ff4b01, #c12127, #e02aff);
18}
19
20a {
21 text-decoration: none;
22 color: #0366d6;
23}
24a:hover {
25 text-decoration: underline;
26}
27
28pre {
29 margin: 1em 0px;
30 padding: 1em;
31 border: solid 1px #e1e4e8;
32 border-radius: 6px;
33
34 display: block;
35 overflow: auto;
36
37 white-space: pre;
38
39 background-color: #f6f8fa;
40 color: #393a34;
41}
42code {
43 font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
44 font-size: 85%;
45 padding: 0.2em 0.4em;
46 background-color: #f6f8fa;
47 color: #393a34;
48}
49pre > code {
50 padding: 0;
51 background-color: inherit;
52 color: inherit;
53}
54h1, h2, h3 {
55 font-weight: 600;
56}
57
58#logobar {
59 background-color: #333333;
60 margin: 0 auto;
61 padding: 1em 4em;
62}
63#logobar .logo {
64 float: left;
65}
66#logobar .title {
67 font-weight: 600;
68 color: #dddddd;
69 float: left;
70 margin: 5px 0 0 1em;
71}
72#logobar:after {
73 content: "";
74 display: block;
75 clear: both;
76}
77
78#content {
79 margin: 0 auto;
80 padding: 0 4em;
81}
82
83#table_of_contents > h2 {
84 font-size: 1.17em;
85}
86#table_of_contents ul:first-child {
87 border: solid 1px #e1e4e8;
88 border-radius: 6px;
89 padding: 1em;
90 background-color: #f6f8fa;
91 color: #393a34;
92}
93#table_of_contents ul {
94 list-style-type: none;
95 padding-left: 1.5em;
96}
97#table_of_contents li {
98 font-size: 0.9em;
99}
100#table_of_contents li a {
101 color: #000000;
102}
103
104header.title {
105 border-bottom: solid 1px #e1e4e8;
106}
107header.title > h1 {
108 margin-bottom: 0.25em;
109}
110header.title > .description {
111 display: block;
112 margin-bottom: 0.5em;
113 line-height: 1;
114}
115
116header.title .version {
117 font-size: 0.8em;
118 color: #666666;
119}
120
121footer#edit {
122 border-top: solid 1px #e1e4e8;
123 margin: 3em 0 4em 0;
124 padding-top: 2em;
125}
126
127table {
128 width: 100%;
129 margin: 1em 0;
130 border-radius: 6px;
131 border: 1px solid #e1e4e8;
132 overflow: hidden;
133 border-collapse: separate;
134 border-spacing: 0;
135}
136
137table thead {
138 background-color: #f6f8fa;
139}
140
141table tbody {
142 background-color: #ffffff;
143}
144
145table th,
146table td {
147 padding: 0.75em;
148 text-align: left;
149 border-right: 1px solid #e1e4e8;
150 border-bottom: 1px solid #e1e4e8;
151}
152
153table th:last-child,
154table td:last-child {
155 border-right: none;
156}
157
158table tbody tr:last-child td {
159 border-bottom: none;
160}
161
162table th {
163 font-weight: 600;
164 background-color: #f6f8fa;
165}
166
167table code {
168 white-space: nowrap;
169}
170
171</style>
172</head>
173<body>
174<div id="banner">
175<div id="rainbar"></div>
176<div id="logobar">
177<svg class="logo" role="img" height="32" width="32" viewBox="0 0 700 700">
178<polygon fill="#cb0000" points="0,700 700,700 700,0 0,0"></polygon>
179<polygon fill="#ffffff" points="150,550 350,550 350,250 450,250 450,550 550,550 550,150 150,150"></polygon>
180</svg>
181<div class="title">
182npm command-line interface
183</div>
184</div>
185</div>
186
187<section id="content">
188<header class="title">
189<h1 id="----config----11130">
190 <span>Config</span>
191 <span class="version">@11.13.0</span>
192</h1>
193<span class="description">About npm configuration</span>
194</header>
195
196<section id="table_of_contents">
197<h2 id="table-of-contents">Table of contents</h2>
198<div id="_table_of_contents"><ul><li><a href="#description">Description</a></li><ul><li><a href="#command-line-flags">Command Line Flags</a></li><li><a href="#environment-variables">Environment Variables</a></li><li><a href="#npmrc-files">npmrc Files</a></li><li><a href="#default-configs">Default Configs</a></li></ul><li><a href="#shorthands-and-other-cli-niceties">Shorthands and Other CLI Niceties</a></li><li><a href="#config-settings">Config Settings</a></li><ul><li><a href="#auth"><code>_auth</code></a></li><li><a href="#access"><code>access</code></a></li><li><a href="#all"><code>all</code></a></li><li><a href="#allow-git"><code>allow-git</code></a></li><li><a href="#allow-same-version"><code>allow-same-version</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#audit-level"><code>audit-level</code></a></li><li><a href="#auth-type"><code>auth-type</code></a></li><li><a href="#before"><code>before</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#browser"><code>browser</code></a></li><li><a href="#bypass-2fa"><code>bypass-2fa</code></a></li><li><a href="#ca"><code>ca</code></a></li><li><a href="#cache"><code>cache</code></a></li><li><a href="#cafile"><code>cafile</code></a></li><li><a href="#call"><code>call</code></a></li><li><a href="#cidr"><code>cidr</code></a></li><li><a href="#color"><code>color</code></a></li><li><a href="#commit-hooks"><code>commit-hooks</code></a></li><li><a href="#cpu"><code>cpu</code></a></li><li><a href="#depth"><code>depth</code></a></li><li><a href="#description2"><code>description</code></a></li><li><a href="#diff"><code>diff</code></a></li><li><a href="#diff-dst-prefix"><code>diff-dst-prefix</code></a></li><li><a href="#diff-ignore-all-space"><code>diff-ignore-all-space</code></a></li><li><a href="#diff-name-only"><code>diff-name-only</code></a></li><li><a href="#diff-no-prefix"><code>diff-no-prefix</code></a></li><li><a href="#diff-src-prefix"><code>diff-src-prefix</code></a></li><li><a href="#diff-text"><code>diff-text</code></a></li><li><a href="#diff-unified"><code>diff-unified</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#editor"><code>editor</code></a></li><li><a href="#engine-strict"><code>engine-strict</code></a></li><li><a href="#expect-result-count"><code>expect-result-count</code></a></li><li><a href="#expect-results"><code>expect-results</code></a></li><li><a href="#expires"><code>expires</code></a></li><li><a href="#fetch-retries"><code>fetch-retries</code></a></li><li><a href="#fetch-retry-factor"><code>fetch-retry-factor</code></a></li><li><a href="#fetch-retry-maxtimeout"><code>fetch-retry-maxtimeout</code></a></li><li><a href="#fetch-retry-mintimeout"><code>fetch-retry-mintimeout</code></a></li><li><a href="#fetch-timeout"><code>fetch-timeout</code></a></li><li><a href="#force"><code>force</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#format-package-lock"><code>format-package-lock</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#git"><code>git</code></a></li><li><a href="#git-tag-version"><code>git-tag-version</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#globalconfig"><code>globalconfig</code></a></li><li><a href="#heading"><code>heading</code></a></li><li><a href="#https-proxy"><code>https-proxy</code></a></li><li><a href="#if-present"><code>if-present</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#include"><code>include</code></a></li><li><a href="#include-attestations"><code>include-attestations</code></a></li><li><a href="#include-staged"><code>include-staged</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#init-author-email"><code>init-author-email</code></a></li><li><a href="#init-author-name"><code>init-author-name</code></a></li><li><a href="#init-author-url"><code>init-author-url</code></a></li><li><a href="#init-license"><code>init-license</code></a></li><li><a href="#init-module"><code>init-module</code></a></li><li><a href="#init-private"><code>init-private</code></a></li><li><a href="#init-type"><code>init-type</code></a></li><li><a href="#init-version"><code>init-version</code></a></li><li><a href="#install-links"><code>install-links</code></a></li><li><a href="#install-strategy"><code>install-strategy</code></a></li><li><a href="#json"><code>json</code></a></li><li><a href="#legacy-peer-deps"><code>legacy-peer-deps</code></a></li><li><a href="#libc"><code>libc</code></a></li><li><a href="#link"><code>link</code></a></li><li><a href="#local-address"><code>local-address</code></a></li><li><a href="#location"><code>location</code></a></li><li><a href="#lockfile-version"><code>lockfile-version</code></a></li><li><a href="#loglevel"><code>loglevel</code></a></li><li><a href="#logs-dir"><code>logs-dir</code></a></li><li><a href="#logs-max"><code>logs-max</code></a></li><li><a href="#long"><code>long</code></a></li><li><a href="#maxsockets"><code>maxsockets</code></a></li><li><a href="#message"><code>message</code></a></li><li><a href="#min-release-age"><code>min-release-age</code></a></li><li><a href="#name"><code>name</code></a></li><li><a href="#node-gyp"><code>node-gyp</code></a></li><li><a href="#node-options"><code>node-options</code></a></li><li><a href="#noproxy"><code>noproxy</code></a></li><li><a href="#offline"><code>offline</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#omit-lockfile-registry-resolved"><code>omit-lockfile-registry-resolved</code></a></li><li><a href="#orgs"><code>orgs</code></a></li><li><a href="#orgs-permission"><code>orgs-permission</code></a></li><li><a href="#os"><code>os</code></a></li><li><a href="#otp"><code>otp</code></a></li><li><a href="#pack-destination"><code>pack-destination</code></a></li><li><a href="#package"><code>package</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#package-lock-only"><code>package-lock-only</code></a></li><li><a href="#packages"><code>packages</code></a></li><li><a href="#packages-all"><code>packages-all</code></a></li><li><a href="#packages-and-scopes-permission"><code>packages-and-scopes-permission</code></a></li><li><a href="#parseable"><code>parseable</code></a></li><li><a href="#password"><code>password</code></a></li><li><a href="#prefer-dedupe"><code>prefer-dedupe</code></a></li><li><a href="#prefer-offline"><code>prefer-offline</code></a></li><li><a href="#prefer-online"><code>prefer-online</code></a></li><li><a href="#prefix"><code>prefix</code></a></li><li><a href="#preid"><code>preid</code></a></li><li><a href="#progress"><code>progress</code></a></li><li><a href="#provenance"><code>provenance</code></a></li><li><a href="#provenance-file"><code>provenance-file</code></a></li><li><a href="#proxy"><code>proxy</code></a></li><li><a href="#read-only"><code>read-only</code></a></li><li><a href="#rebuild-bundle"><code>rebuild-bundle</code></a></li><li><a href="#registry"><code>registry</code></a></li><li><a href="#replace-registry-host"><code>replace-registry-host</code></a></li><li><a href="#save"><code>save</code></a></li><li><a href="#save-bundle"><code>save-bundle</code></a></li><li><a href="#save-dev"><code>save-dev</code></a></li><li><a href="#save-exact"><code>save-exact</code></a></li><li><a href="#save-optional"><code>save-optional</code></a></li><li><a href="#save-peer"><code>save-peer</code></a></li><li><a href="#save-prefix"><code>save-prefix</code></a></li><li><a href="#save-prod"><code>save-prod</code></a></li><li><a href="#sbom-format"><code>sbom-format</code></a></li><li><a href="#sbom-type"><code>sbom-type</code></a></li><li><a href="#scope"><code>scope</code></a></li><li><a href="#scopes"><code>scopes</code></a></li><li><a href="#script-shell"><code>script-shell</code></a></li><li><a href="#searchexclude"><code>searchexclude</code></a></li><li><a href="#searchlimit"><code>searchlimit</code></a></li><li><a href="#searchopts"><code>searchopts</code></a></li><li><a href="#searchstaleness"><code>searchstaleness</code></a></li><li><a href="#shell"><code>shell</code></a></li><li><a href="#sign-git-commit"><code>sign-git-commit</code></a></li><li><a href="#sign-git-tag"><code>sign-git-tag</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#strict-ssl"><code>strict-ssl</code></a></li><li><a href="#tag"><code>tag</code></a></li><li><a href="#tag-version-prefix"><code>tag-version-prefix</code></a></li><li><a href="#timing"><code>timing</code></a></li><li><a href="#token-description"><code>token-description</code></a></li><li><a href="#umask"><code>umask</code></a></li><li><a href="#unicode"><code>unicode</code></a></li><li><a href="#update-notifier"><code>update-notifier</code></a></li><li><a href="#usage"><code>usage</code></a></li><li><a href="#user-agent"><code>user-agent</code></a></li><li><a href="#userconfig"><code>userconfig</code></a></li><li><a href="#version"><code>version</code></a></li><li><a href="#versions"><code>versions</code></a></li><li><a href="#viewer"><code>viewer</code></a></li><li><a href="#which"><code>which</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#workspaces-update"><code>workspaces-update</code></a></li><li><a href="#yes"><code>yes</code></a></li><li><a href="#also"><code>also</code></a></li><li><a href="#cache-max"><code>cache-max</code></a></li><li><a href="#cache-min"><code>cache-min</code></a></li><li><a href="#cert"><code>cert</code></a></li><li><a href="#dev"><code>dev</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#initauthoremail"><code>init.author.email</code></a></li><li><a href="#initauthorname"><code>init.author.name</code></a></li><li><a href="#initauthorurl"><code>init.author.url</code></a></li><li><a href="#initlicense"><code>init.license</code></a></li><li><a href="#initmodule"><code>init.module</code></a></li><li><a href="#initversion"><code>init.version</code></a></li><li><a href="#key"><code>key</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#only"><code>only</code></a></li><li><a href="#optional"><code>optional</code></a></li><li><a href="#production"><code>production</code></a></li><li><a href="#shrinkwrap"><code>shrinkwrap</code></a></li></ul><li><a href="#see-also">See also</a></li></ul></div>
199</section>
200
201<div id="_content"><h3 id="description">Description</h3>
202<p>This article details npm configuration in general.
203To learn about the <code>config</code> command, see <a href="../commands/npm-config.html"><code>npm config</code></a>.</p>
204<p>npm gets its configuration values from the following sources, sorted by priority:</p>
205<h4 id="command-line-flags">Command Line Flags</h4>
206<p>Putting <code>--foo bar</code> on the command line sets the <code>foo</code> configuration parameter to <code>"bar"</code>.
207A <code>--</code> argument tells the cli parser to stop reading flags.
208Using <code>--flag</code> without specifying any value will set the value to <code>true</code>.</p>
209<p>Example: <code>--flag1 --flag2</code> will set both configuration parameters to <code>true</code>, while <code>--flag1 --flag2 bar</code> will set <code>flag1</code> to <code>true</code>, and <code>flag2</code> to <code>bar</code>.
210Finally, <code>--flag1 --flag2 -- bar</code> will set both configuration parameters to <code>true</code>, and the <code>bar</code> is taken as a command argument.</p>
211<p><strong>Common examples:</strong></p>
212<ul>
213<li><code>npm install --prefix /path/to/dir</code> - Runs npm commands in a different directory without changing the current working directory</li>
214<li><code>npm install --global</code> - Installs packages globally (shorthand: <code>-g</code>)</li>
215<li><code>npm install --save-dev</code> - Saves to devDependencies (shorthand: <code>-D</code>)</li>
216</ul>
217<p>Any configuration option documented in the <a href="#config-settings">Config Settings</a> section below can be set via command line flags using <code>--option-name value</code> syntax.</p>
218<h4 id="environment-variables">Environment Variables</h4>
219<p>Any environment variables that start with <code>npm_config_</code> will be interpreted as a configuration parameter.
220For example, putting <code>npm_config_foo=bar</code> in your environment will set the <code>foo</code> configuration parameter to <code>bar</code>.
221Any environment configurations that are not given a value will be given the value of <code>true</code>.
222Config values are case-insensitive, so <code>NPM_CONFIG_FOO=bar</code> will work the same.
223However, please note that inside <a href="../using-npm/scripts.html"><code>scripts</code></a> npm will set its own environment variables and Node will prefer those lowercase versions over any uppercase ones that you might set.
224For details see <a href="https://github.com/npm/npm/issues/14528">this issue</a>.</p>
225<p>Notice that you need to use underscores instead of dashes, so <code>--allow-same-version</code> would become <code>npm_config_allow_same_version=true</code>.</p>
226<p><strong>Important:</strong> When defining custom configuration keys in <code>.npmrc</code> files, use hyphens instead of underscores (e.g., <code>custom-key=value</code>). This ensures they can be overridden by environment variables, since npm automatically converts underscores to hyphens when reading environment variables. Keys with underscores in <code>.npmrc</code> files cannot be overridden via environment variables.</p>
227<h4 id="npmrc-files">npmrc Files</h4>
228<p>The four relevant files are:</p>
229<ul>
230<li>per-project configuration file (<code>/path/to/my/project/.npmrc</code>)</li>
231<li>per-user configuration file (defaults to <code>$HOME/.npmrc</code>; configurable via CLI option <code>--userconfig</code> or environment variable <code>$NPM_CONFIG_USERCONFIG</code>)</li>
232<li>global configuration file (defaults to <code>$PREFIX/etc/npmrc</code>; configurable via CLI option <code>--globalconfig</code> or environment variable <code>$NPM_CONFIG_GLOBALCONFIG</code>)</li>
233<li>npm's built-in configuration file (<code>/path/to/npm/npmrc</code>)</li>
234</ul>
235<p>See <a href="../configuring-npm/npmrc.html">npmrc</a> for more details.</p>
236<h4 id="default-configs">Default Configs</h4>
237<p>Run <code>npm config ls -l</code> to see a set of configuration parameters that are internal to npm, and are defaults if nothing else is specified.</p>
238<h3 id="shorthands-and-other-cli-niceties">Shorthands and Other CLI Niceties</h3>
239<p>The following shorthands are parsed on the command-line:</p>
240<ul>
241<li><code>-a</code>: <code>--all</code></li>
242<li><code>--enjoy-by</code>: <code>--before</code></li>
243<li><code>-c</code>: <code>--call</code></li>
244<li><code>--desc</code>: <code>--description</code></li>
245<li><code>-f</code>: <code>--force</code></li>
246<li><code>-g</code>: <code>--global</code></li>
247<li><code>--iwr</code>: <code>--include-workspace-root</code></li>
248<li><code>-L</code>: <code>--location</code></li>
249<li><code>-d</code>: <code>--loglevel info</code></li>
250<li><code>-s</code>: <code>--loglevel silent</code></li>
251<li><code>--silent</code>: <code>--loglevel silent</code></li>
252<li><code>--ddd</code>: <code>--loglevel silly</code></li>
253<li><code>--dd</code>: <code>--loglevel verbose</code></li>
254<li><code>--verbose</code>: <code>--loglevel verbose</code></li>
255<li><code>-q</code>: <code>--loglevel warn</code></li>
256<li><code>--quiet</code>: <code>--loglevel warn</code></li>
257<li><code>-l</code>: <code>--long</code></li>
258<li><code>-m</code>: <code>--message</code></li>
259<li><code>--local</code>: <code>--no-global</code></li>
260<li><code>-n</code>: <code>--no-yes</code></li>
261<li><code>--no</code>: <code>--no-yes</code></li>
262<li><code>-p</code>: <code>--parseable</code></li>
263<li><code>--porcelain</code>: <code>--parseable</code></li>
264<li><code>-C</code>: <code>--prefix</code></li>
265<li><code>--readonly</code>: <code>--read-only</code></li>
266<li><code>--reg</code>: <code>--registry</code></li>
267<li><code>-S</code>: <code>--save</code></li>
268<li><code>-B</code>: <code>--save-bundle</code></li>
269<li><code>-D</code>: <code>--save-dev</code></li>
270<li><code>-E</code>: <code>--save-exact</code></li>
271<li><code>-O</code>: <code>--save-optional</code></li>
272<li><code>-P</code>: <code>--save-prod</code></li>
273<li><code>-?</code>: <code>--usage</code></li>
274<li><code>-h</code>: <code>--usage</code></li>
275<li><code>-H</code>: <code>--usage</code></li>
276<li><code>--help</code>: <code>--usage</code></li>
277<li><code>-v</code>: <code>--version</code></li>
278<li><code>-w</code>: <code>--workspace</code></li>
279<li><code>--ws</code>: <code>--workspaces</code></li>
280<li><code>-y</code>: <code>--yes</code></li>
281</ul>
282<p>If the specified configuration param resolves unambiguously to a known configuration parameter, then it is expanded to that configuration parameter.
283For example:</p>
284<pre><code class="language-bash">npm ls --par
285# same as:
286npm ls --parseable
287</code></pre>
288<p>If multiple single-character shorthands are strung together, and the resulting combination is unambiguously not some other configuration param, then it is expanded to its various component pieces.
289For example:</p>
290<pre><code class="language-bash">npm ls -gpld
291# same as:
292npm ls --global --parseable --long --loglevel info
293</code></pre>
294<h3 id="config-settings">Config Settings</h3>
295<h4 id="auth"><code>_auth</code></h4>
296<ul>
297<li>Default: null</li>
298<li>Type: null or String</li>
299</ul>
300<p>A basic-auth string to use when authenticating against the npm registry.
301This will ONLY be used to authenticate against the npm registry. For other
302registries you will need to scope it like "//other-registry.tld/:_auth"</p>
303<p>Warning: This should generally not be set via a command-line option. It is
304safer to use a registry-provided authentication bearer token stored in the
305~/.npmrc file by running <code>npm login</code>.</p>
306<h4 id="access"><code>access</code></h4>
307<ul>
308<li>Default: 'public' for new packages, existing packages it will not change the
309current level</li>
310<li>Type: null, "restricted", or "public"</li>
311</ul>
312<p>If you do not want your scoped package to be publicly viewable (and
313installable) set <code>--access=restricted</code>.</p>
314<p>Unscoped packages cannot be set to <code>restricted</code>.</p>
315<p>Note: This defaults to not changing the current access level for existing
316packages. Specifying a value of <code>restricted</code> or <code>public</code> during publish will
317change the access for an existing package the same way that <code>npm access set status</code> would.</p>
318<h4 id="all"><code>all</code></h4>
319<ul>
320<li>Default: false</li>
321<li>Type: Boolean</li>
322</ul>
323<p>When running <code>npm outdated</code> and <code>npm ls</code>, setting <code>--all</code> will show all
324outdated or installed packages, rather than only those directly depended
325upon by the current project.</p>
326<h4 id="allow-git"><code>allow-git</code></h4>
327<ul>
328<li>Default: "all"</li>
329<li>Type: "all", "none", or "root"</li>
330</ul>
331<p>Limits the ability for npm to fetch dependencies from git references. That
332is, dependencies that point to a git repo instead of a version or semver
333range. Please note that this could leave your tree incomplete and some
334packages may not function as intended or designed.</p>
335<p><code>all</code> allows any git dependencies to be fetched and installed. <code>none</code>
336prevents any git dependencies from being fetched and installed. <code>root</code> only
337allows git dependencies defined in your project's package.json to be fetched
338installed. Also allows git dependencies to be fetched for other commands
339like <code>npm view</code></p>
340<h4 id="allow-same-version"><code>allow-same-version</code></h4>
341<ul>
342<li>Default: false</li>
343<li>Type: Boolean</li>
344</ul>
345<p>Prevents throwing an error when <code>npm version</code> is used to set the new version
346to the same value as the current version.</p>
347<h4 id="audit"><code>audit</code></h4>
348<ul>
349<li>Default: true</li>
350<li>Type: Boolean</li>
351</ul>
352<p>When "true" submit audit reports alongside the current npm command to the
353default registry and all registries configured for scopes. See the
354documentation for <a href="../commands/npm-audit.html"><code>npm audit</code></a> for details on what is
355submitted.</p>
356<h4 id="audit-level"><code>audit-level</code></h4>
357<ul>
358<li>Default: null</li>
359<li>Type: null, "info", "low", "moderate", "high", "critical", or "none"</li>
360</ul>
361<p>The minimum level of vulnerability for <code>npm audit</code> to exit with a non-zero
362exit code.</p>
363<h4 id="auth-type"><code>auth-type</code></h4>
364<ul>
365<li>Default: "web"</li>
366<li>Type: "legacy" or "web"</li>
367</ul>
368<p>What authentication strategy to use with <code>login</code>. Note that if an <code>otp</code>
369config is given, this value will always be set to <code>legacy</code>.</p>
370<h4 id="before"><code>before</code></h4>
371<ul>
372<li>Default: null</li>
373<li>Type: null or Date</li>
374</ul>
375<p>If passed to <code>npm install</code>, will rebuild the npm tree such that only
376versions that were available <strong>on or before</strong> the given date are installed.
377If there are no versions available for the current set of dependencies, the
378command will error.</p>
379<p>If the requested version is a <code>dist-tag</code> and the given tag does not pass the
380<code>--before</code> filter, the most recent version less than or equal to that tag
381will be used. For example, <code>foo@latest</code> might install <code>foo@1.2</code> even though
382<code>latest</code> is <code>2.0</code>.</p>
383<p>This config cannot be used with: <code>min-release-age</code></p>
384<h4 id="bin-links"><code>bin-links</code></h4>
385<ul>
386<li>Default: true</li>
387<li>Type: Boolean</li>
388</ul>
389<p>Tells npm to create symlinks (or <code>.cmd</code> shims on Windows) for package
390executables.</p>
391<p>Set to false to have it not do this. This can be used to work around the
392fact that some file systems don't support symlinks, even on ostensibly Unix
393systems.</p>
394<h4 id="browser"><code>browser</code></h4>
395<ul>
396<li>Default: macOS: <code>"open"</code>, Windows: <code>"start"</code>, Others: <code>"xdg-open"</code></li>
397<li>Type: null, Boolean, or String</li>
398</ul>
399<p>The browser that is called by npm commands to open websites.</p>
400<p>Set to <code>false</code> to suppress browser behavior and instead print urls to
401terminal.</p>
402<p>Set to <code>true</code> to use default system URL opener.</p>
403<h4 id="bypass-2fa"><code>bypass-2fa</code></h4>
404<ul>
405<li>Default: false</li>
406<li>Type: Boolean</li>
407</ul>
408<p>When creating a Granular Access Token with <code>npm token create</code>, setting this
409to true will allow the token to bypass two-factor authentication. This is
410useful for automation and CI/CD workflows.</p>
411<h4 id="ca"><code>ca</code></h4>
412<ul>
413<li>Default: null</li>
414<li>Type: null or String (can be set multiple times)</li>
415</ul>
416<p>The Certificate Authority signing certificate that is trusted for SSL
417connections to the registry. Values should be in PEM format (Windows calls
418it "Base-64 encoded X.509 (.CER)") with newlines replaced by the string
419"\n". For example:</p>
420<pre><code class="language-ini">ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
421</code></pre>
422<p>Set to <code>null</code> to only allow "known" registrars, or to a specific CA cert to
423trust only that specific signing authority.</p>
424<p>Multiple CAs can be trusted by specifying an array of certificates:</p>
425<pre><code class="language-ini">ca[]="..."
426ca[]="..."
427</code></pre>
428<p>See also the <code>strict-ssl</code> config.</p>
429<h4 id="cache"><code>cache</code></h4>
430<ul>
431<li>Default: Windows: <code>%LocalAppData%\npm-cache</code>, Posix: <code>~/.npm</code></li>
432<li>Type: Path</li>
433</ul>
434<p>The location of npm's cache directory.</p>
435<h4 id="cafile"><code>cafile</code></h4>
436<ul>
437<li>Default: null</li>
438<li>Type: Path</li>
439</ul>
440<p>A path to a file containing one or multiple Certificate Authority signing
441certificates. Similar to the <code>ca</code> setting, but allows for multiple CA's, as
442well as for the CA information to be stored in a file on disk.</p>
443<h4 id="call"><code>call</code></h4>
444<ul>
445<li>Default: ""</li>
446<li>Type: String</li>
447</ul>
448<p>Optional companion option for <code>npm exec</code>, <code>npx</code> that allows for specifying a
449custom command to be run along with the installed packages.</p>
450<pre><code class="language-bash">npm exec --package yo --package generator-node --call "yo node"
451</code></pre>
452<h4 id="cidr"><code>cidr</code></h4>
453<ul>
454<li>Default: null</li>
455<li>Type: null or String (can be set multiple times)</li>
456</ul>
457<p>This is a list of CIDR address to be used when configuring limited access
458tokens with the <code>npm token create</code> command.</p>
459<h4 id="color"><code>color</code></h4>
460<ul>
461<li>Default: true unless the NO_COLOR environ is set to something other than '0'</li>
462<li>Type: "always" or Boolean</li>
463</ul>
464<p>If false, never shows colors. If <code>"always"</code> then always shows colors. If
465true, then only prints color codes for tty file descriptors.</p>
466<h4 id="commit-hooks"><code>commit-hooks</code></h4>
467<ul>
468<li>Default: true</li>
469<li>Type: Boolean</li>
470</ul>
471<p>Run git commit hooks when using the <code>npm version</code> command.</p>
472<h4 id="cpu"><code>cpu</code></h4>
473<ul>
474<li>Default: null</li>
475<li>Type: null or String</li>
476</ul>
477<p>Override CPU architecture of native modules to install. Acceptable values
478are same as <code>cpu</code> field of package.json, which comes from <code>process.arch</code>.</p>
479<h4 id="depth"><code>depth</code></h4>
480<ul>
481<li>Default: <code>Infinity</code> if <code>--all</code> is set; otherwise, <code>0</code></li>
482<li>Type: null or Number</li>
483</ul>
484<p>The depth to go when recursing packages for <code>npm ls</code>.</p>
485<p>If not set, <code>npm ls</code> will show only the immediate dependencies of the root
486project. If <code>--all</code> is set, then npm will show all dependencies by default.</p>
487<h4 id="description2"><code>description</code></h4>
488<ul>
489<li>Default: true</li>
490<li>Type: Boolean</li>
491</ul>
492<p>Show the description in <code>npm search</code></p>
493<h4 id="diff"><code>diff</code></h4>
494<ul>
495<li>Default:</li>
496<li>Type: String (can be set multiple times)</li>
497</ul>
498<p>Define arguments to compare in <code>npm diff</code>.</p>
499<h4 id="diff-dst-prefix"><code>diff-dst-prefix</code></h4>
500<ul>
501<li>Default: "b/"</li>
502<li>Type: String</li>
503</ul>
504<p>Destination prefix to be used in <code>npm diff</code> output.</p>
505<h4 id="diff-ignore-all-space"><code>diff-ignore-all-space</code></h4>
506<ul>
507<li>Default: false</li>
508<li>Type: Boolean</li>
509</ul>
510<p>Ignore whitespace when comparing lines in <code>npm diff</code>.</p>
511<h4 id="diff-name-only"><code>diff-name-only</code></h4>
512<ul>
513<li>Default: false</li>
514<li>Type: Boolean</li>
515</ul>
516<p>Prints only filenames when using <code>npm diff</code>.</p>
517<h4 id="diff-no-prefix"><code>diff-no-prefix</code></h4>
518<ul>
519<li>Default: false</li>
520<li>Type: Boolean</li>
521</ul>
522<p>Do not show any source or destination prefix in <code>npm diff</code> output.</p>
523<p>Note: this causes <code>npm diff</code> to ignore the <code>--diff-src-prefix</code> and
524<code>--diff-dst-prefix</code> configs.</p>
525<h4 id="diff-src-prefix"><code>diff-src-prefix</code></h4>
526<ul>
527<li>Default: "a/"</li>
528<li>Type: String</li>
529</ul>
530<p>Source prefix to be used in <code>npm diff</code> output.</p>
531<h4 id="diff-text"><code>diff-text</code></h4>
532<ul>
533<li>Default: false</li>
534<li>Type: Boolean</li>
535</ul>
536<p>Treat all files as text in <code>npm diff</code>.</p>
537<h4 id="diff-unified"><code>diff-unified</code></h4>
538<ul>
539<li>Default: 3</li>
540<li>Type: Number</li>
541</ul>
542<p>The number of lines of context to print in <code>npm diff</code>.</p>
543<h4 id="dry-run"><code>dry-run</code></h4>
544<ul>
545<li>Default: false</li>
546<li>Type: Boolean</li>
547</ul>
548<p>Indicates that you don't want npm to make any changes and that it should
549only report what it would have done. This can be passed into any of the
550commands that modify your local installation, eg, <code>install</code>, <code>update</code>,
551<code>dedupe</code>, <code>uninstall</code>, as well as <code>pack</code> and <code>publish</code>.</p>
552<p>Note: This is NOT honored by other network related commands, eg <code>dist-tags</code>,
553<code>owner</code>, etc.</p>
554<h4 id="editor"><code>editor</code></h4>
555<ul>
556<li>Default: The EDITOR or VISUAL environment variables, or
557'%SYSTEMROOT%\notepad.exe' on Windows, or 'vi' on Unix systems</li>
558<li>Type: String</li>
559</ul>
560<p>The command to run for <code>npm edit</code> and <code>npm config edit</code>.</p>
561<h4 id="engine-strict"><code>engine-strict</code></h4>
562<ul>
563<li>Default: false</li>
564<li>Type: Boolean</li>
565</ul>
566<p>If set to true, then npm will stubbornly refuse to install (or even consider
567installing) any package that claims to not be compatible with the current
568Node.js version.</p>
569<p>This can be overridden by setting the <code>--force</code> flag.</p>
570<h4 id="expect-result-count"><code>expect-result-count</code></h4>
571<ul>
572<li>Default: null</li>
573<li>Type: null or Number</li>
574</ul>
575<p>Tells to expect a specific number of results from the command.</p>
576<p>This config cannot be used with: <code>expect-results</code></p>
577<h4 id="expect-results"><code>expect-results</code></h4>
578<ul>
579<li>Default: null</li>
580<li>Type: null or Boolean</li>
581</ul>
582<p>Tells npm whether or not to expect results from the command. Can be either
583true (expect some results) or false (expect no results).</p>
584<p>This config cannot be used with: <code>expect-result-count</code></p>
585<h4 id="expires"><code>expires</code></h4>
586<ul>
587<li>Default: null</li>
588<li>Type: null or Number</li>
589</ul>
590<p>When creating a Granular Access Token with <code>npm token create</code>, this sets the
591expiration in days. If not specified, the server will determine the default
592expiration.</p>
593<h4 id="fetch-retries"><code>fetch-retries</code></h4>
594<ul>
595<li>Default: 2</li>
596<li>Type: Number</li>
597</ul>
598<p>The "retries" config for the <code>retry</code> module to use when fetching packages
599from the registry.</p>
600<p>npm will retry idempotent read requests to the registry in the case of
601network failures or 5xx HTTP errors.</p>
602<h4 id="fetch-retry-factor"><code>fetch-retry-factor</code></h4>
603<ul>
604<li>Default: 10</li>
605<li>Type: Number</li>
606</ul>
607<p>The "factor" config for the <code>retry</code> module to use when fetching packages.</p>
608<h4 id="fetch-retry-maxtimeout"><code>fetch-retry-maxtimeout</code></h4>
609<ul>
610<li>Default: 60000 (1 minute)</li>
611<li>Type: Number</li>
612</ul>
613<p>The "maxTimeout" config for the <code>retry</code> module to use when fetching
614packages.</p>
615<h4 id="fetch-retry-mintimeout"><code>fetch-retry-mintimeout</code></h4>
616<ul>
617<li>Default: 10000 (10 seconds)</li>
618<li>Type: Number</li>
619</ul>
620<p>The "minTimeout" config for the <code>retry</code> module to use when fetching
621packages.</p>
622<h4 id="fetch-timeout"><code>fetch-timeout</code></h4>
623<ul>
624<li>Default: 300000 (5 minutes)</li>
625<li>Type: Number</li>
626</ul>
627<p>The maximum amount of time to wait for HTTP requests to complete.</p>
628<h4 id="force"><code>force</code></h4>
629<ul>
630<li>Default: false</li>
631<li>Type: Boolean</li>
632</ul>
633<p>Removes various protections against unfortunate side effects, common
634mistakes, unnecessary performance degradation, and malicious input.</p>
635<ul>
636<li>Allow clobbering non-npm files in global installs.</li>
637<li>Allow the <code>npm version</code> command to work on an unclean git repository.</li>
638<li>Allow deleting the cache folder with <code>npm cache clean</code>.</li>
639<li>Allow installing packages that have an <code>engines</code> declaration requiring a
640different version of npm.</li>
641<li>Allow installing packages that have an <code>engines</code> declaration requiring a
642different version of <code>node</code>, even if <code>--engine-strict</code> is enabled.</li>
643<li>Allow <code>npm audit fix</code> to install modules outside your stated dependency
644range (including SemVer-major changes).</li>
645<li>Allow unpublishing all versions of a published package.</li>
646<li>Allow conflicting peerDependencies to be installed in the root project.</li>
647<li>Implicitly set <code>--yes</code> during <code>npm init</code>.</li>
648<li>Allow clobbering existing values in <code>npm pkg</code></li>
649<li>Allow unpublishing of entire packages (not just a single version).</li>
650</ul>
651<p>If you don't have a clear idea of what you want to do, it is strongly
652recommended that you do not use this option!</p>
653<h4 id="foreground-scripts"><code>foreground-scripts</code></h4>
654<ul>
655<li>Default: <code>false</code> unless when using <code>npm pack</code> or <code>npm publish</code> where it
656defaults to <code>true</code></li>
657<li>Type: Boolean</li>
658</ul>
659<p>Run all build scripts (ie, <code>preinstall</code>, <code>install</code>, and <code>postinstall</code>)
660scripts for installed packages in the foreground process, sharing standard
661input, output, and error with the main npm process.</p>
662<p>Note that this will generally make installs run slower, and be much noisier,
663but can be useful for debugging.</p>
664<h4 id="format-package-lock"><code>format-package-lock</code></h4>
665<ul>
666<li>Default: true</li>
667<li>Type: Boolean</li>
668</ul>
669<p>Format <code>package-lock.json</code> or <code>npm-shrinkwrap.json</code> as a human readable
670file.</p>
671<h4 id="fund"><code>fund</code></h4>
672<ul>
673<li>Default: true</li>
674<li>Type: Boolean</li>
675</ul>
676<p>When "true" displays the message at the end of each <code>npm install</code>
677acknowledging the number of dependencies looking for funding. See <a href="../commands/npm-fund.html"><code>npm fund</code></a> for details.</p>
678<h4 id="git"><code>git</code></h4>
679<ul>
680<li>Default: "git"</li>
681<li>Type: String</li>
682</ul>
683<p>The command to use for git commands. If git is installed on the computer,
684but is not in the <code>PATH</code>, then set this to the full path to the git binary.</p>
685<h4 id="git-tag-version"><code>git-tag-version</code></h4>
686<ul>
687<li>Default: true</li>
688<li>Type: Boolean</li>
689</ul>
690<p>Tag the commit when using the <code>npm version</code> command. Setting this to false
691results in no commit being made at all.</p>
692<h4 id="global"><code>global</code></h4>
693<ul>
694<li>Default: false</li>
695<li>Type: Boolean</li>
696</ul>
697<p>Operates in "global" mode, so that packages are installed into the <code>prefix</code>
698folder instead of the current working directory. See
699<a href="../configuring-npm/folders.html">folders</a> for more on the differences in behavior.</p>
700<ul>
701<li>packages are installed into the <code>{prefix}/lib/node_modules</code> folder, instead
702of the current working directory.</li>
703<li>bin files are linked to <code>{prefix}/bin</code></li>
704<li>man pages are linked to <code>{prefix}/share/man</code></li>
705</ul>
706<h4 id="globalconfig"><code>globalconfig</code></h4>
707<ul>
708<li>Default: The global --prefix setting plus 'etc/npmrc'. For example,
709'/usr/local/etc/npmrc'</li>
710<li>Type: Path</li>
711</ul>
712<p>The config file to read for global config options.</p>
713<h4 id="heading"><code>heading</code></h4>
714<ul>
715<li>Default: "npm"</li>
716<li>Type: String</li>
717</ul>
718<p>The string that starts all the debugging log output.</p>
719<h4 id="https-proxy"><code>https-proxy</code></h4>
720<ul>
721<li>Default: null</li>
722<li>Type: null or URL</li>
723</ul>
724<p>A proxy to use for outgoing https requests. If the <code>HTTPS_PROXY</code> or
725<code>https_proxy</code> or <code>HTTP_PROXY</code> or <code>http_proxy</code> environment variables are set,
726proxy settings will be honored by the underlying <code>make-fetch-happen</code>
727library.</p>
728<h4 id="if-present"><code>if-present</code></h4>
729<ul>
730<li>Default: false</li>
731<li>Type: Boolean</li>
732</ul>
733<p>If true, npm will not exit with an error code when <code>run</code> is invoked for a
734script that isn't defined in the <code>scripts</code> section of <code>package.json</code>. This
735option can be used when it's desirable to optionally run a script when it's
736present and fail if the script fails. This is useful, for example, when
737running scripts that may only apply for some builds in an otherwise generic
738CI setup.</p>
739<p>This value is not exported to the environment for child processes.</p>
740<h4 id="ignore-scripts"><code>ignore-scripts</code></h4>
741<ul>
742<li>Default: false</li>
743<li>Type: Boolean</li>
744</ul>
745<p>If true, npm does not run scripts specified in package.json files.</p>
746<p>Note that commands explicitly intended to run a particular script, such as
747<code>npm start</code>, <code>npm stop</code>, <code>npm restart</code>, <code>npm test</code>, and <code>npm run</code> will still
748run their intended script if <code>ignore-scripts</code> is set, but they will <em>not</em>
749run any pre- or post-scripts.</p>
750<h4 id="include"><code>include</code></h4>
751<ul>
752<li>Default:</li>
753<li>Type: "prod", "dev", "optional", or "peer" (can be set multiple times)</li>
754</ul>
755<p>Option that allows for defining which types of dependencies to install.</p>
756<p>This is the inverse of <code>--omit=<type></code>.</p>
757<p>Dependency types specified in <code>--include</code> will not be omitted, regardless of
758the order in which omit/include are specified on the command-line.</p>
759<h4 id="include-attestations"><code>include-attestations</code></h4>
760<ul>
761<li>Default: false</li>
762<li>Type: Boolean</li>
763</ul>
764<p>When used with <code>npm audit signatures --json</code>, includes the full sigstore
765attestation bundles in the JSON output for each verified package. The
766bundles contain DSSE envelopes, verification material, and transparency log
767entries.</p>
768<h4 id="include-staged"><code>include-staged</code></h4>
769<ul>
770<li>Default: false</li>
771<li>Type: Boolean</li>
772</ul>
773<p>Allow installing "staged" published packages, as defined by <a href="https://github.com/npm/rfcs/pull/92">npm RFC PR
774#92</a>.</p>
775<p>This is experimental, and not implemented by the npm public registry.</p>
776<h4 id="include-workspace-root"><code>include-workspace-root</code></h4>
777<ul>
778<li>Default: false</li>
779<li>Type: Boolean</li>
780</ul>
781<p>Include the workspace root when workspaces are enabled for a command.</p>
782<p>When false, specifying individual workspaces via the <code>workspace</code> config, or
783all workspaces via the <code>workspaces</code> flag, will cause npm to operate only on
784the specified workspaces, and not on the root project.</p>
785<p>This value is not exported to the environment for child processes.</p>
786<h4 id="init-author-email"><code>init-author-email</code></h4>
787<ul>
788<li>Default: ""</li>
789<li>Type: String</li>
790</ul>
791<p>The value <code>npm init</code> should use by default for the package author's email.</p>
792<h4 id="init-author-name"><code>init-author-name</code></h4>
793<ul>
794<li>Default: ""</li>
795<li>Type: String</li>
796</ul>
797<p>The value <code>npm init</code> should use by default for the package author's name.</p>
798<h4 id="init-author-url"><code>init-author-url</code></h4>
799<ul>
800<li>Default: ""</li>
801<li>Type: "" or URL</li>
802</ul>
803<p>The value <code>npm init</code> should use by default for the package author's
804homepage.</p>
805<h4 id="init-license"><code>init-license</code></h4>
806<ul>
807<li>Default: "ISC"</li>
808<li>Type: String</li>
809</ul>
810<p>The value <code>npm init</code> should use by default for the package license.</p>
811<h4 id="init-module"><code>init-module</code></h4>
812<ul>
813<li>Default: "~/.npm-init.js"</li>
814<li>Type: Path</li>
815</ul>
816<p>A module that will be loaded by the <code>npm init</code> command. See the
817documentation for the
818<a href="https://github.com/npm/init-package-json">init-package-json</a> module for
819more information, or <a href="../commands/npm-init.html">npm init</a>.</p>
820<h4 id="init-private"><code>init-private</code></h4>
821<ul>
822<li>Default: false</li>
823<li>Type: Boolean</li>
824</ul>
825<p>The value <code>npm init</code> should use by default for the package's private flag.</p>
826<h4 id="init-type"><code>init-type</code></h4>
827<ul>
828<li>Default: "commonjs"</li>
829<li>Type: String</li>
830</ul>
831<p>The value that <code>npm init</code> should use by default for the package.json type
832field.</p>
833<h4 id="init-version"><code>init-version</code></h4>
834<ul>
835<li>Default: "1.0.0"</li>
836<li>Type: SemVer string</li>
837</ul>
838<p>The value that <code>npm init</code> should use by default for the package version
839number, if not already set in package.json.</p>
840<h4 id="install-links"><code>install-links</code></h4>
841<ul>
842<li>Default: false</li>
843<li>Type: Boolean</li>
844</ul>
845<p>When set file: protocol dependencies will be packed and installed as regular
846dependencies instead of creating a symlink. This option has no effect on
847workspaces.</p>
848<h4 id="install-strategy"><code>install-strategy</code></h4>
849<ul>
850<li>Default: "hoisted"</li>
851<li>Type: "hoisted", "nested", "shallow", or "linked"</li>
852</ul>
853<p>Sets the strategy for installing packages in node_modules. hoisted
854(default): Install non-duplicated in top-level, and duplicated as necessary
855within directory structure. nested: (formerly --legacy-bundling) install in
856place, no hoisting. shallow (formerly --global-style) only install direct
857deps at top-level. linked: (experimental) install in node_modules/.store,
858link in place, unhoisted.</p>
859<h4 id="json"><code>json</code></h4>
860<ul>
861<li>Default: false</li>
862<li>Type: Boolean</li>
863</ul>
864<p>Whether or not to output JSON data, rather than the normal output.</p>
865<ul>
866<li>In <code>npm pkg set</code> it enables parsing set values with JSON.parse() before
867saving them to your <code>package.json</code>.</li>
868</ul>
869<p>Not supported by all npm commands.</p>
870<h4 id="legacy-peer-deps"><code>legacy-peer-deps</code></h4>
871<ul>
872<li>Default: false</li>
873<li>Type: Boolean</li>
874</ul>
875<p>Causes npm to completely ignore <code>peerDependencies</code> when building a package
876tree, as in npm versions 3 through 6.</p>
877<p>If a package cannot be installed because of overly strict <code>peerDependencies</code>
878that collide, it provides a way to move forward resolving the situation.</p>
879<p>This differs from <code>--omit=peer</code>, in that <code>--omit=peer</code> will avoid unpacking
880<code>peerDependencies</code> on disk, but will still design a tree such that
881<code>peerDependencies</code> <em>could</em> be unpacked in a correct place.</p>
882<p>Use of <code>legacy-peer-deps</code> is not recommended, as it will not enforce the
883<code>peerDependencies</code> contract that meta-dependencies may rely on.</p>
884<h4 id="libc"><code>libc</code></h4>
885<ul>
886<li>Default: null</li>
887<li>Type: null or String</li>
888</ul>
889<p>Override libc of native modules to install. Acceptable values are same as
890<code>libc</code> field of package.json</p>
891<h4 id="link"><code>link</code></h4>
892<ul>
893<li>Default: false</li>
894<li>Type: Boolean</li>
895</ul>
896<p>Used with <code>npm ls</code>, limiting output to only those packages that are linked.</p>
897<h4 id="local-address"><code>local-address</code></h4>
898<ul>
899<li>Default: null</li>
900<li>Type: IP Address</li>
901</ul>
902<p>The IP address of the local interface to use when making connections to the
903npm registry. Must be IPv4 in versions of Node prior to 0.12.</p>
904<h4 id="location"><code>location</code></h4>
905<ul>
906<li>Default: "user" unless <code>--global</code> is passed, which will also set this value
907to "global"</li>
908<li>Type: "global", "user", or "project"</li>
909</ul>
910<p>When passed to <code>npm config</code> this refers to which config file to use.</p>
911<p>When set to "global" mode, packages are installed into the <code>prefix</code> folder
912instead of the current working directory. See
913<a href="../configuring-npm/folders.html">folders</a> for more on the differences in behavior.</p>
914<ul>
915<li>packages are installed into the <code>{prefix}/lib/node_modules</code> folder, instead
916of the current working directory.</li>
917<li>bin files are linked to <code>{prefix}/bin</code></li>
918<li>man pages are linked to <code>{prefix}/share/man</code></li>
919</ul>
920<h4 id="lockfile-version"><code>lockfile-version</code></h4>
921<ul>
922<li>Default: Version 3 if no lockfile, auto-converting v1 lockfiles to v3;
923otherwise, maintain current lockfile version.</li>
924<li>Type: null, 1, 2, 3, "1", "2", or "3"</li>
925</ul>
926<p>Set the lockfile format version to be used in package-lock.json and
927npm-shrinkwrap-json files. Possible options are:</p>
928<p>1: The lockfile version used by npm versions 5 and 6. Lacks some data that
929is used during the install, resulting in slower and possibly less
930deterministic installs. Prevents lockfile churn when interoperating with
931older npm versions.</p>
932<p>2: The default lockfile version used by npm version 7 and 8. Includes both
933the version 1 lockfile data and version 3 lockfile data, for maximum
934determinism and interoperability, at the expense of more bytes on disk.</p>
935<p>3: Only the new lockfile information introduced in npm version 7. Smaller on
936disk than lockfile version 2, but not interoperable with older npm versions.
937Ideal if all users are on npm version 7 and higher.</p>
938<h4 id="loglevel"><code>loglevel</code></h4>
939<ul>
940<li>Default: "notice"</li>
941<li>Type: "silent", "error", "warn", "notice", "http", "info", "verbose", or
942"silly"</li>
943</ul>
944<p>What level of logs to report. All logs are written to a debug log, with the
945path to that file printed if the execution of a command fails.</p>
946<p>Any logs of a higher level than the setting are shown. The default is
947"notice".</p>
948<p>See also the <code>foreground-scripts</code> config.</p>
949<h4 id="logs-dir"><code>logs-dir</code></h4>
950<ul>
951<li>Default: A directory named <code>_logs</code> inside the cache</li>
952<li>Type: null or Path</li>
953</ul>
954<p>The location of npm's log directory. See <a href="../using-npm/logging.html"><code>npm logging</code></a>
955for more information.</p>
956<h4 id="logs-max"><code>logs-max</code></h4>
957<ul>
958<li>Default: 10</li>
959<li>Type: Number</li>
960</ul>
961<p>The maximum number of log files to store.</p>
962<p>If set to 0, no log files will be written for the current run.</p>
963<h4 id="long"><code>long</code></h4>
964<ul>
965<li>Default: false</li>
966<li>Type: Boolean</li>
967</ul>
968<p>Show extended information in <code>ls</code>, <code>search</code>, and <code>help-search</code>.</p>
969<h4 id="maxsockets"><code>maxsockets</code></h4>
970<ul>
971<li>Default: 15</li>
972<li>Type: Number</li>
973</ul>
974<p>The maximum number of connections to use per origin (protocol/host/port
975combination).</p>
976<h4 id="message"><code>message</code></h4>
977<ul>
978<li>Default: "%s"</li>
979<li>Type: String</li>
980</ul>
981<p>Commit message which is used by <code>npm version</code> when creating version commit.</p>
982<p>Any "%s" in the message will be replaced with the version number.</p>
983<h4 id="min-release-age"><code>min-release-age</code></h4>
984<ul>
985<li>Default: null</li>
986<li>Type: null or Number</li>
987</ul>
988<p>If set, npm will build the npm tree such that only versions that were
989available more than the given number of days ago will be installed. If there
990are no versions available for the current set of dependencies, the command
991will error.</p>
992<p>This flag is a complement to <code>before</code>, which accepts an exact date instead
993of a relative number of days.</p>
994<p>This config cannot be used with: <code>before</code></p>
995<p>This value is not exported to the environment for child processes.</p>
996<h4 id="name"><code>name</code></h4>
997<ul>
998<li>Default: null</li>
999<li>Type: null or String</li>
1000</ul>
1001<p>When creating a Granular Access Token with <code>npm token create</code>, this sets the
1002name/description for the token.</p>
1003<h4 id="node-gyp"><code>node-gyp</code></h4>
1004<ul>
1005<li>Default: The path to the node-gyp bin that ships with npm</li>
1006<li>Type: Path</li>
1007</ul>
1008<p>This is the location of the "node-gyp" bin. By default it uses one that
1009ships with npm itself.</p>
1010<p>You can use this config to specify your own "node-gyp" to run when it is
1011required to build a package.</p>
1012<h4 id="node-options"><code>node-options</code></h4>
1013<ul>
1014<li>Default: null</li>
1015<li>Type: null or String</li>
1016</ul>
1017<p>Options to pass through to Node.js via the <code>NODE_OPTIONS</code> environment
1018variable. This does not impact how npm itself is executed but it does impact
1019how lifecycle scripts are called.</p>
1020<h4 id="noproxy"><code>noproxy</code></h4>
1021<ul>
1022<li>Default: The value of the NO_PROXY environment variable</li>
1023<li>Type: String (can be set multiple times)</li>
1024</ul>
1025<p>Domain extensions that should bypass any proxies.</p>
1026<p>Also accepts a comma-delimited string.</p>
1027<h4 id="offline"><code>offline</code></h4>
1028<ul>
1029<li>Default: false</li>
1030<li>Type: Boolean</li>
1031</ul>
1032<p>Force offline mode: no network requests will be done during install. To
1033allow the CLI to fill in missing cache data, see <code>--prefer-offline</code>.</p>
1034<h4 id="omit"><code>omit</code></h4>
1035<ul>
1036<li>Default: 'dev' if the <code>NODE_ENV</code> environment variable is set to
1037'production'; otherwise, empty.</li>
1038<li>Type: "dev", "optional", or "peer" (can be set multiple times)</li>
1039</ul>
1040<p>Dependency types to omit from the installation tree on disk.</p>
1041<p>Note that these dependencies <em>are</em> still resolved and added to the
1042<code>package-lock.json</code> or <code>npm-shrinkwrap.json</code> file. They are just not
1043physically installed on disk.</p>
1044<p>If a package type appears in both the <code>--include</code> and <code>--omit</code> lists, then
1045it will be included.</p>
1046<p>If the resulting omit list includes <code>'dev'</code>, then the <code>NODE_ENV</code> environment
1047variable will be set to <code>'production'</code> for all lifecycle scripts.</p>
1048<h4 id="omit-lockfile-registry-resolved"><code>omit-lockfile-registry-resolved</code></h4>
1049<ul>
1050<li>Default: false</li>
1051<li>Type: Boolean</li>
1052</ul>
1053<p>This option causes npm to create lock files without a <code>resolved</code> key for
1054registry dependencies. Subsequent installs will need to resolve tarball
1055endpoints with the configured registry, likely resulting in a longer install
1056time.</p>
1057<h4 id="orgs"><code>orgs</code></h4>
1058<ul>
1059<li>Default: null</li>
1060<li>Type: null or String (can be set multiple times)</li>
1061</ul>
1062<p>When creating a Granular Access Token with <code>npm token create</code>, this limits
1063the token access to specific organizations.</p>
1064<h4 id="orgs-permission"><code>orgs-permission</code></h4>
1065<ul>
1066<li>Default: null</li>
1067<li>Type: null, "read-only", "read-write", or "no-access"</li>
1068</ul>
1069<p>When creating a Granular Access Token with <code>npm token create</code>, sets the
1070permission level for organizations. Options are "read-only", "read-write",
1071or "no-access".</p>
1072<h4 id="os"><code>os</code></h4>
1073<ul>
1074<li>Default: null</li>
1075<li>Type: null or String</li>
1076</ul>
1077<p>Override OS of native modules to install. Acceptable values are same as <code>os</code>
1078field of package.json, which comes from <code>process.platform</code>.</p>
1079<h4 id="otp"><code>otp</code></h4>
1080<ul>
1081<li>Default: null</li>
1082<li>Type: null or String</li>
1083</ul>
1084<p>This is a one-time password from a two-factor authenticator. It's needed
1085when publishing or changing package permissions with <code>npm access</code>.</p>
1086<p>If not set, and a registry response fails with a challenge for a one-time
1087password, npm will prompt on the command line for one.</p>
1088<h4 id="pack-destination"><code>pack-destination</code></h4>
1089<ul>
1090<li>Default: "."</li>
1091<li>Type: String</li>
1092</ul>
1093<p>Directory in which <code>npm pack</code> will save tarballs.</p>
1094<h4 id="package"><code>package</code></h4>
1095<ul>
1096<li>Default:</li>
1097<li>Type: String (can be set multiple times)</li>
1098</ul>
1099<p>The package or packages to install for <a href="../commands/npm-exec.html"><code>npm exec</code></a></p>
1100<h4 id="package-lock"><code>package-lock</code></h4>
1101<ul>
1102<li>Default: true</li>
1103<li>Type: Boolean</li>
1104</ul>
1105<p>If set to false, then ignore <code>package-lock.json</code> files when installing. This
1106will also prevent <em>writing</em> <code>package-lock.json</code> if <code>save</code> is true.</p>
1107<h4 id="package-lock-only"><code>package-lock-only</code></h4>
1108<ul>
1109<li>Default: false</li>
1110<li>Type: Boolean</li>
1111</ul>
1112<p>If set to true, the current operation will only use the <code>package-lock.json</code>,
1113ignoring <code>node_modules</code>.</p>
1114<p>For <code>update</code> this means only the <code>package-lock.json</code> will be updated,
1115instead of checking <code>node_modules</code> and downloading dependencies.</p>
1116<p>For <code>list</code> this means the output will be based on the tree described by the
1117<code>package-lock.json</code>, rather than the contents of <code>node_modules</code>.</p>
1118<h4 id="packages"><code>packages</code></h4>
1119<ul>
1120<li>Default:</li>
1121<li>Type: null or String (can be set multiple times)</li>
1122</ul>
1123<p>When creating a Granular Access Token with <code>npm token create</code>, this limits
1124the token access to specific packages.</p>
1125<h4 id="packages-all"><code>packages-all</code></h4>
1126<ul>
1127<li>Default: false</li>
1128<li>Type: Boolean</li>
1129</ul>
1130<p>When creating a Granular Access Token with <code>npm token create</code>, grants the
1131token access to all packages instead of limiting to specific packages.</p>
1132<h4 id="packages-and-scopes-permission"><code>packages-and-scopes-permission</code></h4>
1133<ul>
1134<li>Default: null</li>
1135<li>Type: null, "read-only", "read-write", or "no-access"</li>
1136</ul>
1137<p>When creating a Granular Access Token with <code>npm token create</code>, sets the
1138permission level for packages and scopes. Options are "read-only",
1139"read-write", or "no-access".</p>
1140<h4 id="parseable"><code>parseable</code></h4>
1141<ul>
1142<li>Default: false</li>
1143<li>Type: Boolean</li>
1144</ul>
1145<p>Output parseable results from commands that write to standard output. For
1146<code>npm search</code>, this will be tab-separated table format.</p>
1147<h4 id="password"><code>password</code></h4>
1148<ul>
1149<li>Default: null</li>
1150<li>Type: null or String</li>
1151</ul>
1152<p>Password for authentication. Can be provided via command line when creating
1153tokens, though it's generally safer to be prompted for it.</p>
1154<h4 id="prefer-dedupe"><code>prefer-dedupe</code></h4>
1155<ul>
1156<li>Default: false</li>
1157<li>Type: Boolean</li>
1158</ul>
1159<p>Prefer to deduplicate packages if possible, rather than choosing a newer
1160version of a dependency.</p>
1161<h4 id="prefer-offline"><code>prefer-offline</code></h4>
1162<ul>
1163<li>Default: false</li>
1164<li>Type: Boolean</li>
1165</ul>
1166<p>If true, staleness checks for cached data will be bypassed, but missing data
1167will be requested from the server. To force full offline mode, use
1168<code>--offline</code>.</p>
1169<h4 id="prefer-online"><code>prefer-online</code></h4>
1170<ul>
1171<li>Default: false</li>
1172<li>Type: Boolean</li>
1173</ul>
1174<p>If true, staleness checks for cached data will be forced, making the CLI
1175look for updates immediately even for fresh package data.</p>
1176<h4 id="prefix"><code>prefix</code></h4>
1177<ul>
1178<li>Default: In global mode, the folder where the node executable is installed.
1179Otherwise, the nearest parent folder containing either a package.json file
1180or a node_modules folder.</li>
1181<li>Type: Path</li>
1182</ul>
1183<p>The location to install global items. If set on the command line, then it
1184forces non-global commands to run in the specified folder.</p>
1185<h4 id="preid"><code>preid</code></h4>
1186<ul>
1187<li>Default: ""</li>
1188<li>Type: String</li>
1189</ul>
1190<p>The "prerelease identifier" to use as a prefix for the "prerelease" part of
1191a semver. Like the <code>rc</code> in <code>1.2.0-rc.8</code>.</p>
1192<h4 id="progress"><code>progress</code></h4>
1193<ul>
1194<li>Default: <code>true</code> when not in CI and both stderr and stdout are TTYs and not
1195in a dumb terminal</li>
1196<li>Type: Boolean</li>
1197</ul>
1198<p>When set to <code>true</code>, npm will display a progress bar during time intensive
1199operations, if <code>process.stderr</code> and <code>process.stdout</code> are a TTY.</p>
1200<p>Set to <code>false</code> to suppress the progress bar.</p>
