Lines Matching full:code
42 code {
49 pre > code {
145 …code>_auth</code></a></li><li><a href="#access"><code>access</code></a></li><li><a href="#all"><co…
149 <p>This article details npm configuration in general. To learn about the <code>config</code> comman…
150 see <a href="../commands/npm-config.html"><code>npm config</code></a>.</p>
153 <p>Putting <code>--foo bar</code> on the command line sets the <code>foo</code> configuration
154 parameter to <code>"bar"</code>. A <code>--</code> argument tells the cli parser to stop
155 reading flags. Using <code>--flag</code> without specifying any value will set
156 the value to <code>true</code>.</p>
157 <p>Example: <code>--flag1 --flag2</code> will set both configuration parameters
158 to <code>true</code>, while <code>--flag1 --flag2 bar</code> will set <code>flag1</code> to <code>t…
159 and <code>flag2</code> to <code>bar</code>. Finally, <code>--flag1 --flag2 -- bar</code> will set
160 both configuration parameters to <code>true</code>, and the <code>bar</code> is taken
163 <p>Any environment variables that start with <code>npm_config_</code> will be
165 <code>npm_config_foo=bar</code> in your environment will set the <code>foo</code>
166 configuration parameter to <code>bar</code>. Any environment configurations that
167 are not given a value will be given the value of <code>true</code>. Config
168 values are case-insensitive, so <code>NPM_CONFIG_FOO=bar</code> will work the
169 same. However, please note that inside <a href="../using-npm/scripts.html"><code>scripts</code></a>
173 <p>Notice that you need to use underscores instead of dashes, so <code>--allow-same-version</code>
174 would become <code>npm_config_allow_same_version=true</code>.</p>
178 <li>per-project configuration file (<code>/path/to/my/project/.npmrc</code>)</li>
179 <li>per-user configuration file (defaults to <code>$HOME/.npmrc</code>; configurable via CLI
180 option <code>--userconfig</code> or environment variable <code>$NPM_CONFIG_USERCONFIG</code>)</li>
181 <li>global configuration file (defaults to <code>$PREFIX/etc/npmrc</code>; configurable via
182 CLI option <code>--globalconfig</code> or environment variable <code>$NPM_CONFIG_GLOBALCONFIG</code…
183 <li>npm's built-in configuration file (<code>/path/to/npm/npmrc</code>)</li>
187 <p>Run <code>npm config ls -l</code> to see a set of configuration parameters that are
192 <li><code>-a</code>: <code>--all</code></li>
193 <li><code>--enjoy-by</code>: <code>--before</code></li>
194 <li><code>-c</code>: <code>--call</code></li>
195 <li><code>--desc</code>: <code>--description</code></li>
196 <li><code>-f</code>: <code>--force</code></li>
197 <li><code>-g</code>: <code>--global</code></li>
198 <li><code>--iwr</code>: <code>--include-workspace-root</code></li>
199 <li><code>-L</code>: <code>--location</code></li>
200 <li><code>-d</code>: <code>--loglevel info</code></li>
201 <li><code>-s</code>: <code>--loglevel silent</code></li>
202 <li><code>--silent</code>: <code>--loglevel silent</code></li>
203 <li><code>--ddd</code>: <code>--loglevel silly</code></li>
204 <li><code>--dd</code>: <code>--loglevel verbose</code></li>
205 <li><code>--verbose</code>: <code>--loglevel verbose</code></li>
206 <li><code>-q</code>: <code>--loglevel warn</code></li>
207 <li><code>--quiet</code>: <code>--loglevel warn</code></li>
208 <li><code>-l</code>: <code>--long</code></li>
209 <li><code>-m</code>: <code>--message</code></li>
210 <li><code>--local</code>: <code>--no-global</code></li>
211 <li><code>-n</code>: <code>--no-yes</code></li>
212 <li><code>--no</code>: <code>--no-yes</code></li>
213 <li><code>-p</code>: <code>--parseable</code></li>
214 <li><code>--porcelain</code>: <code>--parseable</code></li>
215 <li><code>-C</code>: <code>--prefix</code></li>
216 <li><code>--readonly</code>: <code>--read-only</code></li>
217 <li><code>--reg</code>: <code>--registry</code></li>
218 <li><code>-S</code>: <code>--save</code></li>
219 <li><code>-B</code>: <code>--save-bundle</code></li>
220 <li><code>-D</code>: <code>--save-dev</code></li>
221 <li><code>-E</code>: <code>--save-exact</code></li>
222 <li><code>-O</code>: <code>--save-optional</code></li>
223 <li><code>-P</code>: <code>--save-prod</code></li>
224 <li><code>-?</code>: <code>--usage</code></li>
225 <li><code>-h</code>: <code>--usage</code></li>
226 <li><code>-H</code>: <code>--usage</code></li>
227 <li><code>--help</code>: <code>--usage</code></li>
228 <li><code>-v</code>: <code>--version</code></li>
229 <li><code>-w</code>: <code>--workspace</code></li>
230 <li><code>--ws</code>: <code>--workspaces</code></li>
231 <li><code>-y</code>: <code>--yes</code></li>
236 <pre><code class="language-bash">npm ls --par
239 </code></pre>
244 <pre><code class="language-bash">npm ls -gpld
247 </code></pre>
249 <h4 id="auth"><code>_auth</code></h4>
259 ~/.npmrc file by running <code>npm login</code>.</p>
260 <h4 id="access"><code>access</code></h4>
267 installable) set <code>--access=restricted</code>.</p>
268 <p>Unscoped packages can not be set to <code>restricted</code>.</p>
270 packages. Specifying a value of <code>restricted</code> or <code>public</code> during publish will
271 change the access for an existing package the same way that <code>npm access set status</code> woul…
272 <h4 id="all"><code>all</code></h4>
277 <p>When running <code>npm outdated</code> and <code>npm ls</code>, setting <code>--all</code> will …
280 <h4 id="allow-same-version"><code>allow-same-version</code></h4>
285 <p>Prevents throwing an error when <code>npm version</code> is used to set the new version
287 <h4 id="audit"><code>audit</code></h4>
294 documentation for <a href="../commands/npm-audit.html"><code>npm audit</code></a> for details on wh…
296 <h4 id="audit-level"><code>audit-level</code></h4>
301 <p>The minimum level of vulnerability for <code>npm audit</code> to exit with a non-zero
302 exit code.</p>
303 <h4 id="auth-type"><code>auth-type</code></h4>
308 <p>What authentication strategy to use with <code>login</code>. Note that if an <code>otp</code>
309 config is given, this value will always be set to <code>legacy</code>.</p>
310 <h4 id="before"><code>before</code></h4>
315 <p>If passed to <code>npm install</code>, will rebuild the npm tree such that only
316 versions that were available <strong>on or before</strong> the <code>--before</code> time get
319 <p>If the requested version is a <code>dist-tag</code> and the given tag does not pass the
320 <code>--before</code> filter, the most recent version less than or equal to that tag
321 will be used. For example, <code>foo@latest</code> might install <code>foo@1.2</code> even though
322 <code>latest</code> is <code>2.0</code>.</p>
323 <h4 id="bin-links"><code>bin-links</code></h4>
328 <p>Tells npm to create symlinks (or <code>.cmd</code> shims on Windows) for package
333 <h4 id="browser"><code>browser</code></h4>
335 <li>Default: OS X: <code>"open"</code>, Windows: <code>"start"</code>, Others: <code>"xdg-open"</co…
339 <p>Set to <code>false</code> to suppress browser behavior and instead print urls to
341 <p>Set to <code>true</code> to use default system URL opener.</p>
342 <h4 id="ca"><code>ca</code></h4>
351 <pre><code class="language-ini">ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE--…
352 </code></pre>
353 <p>Set to <code>null</code> to only allow "known" registrars, or to a specific CA cert to
356 <pre><code class="language-ini">ca[]="..."
358 </code></pre>
359 <p>See also the <code>strict-ssl</code> config.</p>
360 <h4 id="cache"><code>cache</code></h4>
362 <li>Default: Windows: <code>%LocalAppData%\npm-cache</code>, Posix: <code>~/.npm</code></li>
366 <h4 id="cafile"><code>cafile</code></h4>
372 certificates. Similar to the <code>ca</code> setting, but allows for multiple CA's, as
374 <h4 id="call"><code>call</code></h4>
379 <p>Optional companion option for <code>npm exec</code>, <code>npx</code> that allows for specifying…
381 <pre><code class="language-bash">npm exec --package yo --package generator-node --call "yo node"
382 </code></pre>
383 <h4 id="cidr"><code>cidr</code></h4>
389 tokens with the <code>npm token create</code> command.</p>
390 <h4 id="color"><code>color</code></h4>
395 <p>If false, never shows colors. If <code>"always"</code> then always shows colors. If
397 <h4 id="commit-hooks"><code>commit-hooks</code></h4>
402 <p>Run git commit hooks when using the <code>npm version</code> command.</p>
403 <h4 id="cpu"><code>cpu</code></h4>
409 are same as <code>cpu</code> field of package.json, which comes from <code>process.arch</code>.</p>
410 <h4 id="depth"><code>depth</code></h4>
412 <li>Default: <code>Infinity</code> if <code>--all</code> is set, otherwise <code>1</code></li>
415 <p>The depth to go when recursing packages for <code>npm ls</code>.</p>
416 <p>If not set, <code>npm ls</code> will show only the immediate dependencies of the root
417 project. If <code>--all</code> is set, then npm will show all dependencies by default.</p>
418 <h4 id="description2"><code>description</code></h4>
423 <p>Show the description in <code>npm search</code></p>
424 <h4 id="diff"><code>diff</code></h4>
429 <p>Define arguments to compare in <code>npm diff</code>.</p>
430 <h4 id="diff-dst-prefix"><code>diff-dst-prefix</code></h4>
435 <p>Destination prefix to be used in <code>npm diff</code> output.</p>
436 <h4 id="diff-ignore-all-space"><code>diff-ignore-all-space</code></h4>
441 <p>Ignore whitespace when comparing lines in <code>npm diff</code>.</p>
442 <h4 id="diff-name-only"><code>diff-name-only</code></h4>
447 <p>Prints only filenames when using <code>npm diff</code>.</p>
448 <h4 id="diff-no-prefix"><code>diff-no-prefix</code></h4>
453 <p>Do not show any source or destination prefix in <code>npm diff</code> output.</p>
454 <p>Note: this causes <code>npm diff</code> to ignore the <code>--diff-src-prefix</code> and
455 <code>--diff-dst-prefix</code> configs.</p>
456 <h4 id="diff-src-prefix"><code>diff-src-prefix</code></h4>
461 <p>Source prefix to be used in <code>npm diff</code> output.</p>
462 <h4 id="diff-text"><code>diff-text</code></h4>
467 <p>Treat all files as text in <code>npm diff</code>.</p>
468 <h4 id="diff-unified"><code>diff-unified</code></h4>
473 <p>The number of lines of context to print in <code>npm diff</code>.</p>
474 <h4 id="dry-run"><code>dry-run</code></h4>
481 commands that modify your local installation, eg, <code>install</code>, <code>update</code>,
482 <code>dedupe</code>, <code>uninstall</code>, as well as <code>pack</code> and <code>publish</code>.…
483 <p>Note: This is NOT honored by other network related commands, eg <code>dist-tags</code>,
484 <code>owner</code>, etc.</p>
485 <h4 id="editor"><code>editor</code></h4>
491 <p>The command to run for <code>npm edit</code> and <code>npm config edit</code>.</p>
492 <h4 id="engine-strict"><code>engine-strict</code></h4>
500 <p>This can be overridden by setting the <code>--force</code> flag.</p>
501 <h4 id="expect-result-count"><code>expect-result-count</code></h4>
507 <p>This config can not be used with: <code>expect-results</code></p>
508 <h4 id="expect-results"><code>expect-results</code></h4>
515 <p>This config can not be used with: <code>expect-result-count</code></p>
516 <h4 id="fetch-retries"><code>fetch-retries</code></h4>
521 <p>The "retries" config for the <code>retry</code> module to use when fetching packages
525 <h4 id="fetch-retry-factor"><code>fetch-retry-factor</code></h4>
530 <p>The "factor" config for the <code>retry</code> module to use when fetching packages.</p>
531 <h4 id="fetch-retry-maxtimeout"><code>fetch-retry-maxtimeout</code></h4>
536 <p>The "maxTimeout" config for the <code>retry</code> module to use when fetching
538 <h4 id="fetch-retry-mintimeout"><code>fetch-retry-mintimeout</code></h4>
543 <p>The "minTimeout" config for the <code>retry</code> module to use when fetching
545 <h4 id="fetch-timeout"><code>fetch-timeout</code></h4>
551 <h4 id="force"><code>force</code></h4>
560 <li>Allow the <code>npm version</code> command to work on an unclean git repository.</li>
561 <li>Allow deleting the cache folder with <code>npm cache clean</code>.</li>
562 <li>Allow installing packages that have an <code>engines</code> declaration requiring a
564 <li>Allow installing packages that have an <code>engines</code> declaration requiring a
565 different version of <code>node</code>, even if <code>--engine-strict</code> is enabled.</li>
566 <li>Allow <code>npm audit fix</code> to install modules outside your stated dependency
570 <li>Implicitly set <code>--yes</code> during <code>npm init</code>.</li>
571 <li>Allow clobbering existing values in <code>npm pkg</code></li>
576 <h4 id="foreground-scripts"><code>foreground-scripts</code></h4>
578 <li>Default: <code>false</code> unless when using <code>npm pack</code> or <code>npm publish</code>…
579 defaults to <code>true</code></li>
582 <p>Run all build scripts (ie, <code>preinstall</code>, <code>install</code>, and <code>postinstall<…
587 <h4 id="format-package-lock"><code>format-package-lock</code></h4>
592 <p>Format <code>package-lock.json</code> or <code>npm-shrinkwrap.json</code> as a human readable
594 <h4 id="fund"><code>fund</code></h4>
599 <p>When "true" displays the message at the end of each <code>npm install</code>
600 …cies looking for funding. See <a href="../commands/npm-fund.html"><code>npm fund</code></a> for de…
601 <h4 id="git"><code>git</code></h4>
607 but is not in the <code>PATH</code>, then set this to the full path to the git binary.</p>
608 <h4 id="git-tag-version"><code>git-tag-version</code></h4>
613 <p>Tag the commit when using the <code>npm version</code> command. Setting this to false
615 <h4 id="global"><code>global</code></h4>
620 <p>Operates in "global" mode, so that packages are installed into the <code>prefix</code>
624 <li>packages are installed into the <code>{prefix}/lib/node_modules</code> folder, instead
626 <li>bin files are linked to <code>{prefix}/bin</code></li>
627 <li>man pages are linked to <code>{prefix}/share/man</code></li>
629 <h4 id="globalconfig"><code>globalconfig</code></h4>
636 <h4 id="heading"><code>heading</code></h4>
642 <h4 id="https-proxy"><code>https-proxy</code></h4>
647 <p>A proxy to use for outgoing https requests. If the <code>HTTPS_PROXY</code> or
648 <code>https_proxy</code> or <code>HTTP_PROXY</code> or <code>http_proxy</code> environment variable…
649 proxy settings will be honored by the underlying <code>make-fetch-happen</code>
651 <h4 id="if-present"><code>if-present</code></h4>
656 <p>If true, npm will not exit with an error code when <code>run-script</code> is invoked
657 for a script that isn't defined in the <code>scripts</code> section of <code>package.json</code>.
663 <h4 id="ignore-scripts"><code>ignore-scripts</code></h4>
670 <code>npm start</code>, <code>npm stop</code>, <code>npm restart</code>, <code>npm test</code>, and…
671 will still run their intended script if <code>ignore-scripts</code> is set, but they
673 <h4 id="include"><code>include</code></h4>
679 <p>This is the inverse of <code>--omit=<type></code>.</p>
680 <p>Dependency types specified in <code>--include</code> will not be omitted, regardless of
682 <h4 id="include-staged"><code>include-staged</code></h4>
690 <h4 id="include-workspace-root"><code>include-workspace-root</code></h4>
696 <p>When false, specifying individual workspaces via the <code>workspace</code> config, or
697 all workspaces via the <code>workspaces</code> flag, will cause npm to operate only on
700 <h4 id="init-author-email"><code>init-author-email</code></h4>
705 <p>The value <code>npm init</code> should use by default for the package author's email.</p>
706 <h4 id="init-author-name"><code>init-author-name</code></h4>
711 <p>The value <code>npm init</code> should use by default for the package author's name.</p>
712 <h4 id="init-author-url"><code>init-author-url</code></h4>
717 <p>The value <code>npm init</code> should use by default for the package author's
719 <h4 id="init-license"><code>init-license</code></h4>
724 <p>The value <code>npm init</code> should use by default for the package license.</p>
725 <h4 id="init-module"><code>init-module</code></h4>
730 <p>A module that will be loaded by the <code>npm init</code> command. See the
734 <h4 id="init-version"><code>init-version</code></h4>
739 <p>The value that <code>npm init</code> should use by default for the package version
741 <h4 id="install-links"><code>install-links</code></h4>
749 <h4 id="install-strategy"><code>install-strategy</code></h4>
760 <h4 id="json"><code>json</code></h4>
767 <li>In <code>npm pkg set</code> it enables parsing set values with JSON.parse() before
768 saving them to your <code>package.json</code>.</li>
771 <h4 id="legacy-peer-deps"><code>legacy-peer-deps</code></h4>
776 <p>Causes npm to completely ignore <code>peerDependencies</code> when building a package
778 <p>If a package cannot be installed because of overly strict <code>peerDependencies</code>
780 <p>This differs from <code>--omit=peer</code>, in that <code>--omit=peer</code> will avoid unpacking
781 <code>peerDependencies</code> on disk, but will still design a tree such that
782 <code>peerDependencies</code> <em>could</em> be unpacked in a correct place.</p>
783 <p>Use of <code>legacy-peer-deps</code> is not recommended, as it will not enforce the
784 <code>peerDependencies</code> contract that meta-dependencies may rely on.</p>
785 <h4 id="libc"><code>libc</code></h4>
791 <code>libc</code> field of package.json</p>
792 <h4 id="link"><code>link</code></h4>
797 <p>Used with <code>npm ls</code>, limiting output to only those packages that are linked.</p>
798 <h4 id="local-address"><code>local-address</code></h4>
805 <h4 id="location"><code>location</code></h4>
807 <li>Default: "user" unless <code>--global</code> is passed, which will also set this value
811 <p>When passed to <code>npm config</code> this refers to which config file to use.</p>
812 <p>When set to "global" mode, packages are installed into the <code>prefix</code> folder
816 <li>packages are installed into the <code>{prefix}/lib/node_modules</code> folder, instead
818 <li>bin files are linked to <code>{prefix}/bin</code></li>
819 <li>man pages are linked to <code>{prefix}/share/man</code></li>
821 <h4 id="lockfile-version"><code>lockfile-version</code></h4>
839 <h4 id="loglevel"><code>loglevel</code></h4>
849 <p>See also the <code>foreground-scripts</code> config.</p>
850 <h4 id="logs-dir"><code>logs-dir</code></h4>
852 <li>Default: A directory named <code>_logs</code> inside the cache</li>
855 …cation of npm's log directory. See <a href="../using-npm/logging.html"><code>npm logging</code></a>
857 <h4 id="logs-max"><code>logs-max</code></h4>
864 <h4 id="long"><code>long</code></h4>
869 <p>Show extended information in <code>ls</code>, <code>search</code>, and <code>help-search</code>.…
870 <h4 id="maxsockets"><code>maxsockets</code></h4>
877 <h4 id="message"><code>message</code></h4>
882 <p>Commit message which is used by <code>npm version</code> when creating version commit.</p>
884 <h4 id="node-options"><code>node-options</code></h4>
889 <p>Options to pass through to Node.js via the <code>NODE_OPTIONS</code> environment
892 <h4 id="noproxy"><code>noproxy</code></h4>
899 <h4 id="offline"><code>offline</code></h4>
905 allow the CLI to fill in missing cache data, see <code>--prefer-offline</code>.</p>
906 <h4 id="omit"><code>omit</code></h4>
908 <li>Default: 'dev' if the <code>NODE_ENV</code> environment variable is set to
914 <code>package-lock.json</code> or <code>npm-shrinkwrap.json</code> file. They are just not
916 <p>If a package type appears in both the <code>--include</code> and <code>--omit</code> lists, then
918 <p>If the resulting omit list includes <code>'dev'</code>, then the <code>NODE_ENV</code> environme…
919 variable will be set to <code>'production'</code> for all lifecycle scripts.</p>
920 <h4 id="omit-lockfile-registry-resolved"><code>omit-lockfile-registry-resolved</code></h4>
925 <p>This option causes npm to create lock files without a <code>resolved</code> key for
929 <h4 id="os"><code>os</code></h4>
934 <p>Override OS of native modules to install. Acceptable values are same as <code>os</code>
935 field of package.json, which comes from <code>process.platform</code>.</p>
936 <h4 id="otp"><code>otp</code></h4>
942 when publishing or changing package permissions with <code>npm access</code>.</p>
945 <h4 id="pack-destination"><code>pack-destination</code></h4>
950 <p>Directory in which <code>npm pack</code> will save tarballs.</p>
951 <h4 id="package"><code>package</code></h4>
956 <p>The package or packages to install for <a href="../commands/npm-exec.html"><code>npm exec</code>…
957 <h4 id="package-lock"><code>package-lock</code></h4>
962 <p>If set to false, then ignore <code>package-lock.json</code> files when installing. This
963 will also prevent <em>writing</em> <code>package-lock.json</code> if <code>save</code> is true.</p>
964 <h4 id="package-lock-only"><code>package-lock-only</code></h4>
969 <p>If set to true, the current operation will only use the <code>package-lock.json</code>,
970 ignoring <code>node_modules</code>.</p>
971 <p>For <code>update</code> this means only the <code>package-lock.json</code> will be updated,
972 instead of checking <code>node_modules</code> and downloading dependencies.</p>
973 <p>For <code>list</code> this means the output will be based on the tree described by the
974 <code>package-lock.json</code>, rather than the contents of <code>node_modules</code>.</p>
975 <h4 id="parseable"><code>parseable</code></h4>
981 <code>npm search</code>, this will be tab-separated table format.</p>
982 <h4 id="prefer-dedupe"><code>prefer-dedupe</code></h4>
989 <h4 id="prefer-offline"><code>prefer-offline</code></h4>
996 <code>--offline</code>.</p>
997 <h4 id="prefer-online"><code>prefer-online</code></h4>
1004 <h4 id="prefix"><code>prefix</code></h4>
1013 <h4 id="preid"><code>preid</code></h4>
1019 a semver. Like the <code>rc</code> in <code>1.2.0-rc.8</code>.</p>
1020 <h4 id="progress"><code>progress</code></h4>
1022 <li>Default: <code>true</code> unless running in a known CI system</li>
1025 <p>When set to <code>true</code>, npm will display a progress bar during time intensive
1026 operations, if <code>process.stderr</code> is a TTY.</p>
1027 <p>Set to <code>false</code> to suppress the progress bar.</p>
1028 <h4 id="provenance"><code>provenance</code></h4>
1035 <p>This config can not be used with: <code>provenance-file</code></p>
1036 <h4 id="provenance-file"><code>provenance-file</code></h4>
1042 <p>This config can not be used with: <code>provenance</code></p>
1043 <h4 id="proxy"><code>proxy</code></h4>
1048 <p>A proxy to use for outgoing http requests. If the <code>HTTP_PROXY</code> or
1049 <code>http_proxy</code> environment variables are set, proxy settings will be honored
1050 by the underlying <code>request</code> library.</p>
1051 <h4 id="read-only"><code>read-only</code></h4>
1057 access tokens with the <code>npm token create</code> command.</p>
1058 <h4 id="rebuild-bundle"><code>rebuild-bundle</code></h4>
1064 <h4 id="registry"><code>registry</code></h4>
1070 <h4 id="replace-registry-host"><code>replace-registry-host</code></h4>
1082 <h4 id="save"><code>save</code></h4>
1084 <li>Default: <code>true</code> unless when using <code>npm update</code> where it defaults to <code…
1087 <p>Save installed packages to a <code>package.json</code> file as dependencies.</p>
1088 <p>When used with the <code>npm rm</code> command, removes the dependency from
1089 <code>package.json</code>.</p>
1090 <p>Will also prevent writing to <code>package-lock.json</code> if set to <code>false</code>.</p>
1091 <h4 id="save-bundle"><code>save-bundle</code></h4>
1096 <p>If a package would be saved at install time by the use of <code>--save</code>,
1097 <code>--save-dev</code>, or <code>--save-optional</code>, then also put it in the
1098 <code>bundleDependencies</code> list.</p>
1099 <p>Ignored if <code>--save-peer</code> is set, since peerDependencies cannot be bundled.</p>
1100 <h4 id="save-dev"><code>save-dev</code></h4>
1105 <p>Save installed packages to a package.json file as <code>devDependencies</code>.</p>
1106 <h4 id="save-exact"><code>save-exact</code></h4>
1113 <h4 id="save-optional"><code>save-optional</code></h4>
1118 <p>Save installed packages to a package.json file as <code>optionalDependencies</code>.</p>
1119 <h4 id="save-peer"><code>save-peer</code></h4>
1124 <p>Save installed packages to a package.json file as <code>peerDependencies</code></p>
1125 <h4 id="save-prefix"><code>save-prefix</code></h4>
1131 <code>--save</code> or <code>--save-dev</code> get prefixed.</p>
1132 <p>For example if a package has version <code>1.2.3</code>, by default its version is set
1133 …code>^1.2.3</code> which allows minor upgrades for that package, but after <code>npm config set sa…
1135 <h4 id="save-prod"><code>save-prod</code></h4>
1140 <p>Save installed packages into <code>dependencies</code> specifically. This is useful if
1141 a package already exists in <code>devDependencies</code> or <code>optionalDependencies</code>, but
1143 <p>This is the default behavior if <code>--save</code> is true, and neither <code>--save-dev</code>
1144 or <code>--save-optional</code> are true.</p>
1145 <h4 id="sbom-format"><code>sbom-format</code></h4>
1151 <h4 id="sbom-type"><code>sbom-type</code></h4>
1157 value for the <code>primaryPackagePurpose</code> field. For CycloneDX, this is the
1158 value for the <code>type</code> field.</p>
1159 <h4 id="scope"><code>scope</code></h4>
1166 <pre><code># log in, linking the scope to the custom registry
1171 </code></pre>
1172 <p>This will cause <code>@mycorp</code> to be mapped to the registry for future
1174 <code>@mycorp/package</code>.</p>
1175 <p>This will also cause <code>npm init</code> to create a scoped package.</p>
1176 <pre><code># accept all defaults, and create a package named "@foo/whatever",
1179 </code></pre>
1180 <h4 id="script-shell"><code>script-shell</code></h4>
1185 …o use for scripts run with the <code>npm exec</code>, <code>npm run</code> and <code>npm init <…
1186 <h4 id="searchexclude"><code>searchexclude</code></h4>
1192 <h4 id="searchlimit"><code>searchlimit</code></h4>
1199 <h4 id="searchopts"><code>searchopts</code></h4>
1205 <h4 id="searchstaleness"><code>searchstaleness</code></h4>
1212 <h4 id="shell"><code>shell</code></h4>
1218 <p>The shell to run for the <code>npm explore</code> command.</p>
1219 <h4 id="sign-git-commit"><code>sign-git-commit</code></h4>
1224 <p>If set to true, then the <code>npm version</code> command will commit the new package
1225 version using <code>-S</code> to add a signature.</p>
1228 <h4 id="sign-git-tag"><code>sign-git-tag</code></h4>
1233 <p>If set to true, then the <code>npm version</code> command will tag the version using
1234 <code>-s</code> to add a signature.</p>
1237 <h4 id="strict-peer-deps"><code>strict-peer-deps</code></h4>
1242 <p>If set to <code>true</code>, and <code>--legacy-peer-deps</code> is not set, then <em>any</em>
1243 conflicting <code>peerDependencies</code> will be treated as an install failure, even
1246 <p>By default, conflicting <code>peerDependencies</code> deep in the dependency graph will
1249 the range set in their package's <code>peerDependencies</code> object.</p>
1251 conflict and the packages involved. If <code>--strict-peer-deps</code> is set, then
1253 <h4 id="strict-ssl"><code>strict-ssl</code></h4>
1260 <p>See also the <code>ca</code> config.</p>
1261 <h4 id="tag"><code>tag</code></h4>
1268 <p>Also the tag that is added to the package@version specified by the <code>npm tag</code>
1270 <p>When used by the <code>npm diff</code> command, this is the tag used to fetch the
1272 <h4 id="tag-version-prefix"><code>tag-version-prefix</code></h4>
1278 version increment using <code>npm version</code>. To remove the prefix altogether, set
1279 it to the empty string: <code>""</code>.</p>
1281 like <code>v1.0.0</code>, <em>only use this property if it is absolutely necessary</em>. In
1283 <h4 id="timing"><code>timing</code></h4>
1289 cache or <code>logs-dir</code>. The file name ends with <code>-timing.json</code>.</p>
1291 <code>cat ~/.npm/_logs/*-timing.json | npm exec -- json -g</code>.</p>
1293 while still writing the timing file, use <code>--silent</code>.</p>
1294 <h4 id="umask"><code>umask</code></h4>
1301 <p>Folders and executables are given a mode which is <code>0o777</code> masked against
1302 this value. Other files are given a mode which is <code>0o666</code> masked against
1306 rather adds the <code>--umask</code> config to it.</p>
1310 <h4 id="unicode"><code>unicode</code></h4>
1313 as defined by the <code>LC_ALL</code>, <code>LC_CTYPE</code>, or <code>LANG</code> environment vari…
1318 <h4 id="update-notifier"><code>update-notifier</code></h4>
1325 <h4 id="usage"><code>usage</code></h4>
1331 <h4 id="user-agent"><code>user-agent</code></h4>
1340 <li><code>{npm-version}</code> - The npm version in use</li>
1341 <li><code>{node-version}</code> - The Node.js version in use</li>
1342 <li><code>{platform}</code> - The value of <code>process.platform</code></li>
1343 <li><code>{arch}</code> - The value of <code>process.arch</code></li>
1344 <li><code>{workspaces}</code> - Set to <code>true</code> if the <code>workspaces</code> or <code>wo…
1346 <li><code>{ci}</code> - The value of the <code>ci-name</code> config, if set, prefixed with <code>c…
1347 an empty string if <code>ci-name</code> is empty.</li>
1349 <h4 id="userconfig"><code>userconfig</code></h4>
1355 <p>This may be overridden by the <code>npm_config_userconfig</code> environment variable
1356 or the <code>--userconfig</code> command line option, but may <em>not</em> be overridden by
1357 settings in the <code>globalconfig</code> file.</p>
1358 <h4 id="version"><code>version</code></h4>
1365 <h4 id="versions"><code>versions</code></h4>
1370 <p>If true, output the npm version as well as node's <code>process.versions</code> map and
1371 the version in the current working directory's <code>package.json</code> file if one
1374 <h4 id="viewer"><code>viewer</code></h4>
1380 <p>Set to <code>"browser"</code> to view html help content in the default web browser.</p>
1381 <h4 id="which"><code>which</code></h4>
1387 <h4 id="workspace"><code>workspace</code></h4>
1395 <p>Valid values for the <code>workspace</code> config are either:</p>
1402 <p>When set for the <code>npm init</code> command, this may be set to the folder of a
1406 <h4 id="workspaces"><code>workspaces</code></h4>
1413 <p>Explicitly setting this to false will cause commands like <code>install</code> to
1416 <li>Commands that operate on the <code>node_modules</code> tree (install, update, etc.)
1417 will link workspaces into the <code>node_modules</code> folder. - Commands that do
1419 <em>unless</em> one or more workspaces are specified in the <code>workspace</code> config.</li>
1422 <h4 id="workspaces-update"><code>workspaces-update</code></h4>
1428 possibly change the workspaces installed to the <code>node_modules</code> folder.</p>
1429 <h4 id="yes"><code>yes</code></h4>
1436 <h4 id="also"><code>also</code></h4>
1442 <p>When set to <code>dev</code> or <code>development</code>, this is an alias for <code>--include=d…
1443 <h4 id="cache-max"><code>cache-max</code></h4>
1447 <li>DEPRECATED: This option has been deprecated in favor of <code>--prefer-online</code></li>
1449 <p><code>--cache-max=0</code> is an alias for <code>--prefer-online</code></p>
1450 <h4 id="cache-min"><code>cache-min</code></h4>
1454 <li>DEPRECATED: This option has been deprecated in favor of <code>--prefer-offline</code>.</li>
1456 <p><code>--cache-min=9999 (or bigger)</code> is an alias for <code>--prefer-offline</code>.</p>
1457 <h4 id="cert"><code>cert</code></h4>
1461 <li>DEPRECATED: <code>key</code> and <code>cert</code> are no longer used for most registry
1462 operations. Use registry scoped <code>keyfile</code> and <code>certfile</code> instead. Example:
1469 <pre><code class="language-ini">cert="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE…
1470 </code></pre>
1474 <h4 id="dev"><code>dev</code></h4>
1480 <p>Alias for <code>--include=dev</code>.</p>
1481 <h4 id="global-style"><code>global-style</code></h4>
1486 <code>--install-strategy=shallow</code></li>
1488 <p>Only install direct dependencies in the top level <code>node_modules</code>, but hoist
1489 on deeper dependencies. Sets <code>--install-strategy=shallow</code>.</p>
1490 <h4 id="initauthoremail"><code>init.author.email</code></h4>
1494 <li>DEPRECATED: Use <code>--init-author-email</code> instead.</li>
1496 <p>Alias for <code>--init-author-email</code></p>
1497 <h4 id="initauthorname"><code>init.author.name</code></h4>
1501 <li>DEPRECATED: Use <code>--init-author-name</code> instead.</li>
1503 <p>Alias for <code>--init-author-name</code></p>
1504 <h4 id="initauthorurl"><code>init.author.url</code></h4>
1508 <li>DEPRECATED: Use <code>--init-author-url</code> instead.</li>
1510 <p>Alias for <code>--init-author-url</code></p>
1511 <h4 id="initlicense"><code>init.license</code></h4>
1515 <li>DEPRECATED: Use <code>--init-license</code> instead.</li>
1517 <p>Alias for <code>--init-license</code></p>
1518 <h4 id="initmodule"><code>init.module</code></h4>
1522 <li>DEPRECATED: Use <code>--init-module</code> instead.</li>
1524 <p>Alias for <code>--init-module</code></p>
1525 <h4 id="initversion"><code>init.version</code></h4>
1529 <li>DEPRECATED: Use <code>--init-version</code> instead.</li>
1531 <p>Alias for <code>--init-version</code></p>
1532 <h4 id="key"><code>key</code></h4>
1536 <li>DEPRECATED: <code>key</code> and <code>cert</code> are no longer used for most registry
1537 operations. Use registry scoped <code>keyfile</code> and <code>certfile</code> instead. Example:
1543 <pre><code class="language-ini">key="-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-…
1544 </code></pre>
1547 <h4 id="legacy-bundling"><code>legacy-bundling</code></h4>
1552 <code>--install-strategy=nested</code></li>
1554 <p>Instead of hoisting package installs in <code>node_modules</code>, install packages in
1557 de-duplicating. Sets <code>--install-strategy=nested</code>.</p>
1558 <h4 id="only"><code>only</code></h4>
1562 <li>DEPRECATED: Use <code>--omit=dev</code> to omit dev dependencies from the install.</li>
1564 <p>When set to <code>prod</code> or <code>production</code>, this is an alias for <code>--omit=dev<…
1565 <h4 id="optional"><code>optional</code></h4>
1569 <li>DEPRECATED: Use <code>--omit=optional</code> to exclude optional dependencies, or
1570 <code>--include=optional</code> to include them.</li>
1574 <h4 id="production"><code>production</code></h4>
1578 <li>DEPRECATED: Use <code>--omit=dev</code> instead.</li>
1580 <p>Alias for <code>--omit=dev</code></p>
1581 <h4 id="shrinkwrap"><code>shrinkwrap</code></h4>