Description
@@ -231,7 +231,7 @@
Shorthands and Other CLI Niceties
If the specified configuration param resolves unambiguously to a known
configuration parameter, then it is expanded to that configuration
parameter. For example:
-
npm ls --par
+npm ls --par
# same as:
npm ls --parseable
@@ -239,7 +239,7 @@ Shorthands and Other CLI Niceties
-npm ls -gpld
+npm ls -gpld
# same as:
npm ls --global --parseable --long --loglevel info
@@ -257,18 +257,16 @@ _auth
~/.npmrc file by running npm login
.
access
-- Default: 'restricted' for scoped packages, 'public' for unscoped packages
+- Default: 'public' for new packages, existing packages it will not change the
+current level
- Type: null, "restricted", or "public"
-When publishing scoped packages, the access level defaults to restricted
.
-If you want your scoped package to be publicly viewable (and installable)
-set --access=public
. The only valid values for access
are public
and
-restricted
. Unscoped packages always have an access level of public
.
-Note: Using the --access
flag on the npm publish
command will only set
-the package access level on the initial publish of the package. Any
-subsequent npm publish
commands using the --access
flag will not have an
-effect to the access level. To make changes to the access level after the
-initial publish use npm access
.
+If do not want your scoped package to be publicly viewable (and installable)
+set --access=restricted
.
+Unscoped packages can not be set to restricted
.
+Note: This defaults to not changing the current access level for existing
+packages. Specifying a value of restricted
or public
during publish will
+change the access for an existing package the same way that npm access set status
would.
all
- Default: false
@@ -302,11 +300,9 @@ audit-level
exit code.
auth-type
-- Default: "legacy"
-- Type: "legacy", "web", "sso", "saml", "oauth", or "webauthn"
+- Default: "web"
+- Type: "legacy" or "web"
-NOTE: auth-type values "sso", "saml", "oauth", and "webauthn" will be
-removed in a future version.
What authentication strategy to use with login
.
before
@@ -349,12 +345,12 @@ ca
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:
-
ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
+ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
Set to null
to only allow "known" registrars, or to a specific CA cert to
trust only that specific signing authority.
Multiple CAs can be trusted by specifying an array of certificates:
-ca[]="..."
+ca[]="..."
ca[]="..."
See also the strict-ssl
config.
@@ -363,7 +359,7 @@ cache
Default: Windows: %LocalAppData%\npm-cache
, Posix: ~/.npm
Type: Path
-The location of npm's cache directory. See npm cache
+The location of npm's cache directory.
cafile
- Default: null
@@ -379,21 +375,8 @@ call
Optional companion option for npm exec
, npx
that allows for specifying a
custom command to be run along with the installed packages.
-npm exec --package yo --package generator-node --call "yo node"
+npm exec --package yo --package generator-node --call "yo node"
-cert
-
-- Default: null
-- Type: null or String
-
-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:
-cert="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
-
-It is not the path to a certificate file, though you can set a
-registry-scoped "certfile" path like
-"//other-registry.tld/:certfile=/path/to/cert.pem".
ci-name
- Default: The name of the current CI system, or
null
when not on a known CI
@@ -402,7 +385,7 @@ ci-name
The name of a continuous integration system. If not set explicitly, npm will
detect the current CI environment using the
-@npmcli/ci-detect
module.
+ci-info
module.
cidr
-global-style
-
-- Default: false
-- Type: Boolean
-
-Causes npm to install the package into your local node_modules
folder with
-the same layout it uses with the global node_modules
folder. Only your
-direct dependencies will show in node_modules
and everything they depend
-on will be flattened in their node_modules
folders. This obviously will
-eliminate some deduping. If used with legacy-bundling
, legacy-bundling
-will be preferred.
globalconfig
- Default: The global --prefix setting plus 'etc/npmrc'. For example,
@@ -751,12 +723,23 @@
init-version
number, if not already set in package.json.
install-links
-- Default: false
+- Default: true
- Type: Boolean
-When set file: protocol dependencies that exist outside of the project root
-will be packed and installed as regular dependencies instead of creating a
-symlink. This option has no effect on workspaces.
+When set file: protocol dependencies will be packed and installed as regular
+dependencies instead of creating a symlink. This option has no effect on
+workspaces.
+install-strategy
+
+- Default: "hoisted"
+- Type: "hoisted", "nested", or "shallow"
+
+Sets the strategy for installing packages in node_modules. hoisted
+(default): Install non-duplicated in top-level, and duplicated as necessary
+within directory structure. nested: (formerly --legacy-bundling) install in
+place, no hoisting. shallow (formerly --global-style) only install direct
+deps at top-level. linked: (coming soon) install in node_modules/.store,
+link in place, unhoisted.
json
- Default: false
@@ -768,26 +751,6 @@ json
saving them to your package.json
.
Not supported by all npm commands.
-key
-
-- Default: null
-- Type: null or String
-
-A client key to pass when accessing the registry. Values should be in PEM
-format with newlines replaced by the string "\n". For example:
-key="-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----"
-
-It is not the path to a key file, though you can set a registry-scoped
-"keyfile" path like "//other-registry.tld/:keyfile=/path/to/key.pem".
-legacy-bundling
-
-- Default: false
-- Type: Boolean
-
-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 global-style
this option
-will be preferred.
legacy-peer-deps
- Default: false
@@ -833,8 +796,8 @@ location
lockfile-version
-- Default: Version 2 if no lockfile or current lockfile version less than or
-equal to 2, otherwise maintain current lockfile version
+- Default: Version 3 if no lockfile, auto-converting v1 lockfiles to v3,
+otherwise maintain current lockfile version.
- Type: null, 1, 2, 3, "1", "2", or "3"
Set the lockfile format version to be used in package-lock.json and
@@ -843,17 +806,17 @@
lockfile-version
is used during the install, resulting in slower and possibly less
deterministic installs. Prevents lockfile churn when interoperating with
older npm versions.
-2: The default lockfile version used by npm version 7. Includes both the
-version 1 lockfile data and version 3 lockfile data, for maximum determinism
-and interoperability, at the expense of more bytes on disk.
+2: The default lockfile version used by npm version 7 and 8. Includes both
+the version 1 lockfile data and version 3 lockfile data, for maximum
+determinism and interoperability, at the expense of more bytes on disk.
3: Only the new lockfile information introduced in npm version 7. Smaller on
disk than lockfile version 2, but not interoperable with older npm versions.
Ideal if all users are on npm version 7 and higher.
loglevel
- Default: "notice"
-- Type: "silent", "error", "warn", "notice", "http", "timing", "info",
-"verbose", or "silly"
+- Type: "silent", "error", "warn", "notice", "http", "info", "verbose", or
+"silly"
What level of logs to report. All logs are written to a debug log, with the
path to that file printed if the execution of a command fails.
@@ -902,12 +865,6 @@ node-options
Options to pass through to Node.js via the NODE_OPTIONS
environment
variable. This does not impact how npm itself is executed but it does impact
how lifecycle scripts are called.
-node-version
-
-- Default: Node.js
process.version
value
-- Type: SemVer string
-
-The node version to use when checking a package's engines
setting.
noproxy
- Default: The value of the NO_PROXY environment variable
@@ -915,12 +872,6 @@ noproxy
Domain extensions that should bypass any proxies.
Also accepts a comma-delimited string.
-npm-version
-
-- Default: Output of
npm --version
-- Type: SemVer string
-
-The npm version to use when checking a package's engines
setting.
offline
- Default: false
@@ -1016,8 +967,8 @@ prefer-online
prefix
- 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.
+Otherwise, the nearest parent folder containing either a package.json file
+or a node_modules folder.
- Type: Path
The location to install global items. If set on the command line, then it
@@ -1258,7 +1209,7 @@
tag-version-prefix
- Type: String
If set, alters the prefix used when tagging a new version when performing a
-version increment using npm-version
. To remove the prefix altogether, set
+version increment using npm version
. To remove the prefix altogether, set
it to the empty string: ""
.
Because other tools may rely on the convention that npm version tags look
like v1.0.0
, only use this property if it is absolutely necessary. In
@@ -1268,11 +1219,12 @@
timing
Default: false
Type: Boolean
-If true, writes a debug log to logs-dir
and timing information to
-_timing.json
in the cache, even if the command completes successfully.
-_timing.json
is a newline delimited list of JSON objects.
+If true, writes timing information to a process specific json file in the
+cache or logs-dir
. The file name ends with -timing.json
.
You can quickly view it with this json command line:
-npm exec -- json -g < ~/.npm/_timing.json
.
+cat ~/.npm/_logs/*-timing.json | npm exec -- json -g
.
+Timing information will also be reported in the terminal. To suppress this
+while still writing the timing file, use --silent
.
umask
- Default: 0
@@ -1436,6 +1388,23 @@ cache-min
- DEPRECATED: This option has been deprecated in favor of
--prefer-offline
.
--cache-min=9999 (or bigger)
is an alias for --prefer-offline
.
+cert
+
+- Default: null
+- Type: null or String
+- DEPRECATED:
key
and cert
are no longer used for most registry
+operations. Use registry scoped keyfile
and certfile
instead. Example:
+//other-registry.tld/:keyfile=/path/to/key.pem
+//other-registry.tld/:certfile=/path/to/cert.crt
+
+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:
+cert="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
+
+It is not the path to a certificate file, though you can set a
+registry-scoped "certfile" path like
+"//other-registry.tld/:certfile=/path/to/cert.pem".
dev
- Default: false
@@ -1443,6 +1412,15 @@ dev
- DEPRECATED: Please use --include=dev instead.
Alias for --include=dev
.
+global-style
+
+- Default: false
+- Type: Boolean
+- DEPRECATED: This option has been deprecated in favor of
+
--install-strategy=shallow
+
+Only install direct dependencies in the top level node_modules
, but hoist
+on deeper dependendencies. Sets --install-strategy=shallow
.
init.author.email
- Default: ""
@@ -1485,6 +1463,32 @@ init.version
- DEPRECATED: Use
--init-version
instead.
Alias for --init-version
+key
+
+- Default: null
+- Type: null or String
+- DEPRECATED:
key
and cert
are no longer used for most registry
+operations. Use registry scoped keyfile
and certfile
instead. Example:
+//other-registry.tld/:keyfile=/path/to/key.pem
+//other-registry.tld/:certfile=/path/to/cert.crt
+
+A client key to pass when accessing the registry. Values should be in PEM
+format with newlines replaced by the string "\n". For example:
+key="-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----"
+
+It is not the path to a key file, though you can set a registry-scoped
+"keyfile" path like "//other-registry.tld/:keyfile=/path/to/key.pem".
+legacy-bundling
+
+- Default: false
+- Type: Boolean
+- DEPRECATED: This option has been deprecated in favor of
+
--install-strategy=nested
+
+Instead of hoisting package installs in node_modules
, install packages in
+the same manner that they are depended on. This may cause very deep
+directory structures and duplicate package installs as there is no
+de-duplicating. Sets --install-strategy=nested
.
only
- Default: null
@@ -1515,23 +1519,6 @@ shrinkwrap
- DEPRECATED: Use the --package-lock setting instead.
Alias for --package-lock
-sso-poll-frequency
-
-- Default: 500
-- Type: Number
-- DEPRECATED: The --auth-type method of SSO/SAML/OAuth will be removed in a
-future version of npm in favor of web-based login.
-
-When used with SSO-enabled auth-type
s, configures how regularly the
-registry should be polled while the user is completing authentication.
-sso-type
-
-- Default: "oauth"
-- Type: null, "oauth", or "saml"
-- DEPRECATED: The --auth-type method of SSO/SAML/OAuth will be removed in a
-future version of npm in favor of web-based login.
-
-If --auth-type=sso
, the type of SSO type to use.
tmp
-
+