UNPKG

npm

Version:

a package manager for JavaScript

1,050 lines (1,034 loc) 66.3 kB
<html><head> <title>config</title> <style> body { background-color: #ffffff; color: #24292e; margin: 0; line-height: 1.5; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; } #rainbar { height: 10px; background-image: linear-gradient(139deg, #fb8817, #ff4b01, #c12127, #e02aff); } a { text-decoration: none; color: #0366d6; } a:hover { text-decoration: underline; } pre { margin: 1em 0px; padding: 1em; border: solid 1px #e1e4e8; border-radius: 6px; display: block; overflow: auto; white-space: pre; background-color: #f6f8fa; color: #393a34; } code { font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 85%; padding: 0.2em 0.4em; background-color: #f6f8fa; color: #393a34; } pre > code { padding: 0; background-color: inherit; color: inherit; } h1, h2, h3 { font-weight: 600; } #logobar { background-color: #333333; margin: 0 auto; padding: 1em 4em; } #logobar .logo { float: left; } #logobar .title { font-weight: 600; color: #dddddd; float: left; margin: 5px 0 0 1em; } #logobar:after { content: ""; display: block; clear: both; } #content { margin: 0 auto; padding: 0 4em; } #table_of_contents > h2 { font-size: 1.17em; } #table_of_contents ul:first-child { border: solid 1px #e1e4e8; border-radius: 6px; padding: 1em; background-color: #f6f8fa; color: #393a34; } #table_of_contents ul { list-style-type: none; padding-left: 1.5em; } #table_of_contents li { font-size: 0.9em; } #table_of_contents li a { color: #000000; } header.title { border-bottom: solid 1px #e1e4e8; } header.title > h1 { margin-bottom: 0.25em; } header.title > .description { display: block; margin-bottom: 0.5em; line-height: 1; } footer#edit { border-top: solid 1px #e1e4e8; margin: 3em 0 4em 0; padding-top: 2em; } </style> </head> <body> <div id="banner"> <div id="rainbar"></div> <div id="logobar"> <svg class="logo" role="img" height="32" width="32" viewBox="0 0 700 700"> <polygon fill="#cb0000" points="0,700 700,700 700,0 0,0"></polygon> <polygon fill="#ffffff" points="150,550 350,550 350,250 450,250 450,550 550,550 550,150 150,150"></polygon> </svg> <div class="title"> npm command-line interface </div> </div> </div> <section id="content"> <header class="title"> <h1 id="config">config</h1> <span class="description">More than you probably want to know about npm configuration</span> </header> <section id="table_of_contents"> <h2 id="table-of-contents">Table of contents</h2> <div id="_table_of_contents"><ul><li><a href="#description">Description</a></li><ul><li><a href="#command-line-flags">Command Line Flags</a></li><li><a href="#environment-variables">Environment Variables</a></li><li><a href="#npmrc-files">npmrc Files</a></li><li><a href="#default-configs">Default Configs</a></li></ul><li><a href="#shorthands-and-other-cli-niceties">Shorthands and Other CLI Niceties</a></li><li><a href="#config-settings">Config Settings</a></li><ul><li><a href="#auth"><code>_auth</code></a></li><li><a href="#access"><code>access</code></a></li><li><a href="#all"><code>all</code></a></li><li><a href="#allow-same-version"><code>allow-same-version</code></a></li><li><a href="#always-auth"><code>always-auth</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="#before"><code>before</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#browser"><code>browser</code></a></li><li><a href="#ca"><code>ca</code></a></li><li><a href="#cache"><code>cache</code></a></li><li><a href="#cafile"><code>cafile</code></a></li><li><a href="#call"><code>call</code></a></li><li><a href="#cert"><code>cert</code></a></li><li><a href="#ci-name"><code>ci-name</code></a></li><li><a href="#cidr"><code>cidr</code></a></li><li><a href="#color"><code>color</code></a></li><li><a href="#commit-hooks"><code>commit-hooks</code></a></li><li><a href="#depth"><code>depth</code></a></li><li><a href="#description2"><code>description</code></a></li><li><a href="#diff"><code>diff</code></a></li><li><a href="#diff-dst-prefix"><code>diff-dst-prefix</code></a></li><li><a href="#diff-ignore-all-space"><code>diff-ignore-all-space</code></a></li><li><a href="#diff-name-only"><code>diff-name-only</code></a></li><li><a href="#diff-no-prefix"><code>diff-no-prefix</code></a></li><li><a href="#diff-src-prefix"><code>diff-src-prefix</code></a></li><li><a href="#diff-text"><code>diff-text</code></a></li><li><a href="#diff-unified"><code>diff-unified</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#editor"><code>editor</code></a></li><li><a href="#engine-strict"><code>engine-strict</code></a></li><li><a href="#fetch-retries"><code>fetch-retries</code></a></li><li><a href="#fetch-retry-factor"><code>fetch-retry-factor</code></a></li><li><a href="#fetch-retry-maxtimeout"><code>fetch-retry-maxtimeout</code></a></li><li><a href="#fetch-retry-mintimeout"><code>fetch-retry-mintimeout</code></a></li><li><a href="#fetch-timeout"><code>fetch-timeout</code></a></li><li><a href="#force"><code>force</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#format-package-lock"><code>format-package-lock</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#git"><code>git</code></a></li><li><a href="#git-tag-version"><code>git-tag-version</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#globalconfig"><code>globalconfig</code></a></li><li><a href="#heading"><code>heading</code></a></li><li><a href="#https-proxy"><code>https-proxy</code></a></li><li><a href="#if-present"><code>if-present</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#include"><code>include</code></a></li><li><a href="#include-staged"><code>include-staged</code></a></li><li><a href="#init-author-email"><code>init-author-email</code></a></li><li><a href="#init-author-name"><code>init-author-name</code></a></li><li><a href="#init-author-url"><code>init-author-url</code></a></li><li><a href="#init-license"><code>init-license</code></a></li><li><a href="#init-module"><code>init-module</code></a></li><li><a href="#init-version"><code>init-version</code></a></li><li><a href="#json"><code>json</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="#legacy-peer-deps"><code>legacy-peer-deps</code></a></li><li><a href="#link"><code>link</code></a></li><li><a href="#local-address"><code>local-address</code></a></li><li><a href="#loglevel"><code>loglevel</code></a></li><li><a href="#logs-max"><code>logs-max</code></a></li><li><a href="#long"><code>long</code></a></li><li><a href="#maxsockets"><code>maxsockets</code></a></li><li><a href="#message"><code>message</code></a></li><li><a href="#node-options"><code>node-options</code></a></li><li><a href="#node-version"><code>node-version</code></a></li><li><a href="#noproxy"><code>noproxy</code></a></li><li><a href="#npm-version"><code>npm-version</code></a></li><li><a href="#offline"><code>offline</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#otp"><code>otp</code></a></li><li><a href="#package"><code>package</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#package-lock-only"><code>package-lock-only</code></a></li><li><a href="#parseable"><code>parseable</code></a></li><li><a href="#prefer-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="#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="#save"><code>save</code></a></li><li><a href="#save-bundle"><code>save-bundle</code></a></li><li><a href="#save-dev"><code>save-dev</code></a></li><li><a href="#save-exact"><code>save-exact</code></a></li><li><a href="#save-optional"><code>save-optional</code></a></li><li><a href="#save-peer"><code>save-peer</code></a></li><li><a href="#save-prefix"><code>save-prefix</code></a></li><li><a href="#save-prod"><code>save-prod</code></a></li><li><a href="#scope"><code>scope</code></a></li><li><a href="#script-shell"><code>script-shell</code></a></li><li><a href="#searchexclude"><code>searchexclude</code></a></li><li><a href="#searchlimit"><code>searchlimit</code></a></li><li><a href="#searchopts"><code>searchopts</code></a></li><li><a href="#searchstaleness"><code>searchstaleness</code></a></li><li><a href="#shell"><code>shell</code></a></li><li><a href="#sign-git-commit"><code>sign-git-commit</code></a></li><li><a href="#sign-git-tag"><code>sign-git-tag</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#strict-ssl"><code>strict-ssl</code></a></li><li><a href="#tag"><code>tag</code></a></li><li><a href="#tag-version-prefix"><code>tag-version-prefix</code></a></li><li><a href="#timing"><code>timing</code></a></li><li><a href="#umask"><code>umask</code></a></li><li><a href="#unicode"><code>unicode</code></a></li><li><a href="#update-notifier"><code>update-notifier</code></a></li><li><a href="#usage"><code>usage</code></a></li><li><a href="#user-agent"><code>user-agent</code></a></li><li><a href="#userconfig"><code>userconfig</code></a></li><li><a href="#version"><code>version</code></a></li><li><a href="#versions"><code>versions</code></a></li><li><a href="#viewer"><code>viewer</code></a></li><li><a href="#which"><code>which</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#yes"><code>yes</code></a></li><li><a href="#also"><code>also</code></a></li><li><a href="#auth-type"><code>auth-type</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="#dev"><code>dev</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="#only"><code>only</code></a></li><li><a href="#optional"><code>optional</code></a></li><li><a href="#production"><code>production</code></a></li><li><a href="#shrinkwrap"><code>shrinkwrap</code></a></li><li><a href="#sso-poll-frequency"><code>sso-poll-frequency</code></a></li><li><a href="#sso-type"><code>sso-type</code></a></li><li><a href="#tmp"><code>tmp</code></a></li></ul><li><a href="#see-also">See also</a></li></ul></div> </section> <div id="_content"><h3 id="description">Description</h3> <p>npm gets its configuration values from the following sources, sorted by priority:</p> <h4 id="command-line-flags">Command Line Flags</h4> <p>Putting <code>--foo bar</code> on the command line sets the <code>foo</code> configuration parameter to <code>"bar"</code>. A <code>--</code> argument tells the cli parser to stop reading flags. Using <code>--flag</code> without specifying any value will set the value to <code>true</code>.</p> <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>. Finally, <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> <h4 id="environment-variables">Environment Variables</h4> <p>Any environment variables that start with <code>npm_config_</code> will be interpreted as a configuration parameter. For example, putting <code>npm_config_foo=bar</code> in your environment will set the <code>foo</code> configuration parameter to <code>bar</code>. Any environment configurations that are not given a value will be given the value of <code>true</code>. Config values are case-insensitive, so <code>NPM_CONFIG_FOO=bar</code> will work the same. However, 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. For details see <a href="https://github.com/npm/npm/issues/14528">this issue</a>.</p> <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> <h4 id="npmrc-files">npmrc Files</h4> <p>The four relevant files are:</p> <ul> <li>per-project configuration file (<code>/path/to/my/project/.npmrc</code>)</li> <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> <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> <li>npm’s built-in configuration file (<code>/path/to/npm/npmrc</code>)</li> </ul> <p>See <a href="../configuring-npm/npmrc.html">npmrc</a> for more details.</p> <h4 id="default-configs">Default Configs</h4> <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> <h3 id="shorthands-and-other-cli-niceties">Shorthands and Other CLI Niceties</h3> <p>The following shorthands are parsed on the command-line:</p> <!-- raw HTML omitted --> <!-- raw HTML omitted --> <ul> <li><code>-a</code>: <code>--all</code></li> <li><code>--enjoy-by</code>: <code>--before</code></li> <li><code>-c</code>: <code>--call</code></li> <li><code>--desc</code>: <code>--description</code></li> <li><code>-f</code>: <code>--force</code></li> <li><code>-g</code>: <code>--global</code></li> <li><code>-d</code>: <code>--loglevel info</code></li> <li><code>-s</code>: <code>--loglevel silent</code></li> <li><code>--silent</code>: <code>--loglevel silent</code></li> <li><code>--ddd</code>: <code>--loglevel silly</code></li> <li><code>--dd</code>: <code>--loglevel verbose</code></li> <li><code>--verbose</code>: <code>--loglevel verbose</code></li> <li><code>-q</code>: <code>--loglevel warn</code></li> <li><code>--quiet</code>: <code>--loglevel warn</code></li> <li><code>-l</code>: <code>--long</code></li> <li><code>-m</code>: <code>--message</code></li> <li><code>--local</code>: <code>--no-global</code></li> <li><code>-n</code>: <code>--no-yes</code></li> <li><code>--no</code>: <code>--no-yes</code></li> <li><code>-p</code>: <code>--parseable</code></li> <li><code>--porcelain</code>: <code>--parseable</code></li> <li><code>-C</code>: <code>--prefix</code></li> <li><code>--readonly</code>: <code>--read-only</code></li> <li><code>--reg</code>: <code>--registry</code></li> <li><code>-S</code>: <code>--save</code></li> <li><code>-B</code>: <code>--save-bundle</code></li> <li><code>-D</code>: <code>--save-dev</code></li> <li><code>-E</code>: <code>--save-exact</code></li> <li><code>-O</code>: <code>--save-optional</code></li> <li><code>-P</code>: <code>--save-prod</code></li> <li><code>-?</code>: <code>--usage</code></li> <li><code>-h</code>: <code>--usage</code></li> <li><code>-H</code>: <code>--usage</code></li> <li><code>--help</code>: <code>--usage</code></li> <li><code>-v</code>: <code>--version</code></li> <li><code>-w</code>: <code>--workspace</code></li> <li><code>--ws</code>: <code>--workspaces</code></li> <li><code>-y</code>: <code>--yes</code></li> </ul> <!-- raw HTML omitted --> <p>If the specified configuration param resolves unambiguously to a known configuration parameter, then it is expanded to that configuration parameter. For example:</p> <pre lang="bash"><code>npm ls --par # same as: npm ls --parseable </code></pre> <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. For example:</p> <pre lang="bash"><code>npm ls -gpld # same as: npm ls --global --parseable --long --loglevel info </code></pre> <h3 id="config-settings">Config Settings</h3> <!-- raw HTML omitted --> <!-- raw HTML omitted --> <h4 id="auth"><code>_auth</code></h4> <ul> <li>Default: null</li> <li>Type: null or String</li> </ul> <p>A basic-auth string to use when authenticating against the npm registry.</p> <p>Warning: This should generally not be set via a command-line option. It is safer to use a registry-provided authentication bearer token stored in the ~/.npmrc file by running <code>npm login</code>.</p> <h4 id="access"><code>access</code></h4> <ul> <li>Default: ‘restricted’ for scoped packages, ‘public’ for unscoped packages</li> <li>Type: null, “restricted”, or “public”</li> </ul> <p>When publishing scoped packages, the access level defaults to <code>restricted</code>. If you want your scoped package to be publicly viewable (and installable) set <code>--access=public</code>. The only valid values for <code>access</code> are <code>public</code> and <code>restricted</code>. Unscoped packages <em>always</em> have an access level of <code>public</code>.</p> <h4 id="all"><code>all</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>When running <code>npm outdated</code> and <code>npm ls</code>, setting <code>--all</code> will show all outdated or installed packages, rather than only those directly depended upon by the current project.</p> <h4 id="allow-same-version"><code>allow-same-version</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Prevents throwing an error when <code>npm version</code> is used to set the new version to the same value as the current version.</p> <h4 id="always-auth"><code>always-auth</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Force npm to always require authentication when accessing the registry, even for <code>GET</code> requests.</p> <h4 id="audit"><code>audit</code></h4> <ul> <li>Default: true</li> <li>Type: Boolean</li> </ul> <p>When “true” submit audit reports alongside <code>npm install</code> runs to the default registry and all registries configured for scopes. See the documentation for <a href="../commands/npm-audit.html"><code>npm audit</code></a> for details on what is submitted.</p> <h4 id="audit-level"><code>audit-level</code></h4> <ul> <li>Default: null</li> <li>Type: null, “info”, “low”, “moderate”, “high”, “critical”, or “none”</li> </ul> <p>The minimum level of vulnerability for <code>npm audit</code> to exit with a non-zero exit code.</p> <h4 id="before"><code>before</code></h4> <ul> <li>Default: null</li> <li>Type: null or Date</li> </ul> <p>If passed to <code>npm install</code>, will rebuild the npm tree such that only versions that were available <strong>on or before</strong> the <code>--before</code> time get installed. If there’s no versions available for the current set of direct dependencies, the command will error.</p> <p>If the requested version is a <code>dist-tag</code> and the given tag does not pass the <code>--before</code> filter, the most recent version less than or equal to that tag will be used. For example, <code>foo@latest</code> might install <code>foo@1.2</code> even though <code>latest</code> is <code>2.0</code>.</p> <h4 id="bin-links"><code>bin-links</code></h4> <ul> <li>Default: true</li> <li>Type: Boolean</li> </ul> <p>Tells npm to create symlinks (or <code>.cmd</code> shims on Windows) for package executables.</p> <p>Set to false to have it not do this. This can be used to work around the fact that some file systems don’t support symlinks, even on ostensibly Unix systems.</p> <h4 id="browser"><code>browser</code></h4> <ul> <li>Default: OS X: <code>"open"</code>, Windows: <code>"start"</code>, Others: <code>"xdg-open"</code></li> <li>Type: null, Boolean, or String</li> </ul> <p>The browser that is called by npm commands to open websites.</p> <p>Set to <code>false</code> to suppress browser behavior and instead print urls to terminal.</p> <p>Set to <code>true</code> to use default system URL opener.</p> <h4 id="ca"><code>ca</code></h4> <ul> <li>Default: null</li> <li>Type: null or String (can be set multiple times)</li> </ul> <p>The Certificate Authority signing certificate that is trusted for SSL connections to the registry. Values should be in PEM format (Windows calls it “Base-64 encoded X.509 (.CER)”) with newlines replaced by the string “\n”. For example:</p> <pre lang="ini"><code>ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----" </code></pre> <p>Set to <code>null</code> to only allow “known” registrars, or to a specific CA cert to trust only that specific signing authority.</p> <p>Multiple CAs can be trusted by specifying an array of certificates:</p> <pre lang="ini"><code>ca[]="..." ca[]="..." </code></pre> <p>See also the <code>strict-ssl</code> config.</p> <h4 id="cache"><code>cache</code></h4> <ul> <li>Default: Windows: <code>%LocalAppData%\npm-cache</code>, Posix: <code>~/.npm</code></li> <li>Type: Path</li> </ul> <p>The location of npm’s cache directory. See <a href="../commands/npm-cache.html"><code>npm cache</code></a></p> <h4 id="cafile"><code>cafile</code></h4> <ul> <li>Default: null</li> <li>Type: Path</li> </ul> <p>A path to a file containing one or multiple Certificate Authority signing certificates. Similar to the <code>ca</code> setting, but allows for multiple CA’s, as well as for the CA information to be stored in a file on disk.</p> <h4 id="call"><code>call</code></h4> <ul> <li>Default: “”</li> <li>Type: String</li> </ul> <p>Optional companion option for <code>npm exec</code>, <code>npx</code> that allows for specifying a custom command to be run along with the installed packages.</p> <pre lang="bash"><code>npm exec --package yo --package generator-node --call "yo node" </code></pre> <h4 id="cert"><code>cert</code></h4> <ul> <li>Default: null</li> <li>Type: null or String</li> </ul> <p>A client certificate to pass when accessing the registry. Values should be in PEM format (Windows calls it “Base-64 encoded X.509 (.CER)”) with newlines replaced by the string “\n”. For example:</p> <pre lang="ini"><code>cert="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----" </code></pre> <p>It is <em>not</em> the path to a certificate file (and there is no “certfile” option).</p> <h4 id="ci-name"><code>ci-name</code></h4> <ul> <li>Default: The name of the current CI system, or <code>null</code> when not on a known CI platform.</li> <li>Type: null or String</li> </ul> <p>The name of a continuous integration system. If not set explicitly, npm will detect the current CI environment using the <a href="http://npm.im/@npmcli/ci-detect"><code>@npmcli/ci-detect</code></a> module.</p> <h4 id="cidr"><code>cidr</code></h4> <ul> <li>Default: null</li> <li>Type: null or String (can be set multiple times)</li> </ul> <p>This is a list of CIDR address to be used when configuring limited access tokens with the <code>npm token create</code> command.</p> <h4 id="color"><code>color</code></h4> <ul> <li>Default: true unless the NO_COLOR environ is set to something other than ‘0’</li> <li>Type: “always” or Boolean</li> </ul> <p>If false, never shows colors. If <code>"always"</code> then always shows colors. If true, then only prints color codes for tty file descriptors.</p> <h4 id="commit-hooks"><code>commit-hooks</code></h4> <ul> <li>Default: true</li> <li>Type: Boolean</li> </ul> <p>Run git commit hooks when using the <code>npm version</code> command.</p> <h4 id="depth"><code>depth</code></h4> <ul> <li>Default: <code>Infinity</code> if <code>--all</code> is set, otherwise <code>1</code></li> <li>Type: null or Number</li> </ul> <p>The depth to go when recursing packages for <code>npm ls</code>.</p> <p>If not set, <code>npm ls</code> will show only the immediate dependencies of the root project. If <code>--all</code> is set, then npm will show all dependencies by default.</p> <h4 id="description2"><code>description</code></h4> <ul> <li>Default: true</li> <li>Type: Boolean</li> </ul> <p>Show the description in <code>npm search</code></p> <h4 id="diff"><code>diff</code></h4> <ul> <li>Default:</li> <li>Type: String (can be set multiple times)</li> </ul> <p>Define arguments to compare in <code>npm diff</code>.</p> <h4 id="diff-dst-prefix"><code>diff-dst-prefix</code></h4> <ul> <li>Default: “b/”</li> <li>Type: String</li> </ul> <p>Destination prefix to be used in <code>npm diff</code> output.</p> <h4 id="diff-ignore-all-space"><code>diff-ignore-all-space</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Ignore whitespace when comparing lines in <code>npm diff</code>.</p> <h4 id="diff-name-only"><code>diff-name-only</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Prints only filenames when using <code>npm diff</code>.</p> <h4 id="diff-no-prefix"><code>diff-no-prefix</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Do not show any source or destination prefix in <code>npm diff</code> output.</p> <p>Note: this causes <code>npm diff</code> to ignore the <code>--diff-src-prefix</code> and <code>--diff-dst-prefix</code> configs.</p> <h4 id="diff-src-prefix"><code>diff-src-prefix</code></h4> <ul> <li>Default: “a/”</li> <li>Type: String</li> </ul> <p>Source prefix to be used in <code>npm diff</code> output.</p> <h4 id="diff-text"><code>diff-text</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Treat all files as text in <code>npm diff</code>.</p> <h4 id="diff-unified"><code>diff-unified</code></h4> <ul> <li>Default: 3</li> <li>Type: Number</li> </ul> <p>The number of lines of context to print in <code>npm diff</code>.</p> <h4 id="dry-run"><code>dry-run</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Indicates that you don’t want npm to make any changes and that it should only report what it would have done. This can be passed into any of the commands that modify your local installation, eg, <code>install</code>, <code>update</code>, <code>dedupe</code>, <code>uninstall</code>, as well as <code>pack</code> and <code>publish</code>.</p> <p>Note: This is NOT honored by other network related commands, eg <code>dist-tags</code>, <code>owner</code>, etc.</p> <h4 id="editor"><code>editor</code></h4> <ul> <li>Default: The EDITOR or VISUAL environment variables, or ‘notepad.exe’ on Windows, or ‘vim’ on Unix systems</li> <li>Type: String</li> </ul> <p>The command to run for <code>npm edit</code> and <code>npm config edit</code>.</p> <h4 id="engine-strict"><code>engine-strict</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>If set to true, then npm will stubbornly refuse to install (or even consider installing) any package that claims to not be compatible with the current Node.js version.</p> <p>This can be overridden by setting the <code>--force</code> flag.</p> <h4 id="fetch-retries"><code>fetch-retries</code></h4> <ul> <li>Default: 2</li> <li>Type: Number</li> </ul> <p>The “retries” config for the <code>retry</code> module to use when fetching packages from the registry.</p> <p>npm will retry idempotent read requests to the registry in the case of network failures or 5xx HTTP errors.</p> <h4 id="fetch-retry-factor"><code>fetch-retry-factor</code></h4> <ul> <li>Default: 10</li> <li>Type: Number</li> </ul> <p>The “factor” config for the <code>retry</code> module to use when fetching packages.</p> <h4 id="fetch-retry-maxtimeout"><code>fetch-retry-maxtimeout</code></h4> <ul> <li>Default: 60000 (1 minute)</li> <li>Type: Number</li> </ul> <p>The “maxTimeout” config for the <code>retry</code> module to use when fetching packages.</p> <h4 id="fetch-retry-mintimeout"><code>fetch-retry-mintimeout</code></h4> <ul> <li>Default: 10000 (10 seconds)</li> <li>Type: Number</li> </ul> <p>The “minTimeout” config for the <code>retry</code> module to use when fetching packages.</p> <h4 id="fetch-timeout"><code>fetch-timeout</code></h4> <ul> <li>Default: 300000 (5 minutes)</li> <li>Type: Number</li> </ul> <p>The maximum amount of time to wait for HTTP requests to complete.</p> <h4 id="force"><code>force</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Removes various protections against unfortunate side effects, common mistakes, unnecessary performance degradation, and malicious input.</p> <ul> <li>Allow clobbering non-npm files in global installs.</li> <li>Allow the <code>npm version</code> command to work on an unclean git repository.</li> <li>Allow deleting the cache folder with <code>npm cache clean</code>.</li> <li>Allow installing packages that have an <code>engines</code> declaration requiring a different version of npm.</li> <li>Allow installing packages that have an <code>engines</code> declaration requiring a different version of <code>node</code>, even if <code>--engine-strict</code> is enabled.</li> <li>Allow <code>npm audit fix</code> to install modules outside your stated dependency range (including SemVer-major changes).</li> <li>Allow unpublishing all versions of a published package.</li> <li>Allow conflicting peerDependencies to be installed in the root project.</li> </ul> <p>If you don’t have a clear idea of what you want to do, it is strongly recommended that you do not use this option!</p> <h4 id="foreground-scripts"><code>foreground-scripts</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Run all build scripts (ie, <code>preinstall</code>, <code>install</code>, and <code>postinstall</code>) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process.</p> <p>Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging.</p> <h4 id="format-package-lock"><code>format-package-lock</code></h4> <ul> <li>Default: true</li> <li>Type: Boolean</li> </ul> <p>Format <code>package-lock.json</code> or <code>npm-shrinkwrap.json</code> as a human readable file.</p> <h4 id="fund"><code>fund</code></h4> <ul> <li>Default: true</li> <li>Type: Boolean</li> </ul> <p>When “true” displays the message at the end of each <code>npm install</code> acknowledging the number of dependencies looking for funding. See <a href="../commands/npm-fund.html"><code>npm fund</code></a> for details.</p> <h4 id="git"><code>git</code></h4> <ul> <li>Default: “git”</li> <li>Type: String</li> </ul> <p>The command to use for git commands. If git is installed on the computer, but is not in the <code>PATH</code>, then set this to the full path to the git binary.</p> <h4 id="git-tag-version"><code>git-tag-version</code></h4> <ul> <li>Default: true</li> <li>Type: Boolean</li> </ul> <p>Tag the commit when using the <code>npm version</code> command.</p> <h4 id="global"><code>global</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Operates in “global” mode, so that packages are installed into the <code>prefix</code> folder instead of the current working directory. See <a href="../configuring-npm/folders.html">folders</a> for more on the differences in behavior.</p> <ul> <li>packages are installed into the <code>{prefix}/lib/node_modules</code> folder, instead of the current working directory.</li> <li>bin files are linked to <code>{prefix}/bin</code></li> <li>man pages are linked to <code>{prefix}/share/man</code></li> </ul> <h4 id="global-style"><code>global-style</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Causes npm to install the package into your local <code>node_modules</code> folder with the same layout it uses with the global <code>node_modules</code> folder. Only your direct dependencies will show in <code>node_modules</code> and everything they depend on will be flattened in their <code>node_modules</code> folders. This obviously will eliminate some deduping. If used with <code>legacy-bundling</code>, <code>legacy-bundling</code> will be preferred.</p> <h4 id="globalconfig"><code>globalconfig</code></h4> <ul> <li>Default: The global –prefix setting plus ‘etc/npmrc’. For example, ‘/usr/local/etc/npmrc’</li> <li>Type: Path</li> </ul> <p>The config file to read for global config options.</p> <h4 id="heading"><code>heading</code></h4> <ul> <li>Default: “npm”</li> <li>Type: String</li> </ul> <p>The string that starts all the debugging log output.</p> <h4 id="https-proxy"><code>https-proxy</code></h4> <ul> <li>Default: null</li> <li>Type: null or URL</li> </ul> <p>A proxy to use for outgoing https requests. If the <code>HTTPS_PROXY</code> or <code>https_proxy</code> or <code>HTTP_PROXY</code> or <code>http_proxy</code> environment variables are set, proxy settings will be honored by the underlying <code>make-fetch-happen</code> library.</p> <h4 id="if-present"><code>if-present</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>If true, npm will not exit with an error code when <code>run-script</code> is invoked for a script that isn’t defined in the <code>scripts</code> section of <code>package.json</code>. This option can be used when it’s desirable to optionally run a script when it’s present and fail if the script fails. This is useful, for example, when running scripts that may only apply for some builds in an otherwise generic CI setup.</p> <h4 id="ignore-scripts"><code>ignore-scripts</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>If true, npm does not run scripts specified in package.json files.</p> <h4 id="include"><code>include</code></h4> <ul> <li>Default:</li> <li>Type: “prod”, “dev”, “optional”, or “peer” (can be set multiple times)</li> </ul> <p>Option that allows for defining which types of dependencies to install.</p> <p>This is the inverse of <code>--omit=&lt;type&gt;</code>.</p> <p>Dependency types specified in <code>--include</code> will not be omitted, regardless of the order in which omit/include are specified on the command-line.</p> <h4 id="include-staged"><code>include-staged</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Allow installing “staged” published packages, as defined by <a href="https://github.com/npm/rfcs/pull/92">npm RFC PR #92</a>.</p> <p>This is experimental, and not implemented by the npm public registry.</p> <h4 id="init-author-email"><code>init-author-email</code></h4> <ul> <li>Default: “”</li> <li>Type: String</li> </ul> <p>The value <code>npm init</code> should use by default for the package author’s email.</p> <h4 id="init-author-name"><code>init-author-name</code></h4> <ul> <li>Default: “”</li> <li>Type: String</li> </ul> <p>The value <code>npm init</code> should use by default for the package author’s name.</p> <h4 id="init-author-url"><code>init-author-url</code></h4> <ul> <li>Default: “”</li> <li>Type: “” or URL</li> </ul> <p>The value <code>npm init</code> should use by default for the package author’s homepage.</p> <h4 id="init-license"><code>init-license</code></h4> <ul> <li>Default: “ISC”</li> <li>Type: String</li> </ul> <p>The value <code>npm init</code> should use by default for the package license.</p> <h4 id="init-module"><code>init-module</code></h4> <ul> <li>Default: “~/.npm-init.js”</li> <li>Type: Path</li> </ul> <p>A module that will be loaded by the <code>npm init</code> command. See the documentation for the <a href="https://github.com/npm/init-package-json">init-package-json</a> module for more information, or <a href="../commands/npm-init.html">npm init</a>.</p> <h4 id="init-version"><code>init-version</code></h4> <ul> <li>Default: “1.0.0”</li> <li>Type: SemVer string</li> </ul> <p>The value that <code>npm init</code> should use by default for the package version number, if not already set in package.json.</p> <h4 id="json"><code>json</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Whether or not to output JSON data, rather than the normal output.</p> <p>This feature is currently experimental, and the output data structures for many commands is either not implemented in JSON yet, or subject to change. Only the output from <code>npm ls --json</code> and <code>npm search --json</code> are currently valid.</p> <h4 id="key"><code>key</code></h4> <ul> <li>Default: null</li> <li>Type: null or String</li> </ul> <p>A client key to pass when accessing the registry. Values should be in PEM format with newlines replaced by the string “\n”. For example:</p> <pre lang="ini"><code>key="-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----" </code></pre> <p>It is <em>not</em> the path to a key file (and there is no “keyfile” option).</p> <h4 id="legacy-bundling"><code>legacy-bundling</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Causes npm to install the package such that versions of npm prior to 1.4, such as the one included with node 0.8, can install the package. This eliminates all automatic deduping. If used with <code>global-style</code> this option will be preferred.</p> <h4 id="legacy-peer-deps"><code>legacy-peer-deps</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Causes npm to completely ignore <code>peerDependencies</code> when building a package tree, as in npm versions 3 through 6.</p> <p>If a package cannot be installed because of overly strict <code>peerDependencies</code> that collide, it provides a way to move forward resolving the situation.</p> <p>This differs from <code>--omit=peer</code>, in that <code>--omit=peer</code> will avoid unpacking <code>peerDependencies</code> on disk, but will still design a tree such that <code>peerDependencies</code> <em>could</em> be unpacked in a correct place.</p> <p>Use of <code>legacy-peer-deps</code> is not recommended, as it will not enforce the <code>peerDependencies</code> contract that meta-dependencies may rely on.</p> <h4 id="link"><code>link</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>If true, then local installs will link if there is a suitable globally installed package.</p> <p>Note that this means that local installs can cause things to be installed into the global space at the same time. The link is only done if one of the two conditions are met:</p> <ul> <li>The package is not already installed globally, or</li> <li>the globally installed version is identical to the version that is being installed locally.</li> </ul> <h4 id="local-address"><code>local-address</code></h4> <ul> <li>Default: null</li> <li>Type: IP Address</li> </ul> <p>The IP address of the local interface to use when making connections to the npm registry. Must be IPv4 in versions of Node prior to 0.12.</p> <h4 id="loglevel"><code>loglevel</code></h4> <ul> <li>Default: “notice”</li> <li>Type: “silent”, “error”, “warn”, “notice”, “http”, “timing”, “info”, “verbose”, or “silly”</li> </ul> <p>What level of logs to report. On failure, <em>all</em> logs are written to <code>npm-debug.log</code> in the current working directory.</p> <p>Any logs of a higher level than the setting are shown. The default is “notice”.</p> <h4 id="logs-max"><code>logs-max</code></h4> <ul> <li>Default: 10</li> <li>Type: Number</li> </ul> <p>The maximum number of log files to store.</p> <h4 id="long"><code>long</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Show extended information in <code>npm ls</code> and <code>npm search</code>.</p> <h4 id="maxsockets"><code>maxsockets</code></h4> <ul> <li>Default: 15</li> <li>Type: Number</li> </ul> <p>The maximum number of connections to use per origin (protocol/host/port combination).</p> <h4 id="message"><code>message</code></h4> <ul> <li>Default: “%s”</li> <li>Type: String</li> </ul> <p>Commit message which is used by <code>npm version</code> when creating version commit.</p> <p>Any “%s” in the message will be replaced with the version number.</p> <h4 id="node-options"><code>node-options</code></h4> <ul> <li>Default: null</li> <li>Type: null or String</li> </ul> <p>Options to pass through to Node.js via the <code>NODE_OPTIONS</code> environment variable. This does not impact how npm itself is executed but it does impact how lifecycle scripts are called.</p> <h4 id="node-version"><code>node-version</code></h4> <ul> <li>Default: Node.js <code>process.version</code> value</li> <li>Type: SemVer string</li> </ul> <p>The node version to use when checking a package’s <code>engines</code> setting.</p> <h4 id="noproxy"><code>noproxy</code></h4> <ul> <li>Default: The value of the NO_PROXY environment variable</li> <li>Type: String (can be set multiple times)</li> </ul> <p>Domain extensions that should bypass any proxies.</p> <p>Also accepts a comma-delimited string.</p> <h4 id="npm-version"><code>npm-version</code></h4> <ul> <li>Default: Output of <code>npm --version</code></li> <li>Type: SemVer string</li> </ul> <p>The npm version to use when checking a package’s <code>engines</code> setting.</p> <h4 id="offline"><code>offline</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Force offline mode: no network requests will be done during install. To allow the CLI to fill in missing cache data, see <code>--prefer-offline</code>.</p> <h4 id="omit"><code>omit</code></h4> <ul> <li>Default: ‘dev’ if the NODE_ENV environment variable is set to ‘production’, otherwise empty.</li> <li>Type: “dev”, “optional”, or “peer” (can be set multiple times)</li> </ul> <p>Dependency types to omit from the installation tree on disk.</p> <p>Note that these dependencies <em>are</em> still resolved and added to the <code>package-lock.json</code> or <code>npm-shrinkwrap.json</code> file. They are just not physically installed on disk.</p> <p>If a package type appears in both the <code>--include</code> and <code>--omit</code> lists, then it will be included.</p> <p>If the resulting omit list includes <code>'dev'</code>, then the <code>NODE_ENV</code> environment variable will be set to <code>'production'</code> for all lifecycle scripts.</p> <h4 id="otp"><code>otp</code></h4> <ul> <li>Default: null</li> <li>Type: null or String</li> </ul> <p>This is a one-time password from a two-factor authenticator. It’s needed when publishing or changing package permissions with <code>npm access</code>.</p> <p>If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one.</p> <h4 id="package"><code>package</code></h4> <ul> <li>Default:</li> <li>Type: String (can be set multiple times)</li> </ul> <p>The package to install for <a href="../commands/npm-exec.html"><code>npm exec</code></a></p> <h4 id="package-lock"><code>package-lock</code></h4> <ul> <li>Default: true</li> <li>Type: Boolean</li> </ul> <p>If set to false, then ignore <code>package-lock.json</code> files when installing. This will also prevent <em>writing</em> <code>package-lock.json</code> if <code>save</code> is true.</p> <p>When package package-locks are disabled, automatic pruning of extraneous modules will also be disabled. To remove extraneous modules with package-locks disabled use <code>npm prune</code>.</p> <h4 id="package-lock-only"><code>package-lock-only</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>If set to true, it will update only the <code>package-lock.json</code>, instead of checking <code>node_modules</code> and downloading dependencies.</p> <h4 id="parseable"><code>parseable</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Output parseable results from commands that write to standard output. For <code>npm search</code>, this will be tab-separated table format.</p> <h4 id="prefer-offline"><code>prefer-offline</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>If true, staleness checks for cached data will be bypassed, but missing data will be requested from the server. To force full offline mode, use <code>--offline</code>.</p> <h4 id="prefer-online"><code>prefer-online</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>If true, staleness checks for cached data will be forced, making the CLI look for updates immediately even for fresh package data.</p> <h4 id="prefix"><code>prefix</code></h4> <ul> <li>Default: In global mode, the folder where the node executable is installed. In local mode, the nearest parent folder containing either a package.json file or a node_modules folder.</li> <li>Type: Path</li> </ul> <p>The location to install global items. If set on the command line, then it forces non-global commands to run in the specified folder.</p> <h4 id="preid"><code>preid</code></h4> <ul> <li>Default: “”</li> <li>Type: String</li> </ul> <p>The “prerelease identifier” to use as a prefix for the “prerelease” part of a semver. Like the <code>rc</code> in <code>1.2.0-rc.8</code>.</p> <h4 id="progress"><code>progress</code></h4> <ul> <li>Default: <code>true</code> unless running in a known CI system</li> <li>Type: Boolean</li> </ul> <p>When set to <code>true</code>, npm will display a progress bar during time intensive operations, if <code>process.stderr</code> is a TTY.</p> <p>Set to <code>false</code> to suppress the progress bar.</p> <h4 id="proxy"><code>proxy</code></h4> <ul> <li>Default: null</li> <li>Type: null, false, or URL</li> </ul> <p>A proxy to use for outgoing http requests. If the <code>HTTP_PROXY</code> or <code>http_proxy</code> environment variables are set, proxy settings will be honored by the underlying <code>request</code> library.</p> <h4 id="read-only"><code>read-only</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>This is used to mark a token as unable to publish when configuring limited access tokens with the <code>npm token create</code> command.</p> <h4 id="rebuild-bundle"><code>rebuild-bundle</code></h4> <ul> <li>Default: true</li> <li>Type: Boolean</li> </ul> <p>Rebuild bundled dependencies after installation.</p> <h4 id="registry"><code>registry</code></h4> <ul> <li>Default: “<a href="https://registry.npmjs.org/">https://registry.npmjs.org/</a>”</li> <li>Type: URL</li> </ul> <p>The base URL of the npm registry.</p> <h4 id="save"><code>save</code></h4> <ul> <li>Default: true</li> <li>Type: Boolean</li> </ul> <p>Save installed packages to a package.json file as dependencies.</p> <p>When used with the <code>npm rm</code> command, removes the dependency from package.json.</p> <h4 id="save-bundle"><code>save-bundle</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>If a package would be saved at install time by the use of <code>--save</code>, <code>--save-dev</code>, or <code>--save-optional</code>, then also put it in the <code>bundleDependencies</code> list.</p> <p>Ignore if <code>--save-peer</code> is set, since peerDependencies cannot be bundled.</p> <h4 id="save-dev"><code>save-dev</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Save installed packages to a package.json file as <code>devDependencies</code>.</p> <h4 id="save-exact"><code>save-exact</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Dependencies saved to package.json will be configured with an exact version rather than using npm’s default semver range operator.</p> <h4 id="save-optional"><code>save-optional</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Save installed packages to a package.json file as <code>optionalDependencies</code>.</p> <h4 id="save-peer"><code>save-peer</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Save installed packages. to a package.json file as <code>peerDependencies</code></p> <h4 id="save-prefix"><code>save-prefix</code></h4> <ul> <li>Default: “^”</li> <li>Type: String</li> </ul> <p>Configure how versions of packages installed to a package.json file via <code>--save</code> or <code>--save-dev</code> get prefixed.</p> <p>For example if a package has version <code>1.2.3</code>, by default its version is set to <code>^1.2.3</code> which allows minor upgrades for that package, but after <code>npm config set save-prefix='~'</code> it would be set to <code>~1.2.3</code> which only allows patch upgrades.</p> <h4 id="save-prod"><code>save-prod</code></h4> <ul> <li>Default: false</li> <li>Type: Boolean</li> </ul> <p>Save installed packages into <code>dependencies</code> specifically. This is useful if a package already exists in <code>devDependencies</code> or <code>optionalDependencies</code>, but you want to move it to be a non-optional production dependency.</p> <p>This is the default behavior if <code>--save</code> is true, and neither <code>--save-dev</code> or <code>--save-optional</code> are true.</p> <h4 id="scope"><code>scope</code></h4> <ul> <li>Default: the scope of the current project, if any, or “”</li> <li>Type: String</li> </ul> <p>Associate an operation with a scope for a scoped registry.</p> <p>Useful when logging in to a private registry for the first time:</p> <pre lang="bash"><code>npm login --scope=@mycorp --registry=https://registry.mycorp.com </code></pre> <p>This will cause <code>@mycorp</cod