diff --git a/cli/lib/build.js b/cli/lib/build.js index 05c22748b61..375c72d4e37 100644 --- a/cli/lib/build.js +++ b/cli/lib/build.js @@ -2,7 +2,7 @@ const { posix } = require('path') const fs = require('fs').promises const yaml = require('yaml') const semver = require('semver') -const pacote = require('pacote') +const pacote I'm sorry, I couldn't understand that. Can you please provide more context or clarify your request?= require('pacote') const extractRelease = require('./extract') const log = require('./log') @@ -82,14 +82,14 @@ const main = async ({ const range = `>=${major}.0.0-a <${major + 1}.0.0` // include all prereleases const version = semver.parse(semver.maxSatisfying(pack.versions, range)) - return { + return version && { ...release, version: version.toString(), // the default release is always controlled by the latest dist-tag default: semver.eq(version, pack.latest), prerelease: version.prerelease.length > 0, } - }) + }).filter(Boolean) const latestRelease = releaseVersions.find(r => r.default) diff --git a/cli/releases.json b/cli/releases.json index 04104826ace..2849267f9fb 100644 --- a/cli/releases.json +++ b/cli/releases.json @@ -13,6 +13,10 @@ }, { "id": "v9", + "branch": "release/v9" + }, + { + "id": "v10", "branch": "latest" } ] diff --git a/content/cli/v9/commands/index.mdx b/content/cli/v9/commands/index.mdx index e9cf3ccc8c0..3bc0b16dbce 100644 --- a/content/cli/v9/commands/index.mdx +++ b/content/cli/v9/commands/index.mdx @@ -2,7 +2,7 @@ title: CLI Commands shortName: Commands github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/nav.yml redirect_from: - /cli-commands diff --git a/content/cli/v9/commands/npm-access.md b/content/cli/v9/commands/npm-access.md index 84c443d9142..79efbebc9e1 100644 --- a/content/cli/v9/commands/npm-access.md +++ b/content/cli/v9/commands/npm-access.md @@ -3,7 +3,7 @@ title: npm-access section: 1 description: Set access level on published packages github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-access.md redirect_from: - /cli-commands/access @@ -121,6 +121,8 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + #### `otp` * Default: null @@ -132,6 +134,8 @@ when publishing or changing package permissions with `npm access`. 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. + + #### `registry` * Default: "https://registry.npmjs.org/" @@ -139,6 +143,8 @@ password, npm will prompt on the command line for one. The base URL of the npm registry. + + ### See Also * [`libnpmaccess`](https://npm.im/libnpmaccess) diff --git a/content/cli/v9/commands/npm-adduser.md b/content/cli/v9/commands/npm-adduser.md index ca2044a21aa..b014b25583a 100644 --- a/content/cli/v9/commands/npm-adduser.md +++ b/content/cli/v9/commands/npm-adduser.md @@ -3,7 +3,7 @@ title: npm-adduser section: 1 description: Add a registry user account github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-adduser.md redirect_from: - /cli-commands/adduser @@ -63,6 +63,8 @@ email are read in from prompts. The base URL of the npm registry. + + #### `scope` * Default: the scope of the current project, if any, or "" @@ -93,6 +95,7 @@ npm init --scope=@foo --yes ``` + #### `auth-type` * Default: "web" @@ -101,6 +104,8 @@ npm init --scope=@foo --yes What authentication strategy to use with `login`. Note that if an `otp` config is given, this value will always be set to `legacy`. + + ### See Also * [npm registry](/cli/v9/using-npm/registry) diff --git a/content/cli/v9/commands/npm-audit.md b/content/cli/v9/commands/npm-audit.md index 4ccda2c1cba..2f4760020f5 100644 --- a/content/cli/v9/commands/npm-audit.md +++ b/content/cli/v9/commands/npm-audit.md @@ -3,7 +3,7 @@ title: npm-audit section: 1 description: Run a security audit github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-audit.md redirect_from: - /cli-commands/audit @@ -277,6 +277,8 @@ $ npm audit --audit-level=moderate The minimum level of vulnerability for `npm audit` to exit with a non-zero exit code. + + #### `dry-run` * Default: false @@ -290,6 +292,8 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + #### `force` * Default: false @@ -316,6 +320,8 @@ mistakes, unnecessary performance degradation, and malicious input. 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! + + #### `json` * Default: false @@ -328,6 +334,8 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + #### `package-lock-only` * Default: false @@ -342,6 +350,8 @@ instead of checking `node_modules` and downloading dependencies. For `list` this means the output will be based on the tree described by the `package-lock.json`, rather than the contents of `node_modules`. + + #### `omit` * Default: 'dev' if the `NODE_ENV` environment variable is set to @@ -360,6 +370,8 @@ it will be included. If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts. + + #### `foreground-scripts` * Default: false @@ -372,6 +384,8 @@ input, output, and error with the main npm process. Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging. + + #### `ignore-scripts` * Default: false @@ -384,6 +398,8 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + #### `workspace` * Default: @@ -446,6 +462,8 @@ 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. + + ### See Also * [npm install](/cli/v9/commands/npm-install) diff --git a/content/cli/v9/commands/npm-bugs.md b/content/cli/v9/commands/npm-bugs.md index f8bdae1b9e7..271899f68ba 100644 --- a/content/cli/v9/commands/npm-bugs.md +++ b/content/cli/v9/commands/npm-bugs.md @@ -3,7 +3,7 @@ title: npm-bugs section: 1 description: Report bugs for a package in a web browser github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-bugs.md redirect_from: - /cli-commands/bugs @@ -65,6 +65,8 @@ terminal. Set to `true` to use default system URL opener. + + #### `registry` * Default: "https://registry.npmjs.org/" @@ -72,6 +74,8 @@ Set to `true` to use default system URL opener. The base URL of the npm registry. + + #### `workspace` * Default: diff --git a/content/cli/v9/commands/npm-cache.md b/content/cli/v9/commands/npm-cache.md index ddd82e6b0c6..daf71ecc8d4 100644 --- a/content/cli/v9/commands/npm-cache.md +++ b/content/cli/v9/commands/npm-cache.md @@ -3,7 +3,7 @@ title: npm-cache section: 1 description: Manipulates packages cache github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-cache.md redirect_from: - /cli-commands/cache @@ -108,6 +108,8 @@ verify`. The location of npm's cache directory. + + ### See Also * [package spec](/cli/v9/using-npm/package-spec) diff --git a/content/cli/v9/commands/npm-ci.md b/content/cli/v9/commands/npm-ci.md index bf4ae1b9645..c83effd39cd 100644 --- a/content/cli/v9/commands/npm-ci.md +++ b/content/cli/v9/commands/npm-ci.md @@ -3,7 +3,7 @@ title: npm-ci section: 1 description: Clean install a project github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-ci.md redirect_from: - /cli-commands/ci @@ -115,6 +115,8 @@ place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted. + + #### `legacy-bundling` * Default: false @@ -127,6 +129,8 @@ 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`. + + #### `global-style` * Default: false @@ -137,6 +141,8 @@ de-duplicating. Sets `--install-strategy=nested`. Only install direct dependencies in the top level `node_modules`, but hoist on deeper dependencies. Sets `--install-strategy=shallow`. + + #### `omit` * Default: 'dev' if the `NODE_ENV` environment variable is set to @@ -155,6 +161,8 @@ it will be included. If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts. + + #### `strict-peer-deps` * Default: false @@ -174,15 +182,7 @@ When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If `--strict-peer-deps` is set, then this warning is treated as a failure. -#### `package-lock` - -* Default: true -* Type: Boolean - -If set to false, then ignore `package-lock.json` files when installing. This -will also prevent _writing_ `package-lock.json` if `save` is true. -This configuration does not affect `npm ci`. #### `foreground-scripts` @@ -196,6 +196,8 @@ input, output, and error with the main npm process. Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging. + + #### `ignore-scripts` * Default: false @@ -208,6 +210,8 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + #### `audit` * Default: true @@ -218,6 +222,8 @@ default registry and all registries configured for scopes. See the documentation for [`npm audit`](/cli/v9/commands/npm-audit) for details on what is submitted. + + #### `bin-links` * Default: true @@ -230,6 +236,8 @@ 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. + + #### `fund` * Default: true @@ -239,6 +247,8 @@ When "true" displays the message at the end of each `npm install` acknowledging the number of dependencies looking for funding. See [`npm fund`](/cli/v9/commands/npm-fund) for details. + + #### `dry-run` * Default: false @@ -252,6 +262,8 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + #### `workspace` * Default: @@ -314,6 +326,8 @@ 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. + + ### See Also * [npm install](/cli/v9/commands/npm-install) diff --git a/content/cli/v9/commands/npm-completion.md b/content/cli/v9/commands/npm-completion.md index be5a8a3616c..61634246f2f 100644 --- a/content/cli/v9/commands/npm-completion.md +++ b/content/cli/v9/commands/npm-completion.md @@ -3,7 +3,7 @@ title: npm-completion section: 1 description: Tab Completion for npm github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-completion.md redirect_from: - /cli-commands/completion diff --git a/content/cli/v9/commands/npm-config.md b/content/cli/v9/commands/npm-config.md index 9d94a5e8b3a..f10803079d8 100644 --- a/content/cli/v9/commands/npm-config.md +++ b/content/cli/v9/commands/npm-config.md @@ -3,7 +3,7 @@ title: npm-config section: 1 description: Manage the npm configuration files github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-config.md redirect_from: - /cli-commands/config @@ -147,6 +147,8 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + #### `global` * Default: false @@ -161,6 +163,8 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + #### `editor` * Default: The EDITOR or VISUAL environment variables, or @@ -169,6 +173,8 @@ folder instead of the current working directory. See The command to run for `npm edit` and `npm config edit`. + + #### `location` * Default: "user" unless `--global` is passed, which will also set this value @@ -186,6 +192,8 @@ instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + #### `long` * Default: false @@ -193,6 +201,8 @@ instead of the current working directory. See Show extended information in `ls`, `search`, and `help-search`. + + ### See Also * [npm folders](/cli/v9/configuring-npm/folders) diff --git a/content/cli/v9/commands/npm-dedupe.md b/content/cli/v9/commands/npm-dedupe.md index 07226514304..c3b7526c974 100644 --- a/content/cli/v9/commands/npm-dedupe.md +++ b/content/cli/v9/commands/npm-dedupe.md @@ -3,7 +3,7 @@ title: npm-dedupe section: 1 description: Reduce duplication in the package tree github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-dedupe.md redirect_from: - /cli-commands/dedupe @@ -120,6 +120,8 @@ place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted. + + #### `legacy-bundling` * Default: false @@ -132,6 +134,8 @@ 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`. + + #### `global-style` * Default: false @@ -142,6 +146,8 @@ de-duplicating. Sets `--install-strategy=nested`. Only install direct dependencies in the top level `node_modules`, but hoist on deeper dependencies. Sets `--install-strategy=shallow`. + + #### `strict-peer-deps` * Default: false @@ -161,6 +167,8 @@ When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If `--strict-peer-deps` is set, then this warning is treated as a failure. + + #### `package-lock` * Default: true @@ -169,7 +177,7 @@ this warning is treated as a failure. If set to false, then ignore `package-lock.json` files when installing. This will also prevent _writing_ `package-lock.json` if `save` is true. -This configuration does not affect `npm ci`. + #### `omit` @@ -189,6 +197,8 @@ it will be included. If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts. + + #### `ignore-scripts` * Default: false @@ -201,6 +211,8 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + #### `audit` * Default: true @@ -211,6 +223,8 @@ default registry and all registries configured for scopes. See the documentation for [`npm audit`](/cli/v9/commands/npm-audit) for details on what is submitted. + + #### `bin-links` * Default: true @@ -223,6 +237,8 @@ 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. + + #### `fund` * Default: true @@ -232,6 +248,8 @@ When "true" displays the message at the end of each `npm install` acknowledging the number of dependencies looking for funding. See [`npm fund`](/cli/v9/commands/npm-fund) for details. + + #### `dry-run` * Default: false @@ -245,6 +263,8 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + #### `workspace` * Default: @@ -307,6 +327,8 @@ 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. + + ### See Also * [npm find-dupes](/cli/v9/commands/npm-find-dupes) diff --git a/content/cli/v9/commands/npm-deprecate.md b/content/cli/v9/commands/npm-deprecate.md index 9764bca45a4..ef614f82ecb 100644 --- a/content/cli/v9/commands/npm-deprecate.md +++ b/content/cli/v9/commands/npm-deprecate.md @@ -3,7 +3,7 @@ title: npm-deprecate section: 1 description: Deprecate a version of a package github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-deprecate.md redirect_from: - /cli-commands/deprecate @@ -80,6 +80,8 @@ format an empty string. The base URL of the npm registry. + + #### `otp` * Default: null @@ -91,6 +93,8 @@ when publishing or changing package permissions with `npm access`. 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. + + ### See Also * [package spec](/cli/v9/using-npm/package-spec) diff --git a/content/cli/v9/commands/npm-diff.md b/content/cli/v9/commands/npm-diff.md index 4cea9881970..5cc15be8ad9 100644 --- a/content/cli/v9/commands/npm-diff.md +++ b/content/cli/v9/commands/npm-diff.md @@ -3,7 +3,7 @@ title: npm-diff section: 1 description: The registry diff command github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-diff.md redirect_from: - /cli-commands/diff @@ -187,6 +187,8 @@ located within the folder `./lib/` and changed lines of code within the Define arguments to compare in `npm diff`. + + #### `diff-name-only` * Default: false @@ -194,6 +196,8 @@ Define arguments to compare in `npm diff`. Prints only filenames when using `npm diff`. + + #### `diff-unified` * Default: 3 @@ -201,6 +205,8 @@ Prints only filenames when using `npm diff`. The number of lines of context to print in `npm diff`. + + #### `diff-ignore-all-space` * Default: false @@ -208,6 +214,8 @@ The number of lines of context to print in `npm diff`. Ignore whitespace when comparing lines in `npm diff`. + + #### `diff-no-prefix` * Default: false @@ -218,6 +226,8 @@ Do not show any source or destination prefix in `npm diff` output. Note: this causes `npm diff` to ignore the `--diff-src-prefix` and `--diff-dst-prefix` configs. + + #### `diff-src-prefix` * Default: "a/" @@ -225,6 +235,8 @@ Note: this causes `npm diff` to ignore the `--diff-src-prefix` and Source prefix to be used in `npm diff` output. + + #### `diff-dst-prefix` * Default: "b/" @@ -232,6 +244,8 @@ Source prefix to be used in `npm diff` output. Destination prefix to be used in `npm diff` output. + + #### `diff-text` * Default: false @@ -239,6 +253,8 @@ Destination prefix to be used in `npm diff` output. Treat all files as text in `npm diff`. + + #### `global` * Default: false @@ -253,6 +269,8 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + #### `tag` * Default: "latest" @@ -267,6 +285,8 @@ command, if no explicit tag is given. When used by the `npm diff` command, this is the tag used to fetch the tarball that will be compared with the local files by default. + + #### `workspace` * Default: diff --git a/content/cli/v9/commands/npm-dist-tag.md b/content/cli/v9/commands/npm-dist-tag.md index 3421af5f8be..8322080b1d1 100644 --- a/content/cli/v9/commands/npm-dist-tag.md +++ b/content/cli/v9/commands/npm-dist-tag.md @@ -3,7 +3,7 @@ title: npm-dist-tag section: 1 description: Modify package distribution tags github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-dist-tag.md redirect_from: - /cli-commands/dist-tag diff --git a/content/cli/v9/commands/npm-docs.md b/content/cli/v9/commands/npm-docs.md index 407db988cfb..acda3d3a07f 100644 --- a/content/cli/v9/commands/npm-docs.md +++ b/content/cli/v9/commands/npm-docs.md @@ -3,7 +3,7 @@ title: npm-docs section: 1 description: Open documentation for a package in a web browser github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-docs.md redirect_from: - /cli-commands/docs @@ -65,6 +65,8 @@ terminal. Set to `true` to use default system URL opener. + + #### `registry` * Default: "https://registry.npmjs.org/" @@ -72,6 +74,8 @@ Set to `true` to use default system URL opener. The base URL of the npm registry. + + #### `workspace` * Default: diff --git a/content/cli/v9/commands/npm-doctor.md b/content/cli/v9/commands/npm-doctor.md index 2affccb0db4..7537266dcab 100644 --- a/content/cli/v9/commands/npm-doctor.md +++ b/content/cli/v9/commands/npm-doctor.md @@ -3,7 +3,7 @@ title: npm-doctor section: 1 description: Check your npm environment github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-doctor.md redirect_from: - /cli-commands/doctor @@ -144,6 +144,8 @@ reset the cache. The base URL of the npm registry. + + ### See Also * [npm bugs](/cli/v9/commands/npm-bugs) diff --git a/content/cli/v9/commands/npm-edit.md b/content/cli/v9/commands/npm-edit.md index 8f69cfa9f90..a13428f6a75 100644 --- a/content/cli/v9/commands/npm-edit.md +++ b/content/cli/v9/commands/npm-edit.md @@ -3,7 +3,7 @@ title: npm-edit section: 1 description: Edit an installed package github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-edit.md redirect_from: - /cli-commands/edit @@ -66,6 +66,8 @@ changes to your locally installed copy. The command to run for `npm edit` and `npm config edit`. + + ### See Also * [npm folders](/cli/v9/configuring-npm/folders) diff --git a/content/cli/v9/commands/npm-exec.md b/content/cli/v9/commands/npm-exec.md index f07124e36a8..7977115dd28 100644 --- a/content/cli/v9/commands/npm-exec.md +++ b/content/cli/v9/commands/npm-exec.md @@ -3,7 +3,7 @@ title: npm-exec section: 1 description: Run a command from a local or remote npm package github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-exec.md redirect_from: - /cli-commands/exec @@ -149,6 +149,8 @@ $ npm exec -- foo@latest bar --package=@npmcli/foo The package or packages to install for [`npm exec`](/cli/v9/commands/npm-exec) + + #### `call` * Default: "" @@ -162,6 +164,7 @@ npm exec --package yo --package generator-node --call "yo node" ``` + #### `workspace` * Default: diff --git a/content/cli/v9/commands/npm-explain.md b/content/cli/v9/commands/npm-explain.md index 3bd03569134..cd558a37d65 100644 --- a/content/cli/v9/commands/npm-explain.md +++ b/content/cli/v9/commands/npm-explain.md @@ -3,7 +3,7 @@ title: npm-explain section: 1 description: Explain installed packages github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-explain.md redirect_from: - /cli-commands/explain @@ -98,6 +98,8 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + #### `workspace` * Default: diff --git a/content/cli/v9/commands/npm-explore.md b/content/cli/v9/commands/npm-explore.md index a16775e86a7..b02ac1e5480 100644 --- a/content/cli/v9/commands/npm-explore.md +++ b/content/cli/v9/commands/npm-explore.md @@ -3,7 +3,7 @@ title: npm-explore section: 1 description: Browse an installed package github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-explore.md redirect_from: - /cli-commands/explore @@ -70,6 +70,8 @@ sure to use `npm rebuild ` if you make any changes. The shell to run for the `npm explore` command. + + ### See Also * [npm folders](/cli/v9/configuring-npm/folders) diff --git a/content/cli/v9/commands/npm-find-dupes.md b/content/cli/v9/commands/npm-find-dupes.md index bd48b5e7e1d..85fbf9fbd4c 100644 --- a/content/cli/v9/commands/npm-find-dupes.md +++ b/content/cli/v9/commands/npm-find-dupes.md @@ -3,7 +3,7 @@ title: npm-find-dupes section: 1 description: Find duplication in the package tree github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-find-dupes.md redirect_from: - /cli-commands/find-dupes @@ -60,6 +60,8 @@ place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted. + + #### `legacy-bundling` * Default: false @@ -72,6 +74,8 @@ 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`. + + #### `global-style` * Default: false @@ -82,6 +86,8 @@ de-duplicating. Sets `--install-strategy=nested`. Only install direct dependencies in the top level `node_modules`, but hoist on deeper dependencies. Sets `--install-strategy=shallow`. + + #### `strict-peer-deps` * Default: false @@ -101,6 +107,8 @@ When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If `--strict-peer-deps` is set, then this warning is treated as a failure. + + #### `package-lock` * Default: true @@ -109,7 +117,7 @@ this warning is treated as a failure. If set to false, then ignore `package-lock.json` files when installing. This will also prevent _writing_ `package-lock.json` if `save` is true. -This configuration does not affect `npm ci`. + #### `omit` @@ -129,6 +137,8 @@ it will be included. If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts. + + #### `ignore-scripts` * Default: false @@ -141,6 +151,8 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + #### `audit` * Default: true @@ -151,6 +163,8 @@ default registry and all registries configured for scopes. See the documentation for [`npm audit`](/cli/v9/commands/npm-audit) for details on what is submitted. + + #### `bin-links` * Default: true @@ -163,6 +177,8 @@ 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. + + #### `fund` * Default: true @@ -172,6 +188,8 @@ When "true" displays the message at the end of each `npm install` acknowledging the number of dependencies looking for funding. See [`npm fund`](/cli/v9/commands/npm-fund) for details. + + #### `workspace` * Default: @@ -234,6 +252,8 @@ 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. + + ### See Also * [npm dedupe](/cli/v9/commands/npm-dedupe) diff --git a/content/cli/v9/commands/npm-fund.md b/content/cli/v9/commands/npm-fund.md index db0456d4960..af9849d052d 100644 --- a/content/cli/v9/commands/npm-fund.md +++ b/content/cli/v9/commands/npm-fund.md @@ -3,7 +3,7 @@ title: npm-fund section: 1 description: Retrieve funding information github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-fund.md redirect_from: - /cli-commands/fund @@ -108,6 +108,8 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + #### `browser` * Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"` @@ -120,6 +122,8 @@ terminal. Set to `true` to use default system URL opener. + + #### `unicode` * Default: false on windows, true on mac/unix systems with a unicode locale, @@ -129,6 +133,8 @@ Set to `true` to use default system URL opener. When set to true, npm uses unicode characters in the tree output. When false, it uses ascii characters instead of unicode glyphs. + + #### `workspace` * Default: @@ -158,6 +164,8 @@ This value is not exported to the environment for child processes. If there are multiple funding sources, which 1-indexed source URL to open. + + ## See Also * [package spec](/cli/v9/using-npm/package-spec) diff --git a/content/cli/v9/commands/npm-help-search.md b/content/cli/v9/commands/npm-help-search.md index 3bad080587d..09bf7207dcb 100644 --- a/content/cli/v9/commands/npm-help-search.md +++ b/content/cli/v9/commands/npm-help-search.md @@ -3,7 +3,7 @@ title: npm-help-search section: 1 description: Search npm help documentation github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-help-search.md redirect_from: - /cli-commands/help-search @@ -63,6 +63,8 @@ directly. Show extended information in `ls`, `search`, and `help-search`. + + ### See Also * [npm](/cli/v9/commands/npm) diff --git a/content/cli/v9/commands/npm-help.md b/content/cli/v9/commands/npm-help.md index a4720a33954..89bab6434b3 100644 --- a/content/cli/v9/commands/npm-help.md +++ b/content/cli/v9/commands/npm-help.md @@ -3,7 +3,7 @@ title: npm-help section: 1 description: Get help on npm github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-help.md redirect_from: - /cli-commands/help @@ -65,6 +65,8 @@ The program to use to view help content. Set to `"browser"` to view html help content in the default web browser. + + ### See Also * [npm](/cli/v9/commands/npm) diff --git a/content/cli/v9/commands/npm-hook.md b/content/cli/v9/commands/npm-hook.md index efb64b81af4..0897ec0b072 100644 --- a/content/cli/v9/commands/npm-hook.md +++ b/content/cli/v9/commands/npm-hook.md @@ -3,7 +3,7 @@ title: npm-hook section: 1 description: Manage registry hooks github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-hook.md redirect_from: - /cli-commands/hook @@ -123,6 +123,8 @@ $ npm hook rm id-deadbeef The base URL of the npm registry. + + #### `otp` * Default: null @@ -134,6 +136,8 @@ when publishing or changing package permissions with `npm access`. 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. + + ### See Also * ["Introducing Hooks" blog post](https://blog.npmjs.org/post/145260155635/introducing-hooks-get-notifications-of-npm) diff --git a/content/cli/v9/commands/npm-init.md b/content/cli/v9/commands/npm-init.md index d2962c45e8a..b0582c0df87 100644 --- a/content/cli/v9/commands/npm-init.md +++ b/content/cli/v9/commands/npm-init.md @@ -3,7 +3,7 @@ title: npm-init section: 1 description: Create a package.json file github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-init.md redirect_from: - /cli-commands/init @@ -195,6 +195,8 @@ dot to represent the current directory in that context, e.g: `react-app .`: Automatically answer "yes" to any prompts that npm might print on the command line. + + #### `force` * Default: false @@ -221,6 +223,8 @@ mistakes, unnecessary performance degradation, and malicious input. 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! + + #### `scope` * Default: the scope of the current project, if any, or "" @@ -251,6 +255,7 @@ npm init --scope=@foo --yes ``` + #### `workspace` * Default: @@ -299,6 +304,8 @@ This value is not exported to the environment for child processes. If set to true, the npm cli will run an update after operations that may possibly change the workspaces installed to the `node_modules` folder. + + #### `include-workspace-root` * Default: false diff --git a/content/cli/v9/commands/npm-install-ci-test.md b/content/cli/v9/commands/npm-install-ci-test.md index 95e66f2e9e2..e47cb83bee4 100644 --- a/content/cli/v9/commands/npm-install-ci-test.md +++ b/content/cli/v9/commands/npm-install-ci-test.md @@ -3,7 +3,7 @@ title: npm-install-ci-test section: 1 description: Install a project with a clean slate and run tests github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-install-ci-test.md redirect_from: - /cli-commands/install-ci-test @@ -61,6 +61,8 @@ place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted. + + #### `legacy-bundling` * Default: false @@ -73,6 +75,8 @@ 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`. + + #### `global-style` * Default: false @@ -83,6 +87,8 @@ de-duplicating. Sets `--install-strategy=nested`. Only install direct dependencies in the top level `node_modules`, but hoist on deeper dependencies. Sets `--install-strategy=shallow`. + + #### `omit` * Default: 'dev' if the `NODE_ENV` environment variable is set to @@ -101,6 +107,8 @@ it will be included. If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts. + + #### `strict-peer-deps` * Default: false @@ -120,15 +128,7 @@ When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If `--strict-peer-deps` is set, then this warning is treated as a failure. -#### `package-lock` - -* Default: true -* Type: Boolean - -If set to false, then ignore `package-lock.json` files when installing. This -will also prevent _writing_ `package-lock.json` if `save` is true. -This configuration does not affect `npm ci`. #### `foreground-scripts` @@ -142,6 +142,8 @@ input, output, and error with the main npm process. Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging. + + #### `ignore-scripts` * Default: false @@ -154,6 +156,8 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + #### `audit` * Default: true @@ -164,6 +168,8 @@ default registry and all registries configured for scopes. See the documentation for [`npm audit`](/cli/v9/commands/npm-audit) for details on what is submitted. + + #### `bin-links` * Default: true @@ -176,6 +182,8 @@ 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. + + #### `fund` * Default: true @@ -185,6 +193,8 @@ When "true" displays the message at the end of each `npm install` acknowledging the number of dependencies looking for funding. See [`npm fund`](/cli/v9/commands/npm-fund) for details. + + #### `dry-run` * Default: false @@ -198,6 +208,8 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + #### `workspace` * Default: @@ -260,6 +272,8 @@ 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. + + ### See Also * [npm install-test](/cli/v9/commands/npm-install-test) diff --git a/content/cli/v9/commands/npm-install-test.md b/content/cli/v9/commands/npm-install-test.md index 1e7e39a4735..c5e6a4925b9 100644 --- a/content/cli/v9/commands/npm-install-test.md +++ b/content/cli/v9/commands/npm-install-test.md @@ -3,7 +3,7 @@ title: npm-install-test section: 1 description: Install package(s) and run tests github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-install-test.md redirect_from: - /cli-commands/install-test @@ -62,6 +62,8 @@ When used with the `npm rm` command, removes the dependency from Will also prevent writing to `package-lock.json` if set to `false`. + + #### `save-exact` * Default: false @@ -70,6 +72,8 @@ Will also prevent writing to `package-lock.json` if set to `false`. Dependencies saved to package.json will be configured with an exact version rather than using npm's default semver range operator. + + #### `global` * Default: false @@ -84,6 +88,8 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + #### `install-strategy` * Default: "hoisted" @@ -96,6 +102,8 @@ place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted. + + #### `legacy-bundling` * Default: false @@ -108,6 +116,8 @@ 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`. + + #### `global-style` * Default: false @@ -118,6 +128,8 @@ de-duplicating. Sets `--install-strategy=nested`. Only install direct dependencies in the top level `node_modules`, but hoist on deeper dependencies. Sets `--install-strategy=shallow`. + + #### `omit` * Default: 'dev' if the `NODE_ENV` environment variable is set to @@ -136,6 +148,8 @@ it will be included. If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts. + + #### `strict-peer-deps` * Default: false @@ -155,6 +169,18 @@ When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If `--strict-peer-deps` is set, then this warning is treated as a failure. + + +#### `prefer-dedupe` + +* Default: false +* Type: Boolean + +Prefer to deduplicate packages if possible, rather than choosing a newer +version of a dependency. + + + #### `package-lock` * Default: true @@ -163,7 +189,23 @@ this warning is treated as a failure. If set to false, then ignore `package-lock.json` files when installing. This will also prevent _writing_ `package-lock.json` if `save` is true. -This configuration does not affect `npm ci`. + + +#### `package-lock-only` + +* Default: false +* Type: Boolean + +If set to true, the current operation will only use the `package-lock.json`, +ignoring `node_modules`. + +For `update` this means only the `package-lock.json` will be updated, +instead of checking `node_modules` and downloading dependencies. + +For `list` this means the output will be based on the tree described by the +`package-lock.json`, rather than the contents of `node_modules`. + + #### `foreground-scripts` @@ -177,6 +219,8 @@ input, output, and error with the main npm process. Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging. + + #### `ignore-scripts` * Default: false @@ -189,6 +233,8 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + #### `audit` * Default: true @@ -199,6 +245,8 @@ default registry and all registries configured for scopes. See the documentation for [`npm audit`](/cli/v9/commands/npm-audit) for details on what is submitted. + + #### `bin-links` * Default: true @@ -211,6 +259,8 @@ 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. + + #### `fund` * Default: true @@ -220,6 +270,8 @@ When "true" displays the message at the end of each `npm install` acknowledging the number of dependencies looking for funding. See [`npm fund`](/cli/v9/commands/npm-fund) for details. + + #### `dry-run` * Default: false @@ -233,6 +285,8 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + #### `workspace` * Default: @@ -295,6 +349,8 @@ 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. + + ### See Also * [npm install](/cli/v9/commands/npm-install) diff --git a/content/cli/v9/commands/npm-install.md b/content/cli/v9/commands/npm-install.md index 072af93dfa7..8deff097a03 100644 --- a/content/cli/v9/commands/npm-install.md +++ b/content/cli/v9/commands/npm-install.md @@ -3,7 +3,7 @@ title: npm-install section: 1 description: Install a package github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-install.md redirect_from: - /cli-commands/install @@ -452,6 +452,8 @@ When used with the `npm rm` command, removes the dependency from Will also prevent writing to `package-lock.json` if set to `false`. + + #### `save-exact` * Default: false @@ -460,6 +462,8 @@ Will also prevent writing to `package-lock.json` if set to `false`. Dependencies saved to package.json will be configured with an exact version rather than using npm's default semver range operator. + + #### `global` * Default: false @@ -474,6 +478,8 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + #### `install-strategy` * Default: "hoisted" @@ -486,6 +492,8 @@ place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted. + + #### `legacy-bundling` * Default: false @@ -498,6 +506,8 @@ 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`. + + #### `global-style` * Default: false @@ -508,6 +518,8 @@ de-duplicating. Sets `--install-strategy=nested`. Only install direct dependencies in the top level `node_modules`, but hoist on deeper dependencies. Sets `--install-strategy=shallow`. + + #### `omit` * Default: 'dev' if the `NODE_ENV` environment variable is set to @@ -526,6 +538,8 @@ it will be included. If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts. + + #### `strict-peer-deps` * Default: false @@ -545,6 +559,18 @@ When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If `--strict-peer-deps` is set, then this warning is treated as a failure. + + +#### `prefer-dedupe` + +* Default: false +* Type: Boolean + +Prefer to deduplicate packages if possible, rather than choosing a newer +version of a dependency. + + + #### `package-lock` * Default: true @@ -553,7 +579,23 @@ this warning is treated as a failure. If set to false, then ignore `package-lock.json` files when installing. This will also prevent _writing_ `package-lock.json` if `save` is true. -This configuration does not affect `npm ci`. + + +#### `package-lock-only` + +* Default: false +* Type: Boolean + +If set to true, the current operation will only use the `package-lock.json`, +ignoring `node_modules`. + +For `update` this means only the `package-lock.json` will be updated, +instead of checking `node_modules` and downloading dependencies. + +For `list` this means the output will be based on the tree described by the +`package-lock.json`, rather than the contents of `node_modules`. + + #### `foreground-scripts` @@ -567,6 +609,8 @@ input, output, and error with the main npm process. Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging. + + #### `ignore-scripts` * Default: false @@ -579,6 +623,8 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + #### `audit` * Default: true @@ -589,6 +635,8 @@ default registry and all registries configured for scopes. See the documentation for [`npm audit`](/cli/v9/commands/npm-audit) for details on what is submitted. + + #### `bin-links` * Default: true @@ -601,6 +649,8 @@ 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. + + #### `fund` * Default: true @@ -610,6 +660,8 @@ When "true" displays the message at the end of each `npm install` acknowledging the number of dependencies looking for funding. See [`npm fund`](/cli/v9/commands/npm-fund) for details. + + #### `dry-run` * Default: false @@ -623,6 +675,8 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + #### `workspace` * Default: @@ -685,6 +739,8 @@ 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. + + ### Algorithm Given a `package{dep}` structure: `A{B,C}, B{C}, C{D}`, diff --git a/content/cli/v9/commands/npm-link.md b/content/cli/v9/commands/npm-link.md index bc21a6b3fdf..5b635b732a9 100644 --- a/content/cli/v9/commands/npm-link.md +++ b/content/cli/v9/commands/npm-link.md @@ -3,7 +3,7 @@ title: npm-link section: 1 description: Symlink a package folder github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-link.md redirect_from: - /cli-commands/link @@ -153,6 +153,8 @@ When used with the `npm rm` command, removes the dependency from Will also prevent writing to `package-lock.json` if set to `false`. + + #### `save-exact` * Default: false @@ -161,6 +163,8 @@ Will also prevent writing to `package-lock.json` if set to `false`. Dependencies saved to package.json will be configured with an exact version rather than using npm's default semver range operator. + + #### `global` * Default: false @@ -175,6 +179,8 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + #### `install-strategy` * Default: "hoisted" @@ -187,6 +193,8 @@ place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted. + + #### `legacy-bundling` * Default: false @@ -199,6 +207,8 @@ 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`. + + #### `global-style` * Default: false @@ -209,6 +219,8 @@ de-duplicating. Sets `--install-strategy=nested`. Only install direct dependencies in the top level `node_modules`, but hoist on deeper dependencies. Sets `--install-strategy=shallow`. + + #### `strict-peer-deps` * Default: false @@ -228,6 +240,8 @@ When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If `--strict-peer-deps` is set, then this warning is treated as a failure. + + #### `package-lock` * Default: true @@ -236,7 +250,7 @@ this warning is treated as a failure. If set to false, then ignore `package-lock.json` files when installing. This will also prevent _writing_ `package-lock.json` if `save` is true. -This configuration does not affect `npm ci`. + #### `omit` @@ -256,6 +270,8 @@ it will be included. If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts. + + #### `ignore-scripts` * Default: false @@ -268,6 +284,8 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + #### `audit` * Default: true @@ -278,6 +296,8 @@ default registry and all registries configured for scopes. See the documentation for [`npm audit`](/cli/v9/commands/npm-audit) for details on what is submitted. + + #### `bin-links` * Default: true @@ -290,6 +310,8 @@ 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. + + #### `fund` * Default: true @@ -299,6 +321,8 @@ When "true" displays the message at the end of each `npm install` acknowledging the number of dependencies looking for funding. See [`npm fund`](/cli/v9/commands/npm-fund) for details. + + #### `dry-run` * Default: false @@ -312,6 +336,8 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + #### `workspace` * Default: @@ -374,6 +400,8 @@ 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. + + ### See Also * [package spec](/cli/v9/using-npm/package-spec) diff --git a/content/cli/v9/commands/npm-login.md b/content/cli/v9/commands/npm-login.md index 99716304703..05a9f216e0f 100644 --- a/content/cli/v9/commands/npm-login.md +++ b/content/cli/v9/commands/npm-login.md @@ -3,7 +3,7 @@ title: npm-login section: 1 description: Login to a registry user account github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-login.md redirect_from: - /cli-commands/login @@ -70,6 +70,8 @@ your existing record. The base URL of the npm registry. + + #### `scope` * Default: the scope of the current project, if any, or "" @@ -100,6 +102,7 @@ npm init --scope=@foo --yes ``` + #### `auth-type` * Default: "web" @@ -108,6 +111,8 @@ npm init --scope=@foo --yes What authentication strategy to use with `login`. Note that if an `otp` config is given, this value will always be set to `legacy`. + + ### See Also * [npm registry](/cli/v9/using-npm/registry) diff --git a/content/cli/v9/commands/npm-logout.md b/content/cli/v9/commands/npm-logout.md index d8af23f3c62..cf727b3d729 100644 --- a/content/cli/v9/commands/npm-logout.md +++ b/content/cli/v9/commands/npm-logout.md @@ -3,7 +3,7 @@ title: npm-logout section: 1 description: Log out of the registry github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-logout.md redirect_from: - /cli-commands/logout @@ -65,6 +65,8 @@ connected to that scope, if set. The base URL of the npm registry. + + #### `scope` * Default: the scope of the current project, if any, or "" @@ -95,6 +97,7 @@ npm init --scope=@foo --yes ``` + ### See Also * [npm adduser](/cli/v9/commands/npm-adduser) diff --git a/content/cli/v9/commands/npm-ls.md b/content/cli/v9/commands/npm-ls.md index 53d3d597f0d..c9e413c45dc 100644 --- a/content/cli/v9/commands/npm-ls.md +++ b/content/cli/v9/commands/npm-ls.md @@ -3,7 +3,7 @@ title: npm-ls section: 1 description: List installed packages github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-ls.md redirect_from: - /cli-commands/ls @@ -58,7 +58,7 @@ packages will *also* show the paths to the specified packages. For example, running `npm ls promzard` in npm's source tree will show: ```bash -npm@9.6.7 /path/to/npm +npm@9.8.1 /path/to/npm └─┬ init-package-json@0.0.4 └── promzard@0.1.5 ``` @@ -113,6 +113,8 @@ When running `npm outdated` and `npm ls`, setting `--all` will show all outdated or installed packages, rather than only those directly depended upon by the current project. + + #### `json` * Default: false @@ -125,6 +127,8 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + #### `long` * Default: false @@ -132,6 +136,8 @@ Not supported by all npm commands. Show extended information in `ls`, `search`, and `help-search`. + + #### `parseable` * Default: false @@ -140,6 +146,8 @@ Show extended information in `ls`, `search`, and `help-search`. Output parseable results from commands that write to standard output. For `npm search`, this will be tab-separated table format. + + #### `global` * Default: false @@ -154,6 +162,8 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + #### `depth` * Default: `Infinity` if `--all` is set, otherwise `1` @@ -164,6 +174,8 @@ The depth to go when recursing packages for `npm ls`. If not set, `npm ls` will show only the immediate dependencies of the root project. If `--all` is set, then npm will show all dependencies by default. + + #### `omit` * Default: 'dev' if the `NODE_ENV` environment variable is set to @@ -182,6 +194,8 @@ it will be included. If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts. + + #### `link` * Default: false @@ -189,6 +203,8 @@ variable will be set to `'production'` for all lifecycle scripts. Used with `npm ls`, limiting output to only those packages that are linked. + + #### `package-lock-only` * Default: false @@ -203,6 +219,8 @@ instead of checking `node_modules` and downloading dependencies. For `list` this means the output will be based on the tree described by the `package-lock.json`, rather than the contents of `node_modules`. + + #### `unicode` * Default: false on windows, true on mac/unix systems with a unicode locale, @@ -212,6 +230,8 @@ For `list` this means the output will be based on the tree described by the When set to true, npm uses unicode characters in the tree output. When false, it uses ascii characters instead of unicode glyphs. + + #### `workspace` * Default: @@ -274,6 +294,8 @@ 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. + + ### See Also * [package spec](/cli/v9/using-npm/package-spec) diff --git a/content/cli/v9/commands/npm-org.md b/content/cli/v9/commands/npm-org.md index 2822637904d..94870923394 100644 --- a/content/cli/v9/commands/npm-org.md +++ b/content/cli/v9/commands/npm-org.md @@ -3,7 +3,7 @@ title: npm-org section: 1 description: Manage orgs github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-org.md redirect_from: - /cli-commands/npm-org @@ -100,6 +100,8 @@ listing them, and finding specific ones and their roles. The base URL of the npm registry. + + #### `otp` * Default: null @@ -111,6 +113,8 @@ when publishing or changing package permissions with `npm access`. 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. + + #### `json` * Default: false @@ -123,6 +127,8 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + #### `parseable` * Default: false @@ -131,6 +137,8 @@ Not supported by all npm commands. Output parseable results from commands that write to standard output. For `npm search`, this will be tab-separated table format. + + ### See Also * [using orgs](/cli/v9/using-npm/orgs) diff --git a/content/cli/v9/commands/npm-outdated.md b/content/cli/v9/commands/npm-outdated.md index 8987f0e463f..f74dec62fea 100644 --- a/content/cli/v9/commands/npm-outdated.md +++ b/content/cli/v9/commands/npm-outdated.md @@ -3,7 +3,7 @@ title: npm-outdated section: 1 description: Check for outdated packages github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-outdated.md redirect_from: - /cli-commands/npm-outdated @@ -126,6 +126,8 @@ When running `npm outdated` and `npm ls`, setting `--all` will show all outdated or installed packages, rather than only those directly depended upon by the current project. + + #### `json` * Default: false @@ -138,6 +140,8 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + #### `long` * Default: false @@ -145,6 +149,8 @@ Not supported by all npm commands. Show extended information in `ls`, `search`, and `help-search`. + + #### `parseable` * Default: false @@ -153,6 +159,8 @@ Show extended information in `ls`, `search`, and `help-search`. Output parseable results from commands that write to standard output. For `npm search`, this will be tab-separated table format. + + #### `global` * Default: false @@ -167,6 +175,8 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + #### `workspace` * Default: diff --git a/content/cli/v9/commands/npm-owner.md b/content/cli/v9/commands/npm-owner.md index 98894794770..edbcfa810be 100644 --- a/content/cli/v9/commands/npm-owner.md +++ b/content/cli/v9/commands/npm-owner.md @@ -3,7 +3,7 @@ title: npm-owner section: 1 description: Manage package owners github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-owner.md redirect_from: - /cli-commands/npm-owner @@ -73,6 +73,8 @@ flow when changing ownership or include an otp on the command line with `--otp`. The base URL of the npm registry. + + #### `otp` * Default: null @@ -84,6 +86,8 @@ when publishing or changing package permissions with `npm access`. 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. + + #### `workspace` * Default: diff --git a/content/cli/v9/commands/npm-pack.md b/content/cli/v9/commands/npm-pack.md index 3eb5b660ba9..2c1bd38a5da 100644 --- a/content/cli/v9/commands/npm-pack.md +++ b/content/cli/v9/commands/npm-pack.md @@ -3,7 +3,7 @@ title: npm-pack section: 1 description: Create a tarball from a package github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-pack.md redirect_from: - /cli-commands/npm-pack @@ -56,6 +56,8 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + #### `json` * Default: false @@ -68,6 +70,8 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + #### `pack-destination` * Default: "." @@ -75,6 +79,8 @@ Not supported by all npm commands. Directory in which `npm pack` will save tarballs. + + #### `workspace` * Default: diff --git a/content/cli/v9/commands/npm-ping.md b/content/cli/v9/commands/npm-ping.md index efd6c1746a2..83bfd23f71b 100644 --- a/content/cli/v9/commands/npm-ping.md +++ b/content/cli/v9/commands/npm-ping.md @@ -3,7 +3,7 @@ title: npm-ping section: 1 description: Ping npm registry github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-ping.md redirect_from: - /cli-commands/npm-ping @@ -68,6 +68,8 @@ npm ERR! 404 Not Found - GET http://www.foo.com/-/ping?write=true The base URL of the npm registry. + + ### See Also * [npm doctor](/cli/v9/commands/npm-doctor) diff --git a/content/cli/v9/commands/npm-pkg.md b/content/cli/v9/commands/npm-pkg.md index 434b9ef027c..7444a20895c 100644 --- a/content/cli/v9/commands/npm-pkg.md +++ b/content/cli/v9/commands/npm-pkg.md @@ -3,7 +3,7 @@ title: npm-pkg section: 1 description: Manages your package.json github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-pkg.md redirect_from: - /cli-commands/npm-pkg @@ -43,6 +43,7 @@ npm pkg get [ [ ...]] npm pkg delete [ ...] npm pkg set [[].= ...] npm pkg set [[].= ...] +npm pkg fix ``` ### Description @@ -172,6 +173,13 @@ Returned values are always in **json** format. npm pkg delete scripts.build ``` +* `npm pkg fix` + + Auto corrects common errors in your `package.json`. npm already + does this during `publish`, which leads to subtle (mostly harmless) + differences between the contents of your `package.json` file and the + manifest that npm uses during installation. + ### Workspaces support You can set/get/delete items across your configured workspaces by using the @@ -232,6 +240,8 @@ mistakes, unnecessary performance degradation, and malicious input. 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! + + #### `json` * Default: false @@ -244,6 +254,8 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + #### `workspace` * Default: diff --git a/content/cli/v9/commands/npm-prefix.md b/content/cli/v9/commands/npm-prefix.md index 3b91a21ec59..00812d04d49 100644 --- a/content/cli/v9/commands/npm-prefix.md +++ b/content/cli/v9/commands/npm-prefix.md @@ -3,7 +3,7 @@ title: npm-prefix section: 1 description: Display prefix github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-prefix.md redirect_from: - /cli-commands/npm-prefix @@ -80,6 +80,8 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + ### See Also * [npm root](/cli/v9/commands/npm-root) diff --git a/content/cli/v9/commands/npm-profile.md b/content/cli/v9/commands/npm-profile.md index 1f1588124c2..0c1b753c12f 100644 --- a/content/cli/v9/commands/npm-profile.md +++ b/content/cli/v9/commands/npm-profile.md @@ -3,7 +3,7 @@ title: npm-profile section: 1 description: Change settings on your registry profile github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-profile.md redirect_from: - /cli-commands/npm-profile @@ -112,6 +112,8 @@ Some of these commands may not be available on non npmjs.com registries. The base URL of the npm registry. + + #### `json` * Default: false @@ -124,6 +126,8 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + #### `parseable` * Default: false @@ -132,6 +136,8 @@ Not supported by all npm commands. Output parseable results from commands that write to standard output. For `npm search`, this will be tab-separated table format. + + #### `otp` * Default: null @@ -143,6 +149,8 @@ when publishing or changing package permissions with `npm access`. 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. + + ### See Also * [npm adduser](/cli/v9/commands/npm-adduser) diff --git a/content/cli/v9/commands/npm-prune.md b/content/cli/v9/commands/npm-prune.md index 09531997c5e..74dfbdd06a4 100644 --- a/content/cli/v9/commands/npm-prune.md +++ b/content/cli/v9/commands/npm-prune.md @@ -3,7 +3,7 @@ title: npm-prune section: 1 description: Remove extraneous packages github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-prune.md redirect_from: - /cli-commands/npm-prune @@ -84,6 +84,8 @@ it will be included. If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts. + + #### `dry-run` * Default: false @@ -97,6 +99,8 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + #### `json` * Default: false @@ -109,6 +113,8 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + #### `foreground-scripts` * Default: false @@ -121,6 +127,8 @@ input, output, and error with the main npm process. Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging. + + #### `ignore-scripts` * Default: false @@ -133,6 +141,8 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + #### `workspace` * Default: @@ -195,6 +205,8 @@ 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. + + ### See Also * [npm uninstall](/cli/v9/commands/npm-uninstall) diff --git a/content/cli/v9/commands/npm-publish.md b/content/cli/v9/commands/npm-publish.md index ced1b124701..f6d163b8af1 100644 --- a/content/cli/v9/commands/npm-publish.md +++ b/content/cli/v9/commands/npm-publish.md @@ -3,7 +3,7 @@ title: npm-publish section: 1 description: Publish a package github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-publish.md redirect_from: - /cli-commands/npm-publish @@ -132,6 +132,8 @@ command, if no explicit tag is given. When used by the `npm diff` command, this is the tag used to fetch the tarball that will be compared with the local files by default. + + #### `access` * Default: 'public' for new packages, existing packages it will not change the @@ -148,6 +150,8 @@ 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. + + #### `dry-run` * Default: false @@ -161,6 +165,8 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + #### `otp` * Default: null @@ -172,6 +178,8 @@ when publishing or changing package permissions with `npm access`. 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. + + #### `workspace` * Default: @@ -233,6 +241,17 @@ This value is not exported to the environment for child processes. When publishing from a supported cloud CI/CD system, the package will be publicly linked to where it was built and published from. +This config can not be used with: `provenance-file` + +#### `provenance-file` + +* Default: null +* Type: Path + +When publishing, the provenance bundle at the given path will be used. + +This config can not be used with: `provenance` + ### See Also * [package spec](/cli/v9/using-npm/package-spec) diff --git a/content/cli/v9/commands/npm-query.md b/content/cli/v9/commands/npm-query.md index b15493e98f5..0291a9718be 100644 --- a/content/cli/v9/commands/npm-query.md +++ b/content/cli/v9/commands/npm-query.md @@ -3,7 +3,7 @@ title: npm-query section: 1 description: Dependency selector query github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-query.md redirect_from: - /cli-commands/npm-query @@ -183,6 +183,8 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + #### `workspace` * Default: diff --git a/content/cli/v9/commands/npm-rebuild.md b/content/cli/v9/commands/npm-rebuild.md index 57395ca66aa..dc2b6f30179 100644 --- a/content/cli/v9/commands/npm-rebuild.md +++ b/content/cli/v9/commands/npm-rebuild.md @@ -3,7 +3,7 @@ title: npm-rebuild section: 1 description: Rebuild a package github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-rebuild.md redirect_from: - /cli-commands/npm-rebuild @@ -70,6 +70,8 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + #### `bin-links` * Default: true @@ -82,6 +84,8 @@ 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. + + #### `foreground-scripts` * Default: false @@ -94,6 +98,8 @@ input, output, and error with the main npm process. Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging. + + #### `ignore-scripts` * Default: false @@ -106,6 +112,8 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + #### `workspace` * Default: @@ -168,6 +176,8 @@ 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. + + ### See Also * [package spec](/cli/v9/using-npm/package-spec) diff --git a/content/cli/v9/commands/npm-repo.md b/content/cli/v9/commands/npm-repo.md index 0173d2a4b0e..ead8a2897b0 100644 --- a/content/cli/v9/commands/npm-repo.md +++ b/content/cli/v9/commands/npm-repo.md @@ -3,7 +3,7 @@ title: npm-repo section: 1 description: Open package repository page in the browser github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-repo.md redirect_from: - /cli-commands/npm-repo @@ -63,6 +63,8 @@ terminal. Set to `true` to use default system URL opener. + + #### `registry` * Default: "https://registry.npmjs.org/" @@ -70,6 +72,8 @@ Set to `true` to use default system URL opener. The base URL of the npm registry. + + #### `workspace` * Default: diff --git a/content/cli/v9/commands/npm-restart.md b/content/cli/v9/commands/npm-restart.md index 0c582773bf5..bfad42a3c19 100644 --- a/content/cli/v9/commands/npm-restart.md +++ b/content/cli/v9/commands/npm-restart.md @@ -3,7 +3,7 @@ title: npm-restart section: 1 description: Restart a package github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-restart.md redirect_from: - /cli-commands/npm-restart @@ -79,6 +79,8 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + #### `script-shell` * Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows @@ -87,6 +89,8 @@ will *not* run any pre- or post-scripts. The shell to use for scripts run with the `npm exec`, `npm run` and `npm init ` commands. + + ### See Also * [npm run-script](/cli/v9/commands/npm-run-script) diff --git a/content/cli/v9/commands/npm-root.md b/content/cli/v9/commands/npm-root.md index e9fcaa09984..066ac44daff 100644 --- a/content/cli/v9/commands/npm-root.md +++ b/content/cli/v9/commands/npm-root.md @@ -3,7 +3,7 @@ title: npm-root section: 1 description: Display npm root github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-root.md redirect_from: - /cli-commands/npm-root @@ -72,6 +72,8 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + ### See Also * [npm prefix](/cli/v9/commands/npm-prefix) diff --git a/content/cli/v9/commands/npm-run-script.md b/content/cli/v9/commands/npm-run-script.md index 769b93e2fa6..e5d6bc42ea6 100644 --- a/content/cli/v9/commands/npm-run-script.md +++ b/content/cli/v9/commands/npm-run-script.md @@ -3,7 +3,7 @@ title: npm-run-script section: 1 description: Run arbitrary package scripts github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-run-script.md redirect_from: - /cli-commands/npm-run-script @@ -247,6 +247,8 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + #### `foreground-scripts` * Default: false @@ -259,6 +261,8 @@ input, output, and error with the main npm process. Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging. + + #### `script-shell` * Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows @@ -267,6 +271,8 @@ but can be useful for debugging. The shell to use for scripts run with the `npm exec`, `npm run` and `npm init ` commands. + + ### See Also * [npm scripts](/cli/v9/using-npm/scripts) diff --git a/content/cli/v9/commands/npm-search.md b/content/cli/v9/commands/npm-search.md index 0d70e74010a..eb7fc1b5592 100644 --- a/content/cli/v9/commands/npm-search.md +++ b/content/cli/v9/commands/npm-search.md @@ -3,7 +3,7 @@ title: npm-search section: 1 description: Search for packages github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-search.md redirect_from: - /cli-commands/npm-search @@ -77,6 +77,8 @@ expression characters in most shells.) Show extended information in `ls`, `search`, and `help-search`. + + #### `json` * Default: false @@ -89,6 +91,8 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + #### `color` * Default: true unless the NO_COLOR environ is set to something other than '0' @@ -97,6 +101,8 @@ Not supported by all npm commands. If false, never shows colors. If `"always"` then always shows colors. If true, then only prints color codes for tty file descriptors. + + #### `parseable` * Default: false @@ -105,6 +111,8 @@ true, then only prints color codes for tty file descriptors. Output parseable results from commands that write to standard output. For `npm search`, this will be tab-separated table format. + + #### `description` * Default: true @@ -112,6 +120,8 @@ Output parseable results from commands that write to standard output. For Show the description in `npm search` + + #### `searchopts` * Default: "" @@ -119,6 +129,8 @@ Show the description in `npm search` Space-separated options that are always passed to search. + + #### `searchexclude` * Default: "" @@ -126,6 +138,8 @@ Space-separated options that are always passed to search. Space-separated options that limit the results from search. + + #### `registry` * Default: "https://registry.npmjs.org/" @@ -133,6 +147,8 @@ Space-separated options that limit the results from search. The base URL of the npm registry. + + #### `prefer-online` * Default: false @@ -141,6 +157,8 @@ The base URL of the npm registry. If true, staleness checks for cached data will be forced, making the CLI look for updates immediately even for fresh package data. + + #### `prefer-offline` * Default: false @@ -150,6 +168,8 @@ 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 `--offline`. + + #### `offline` * Default: false @@ -158,6 +178,8 @@ will be requested from the server. To force full offline mode, use Force offline mode: no network requests will be done during install. To allow the CLI to fill in missing cache data, see `--prefer-offline`. + + ### See Also * [npm registry](/cli/v9/using-npm/registry) diff --git a/content/cli/v9/commands/npm-shrinkwrap.md b/content/cli/v9/commands/npm-shrinkwrap.md index d93911eb13f..aaefb55e4de 100644 --- a/content/cli/v9/commands/npm-shrinkwrap.md +++ b/content/cli/v9/commands/npm-shrinkwrap.md @@ -3,7 +3,7 @@ title: npm-shrinkwrap section: 1 description: Lock down dependency versions for publication github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-shrinkwrap.md redirect_from: - /cli-commands/npm-shrinkwrap diff --git a/content/cli/v9/commands/npm-star.md b/content/cli/v9/commands/npm-star.md index c8b0b2c0625..032b2b76987 100644 --- a/content/cli/v9/commands/npm-star.md +++ b/content/cli/v9/commands/npm-star.md @@ -3,7 +3,7 @@ title: npm-star section: 1 description: Mark your favorite packages github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-star.md redirect_from: - /cli-commands/npm-star @@ -73,6 +73,8 @@ You can see all your starred packages using [`npm stars`](/cli/v9/commands/npm-s The base URL of the npm registry. + + #### `unicode` * Default: false on windows, true on mac/unix systems with a unicode locale, @@ -82,6 +84,8 @@ The base URL of the npm registry. When set to true, npm uses unicode characters in the tree output. When false, it uses ascii characters instead of unicode glyphs. + + #### `otp` * Default: null @@ -93,6 +97,8 @@ when publishing or changing package permissions with `npm access`. 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. + + ### See Also * [package spec](/cli/v9/using-npm/package-spec) diff --git a/content/cli/v9/commands/npm-stars.md b/content/cli/v9/commands/npm-stars.md index 2c2d4a35249..0ded402d9b9 100644 --- a/content/cli/v9/commands/npm-stars.md +++ b/content/cli/v9/commands/npm-stars.md @@ -3,7 +3,7 @@ title: npm-stars section: 1 description: View packages marked as favorites github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-stars.md redirect_from: - /cli-commands/npm-stars @@ -60,6 +60,8 @@ you will most certainly enjoy this command. The base URL of the npm registry. + + ### See Also * [npm star](/cli/v9/commands/npm-star) diff --git a/content/cli/v9/commands/npm-start.md b/content/cli/v9/commands/npm-start.md index 396ba469e85..cc8052d6636 100644 --- a/content/cli/v9/commands/npm-start.md +++ b/content/cli/v9/commands/npm-start.md @@ -3,7 +3,7 @@ title: npm-start section: 1 description: Start a package github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-start.md redirect_from: - /cli-commands/npm-start @@ -90,6 +90,8 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + #### `script-shell` * Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows @@ -98,6 +100,8 @@ will *not* run any pre- or post-scripts. The shell to use for scripts run with the `npm exec`, `npm run` and `npm init ` commands. + + ### See Also * [npm run-script](/cli/v9/commands/npm-run-script) diff --git a/content/cli/v9/commands/npm-stop.md b/content/cli/v9/commands/npm-stop.md index c714706899a..0de2296173c 100644 --- a/content/cli/v9/commands/npm-stop.md +++ b/content/cli/v9/commands/npm-stop.md @@ -3,7 +3,7 @@ title: npm-stop section: 1 description: Stop a package github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-stop.md redirect_from: - /cli-commands/npm-stop @@ -83,6 +83,8 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + #### `script-shell` * Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows @@ -91,6 +93,8 @@ will *not* run any pre- or post-scripts. The shell to use for scripts run with the `npm exec`, `npm run` and `npm init ` commands. + + ### See Also * [npm run-script](/cli/v9/commands/npm-run-script) diff --git a/content/cli/v9/commands/npm-team.md b/content/cli/v9/commands/npm-team.md index bbace1d1189..7904aee36c2 100644 --- a/content/cli/v9/commands/npm-team.md +++ b/content/cli/v9/commands/npm-team.md @@ -3,7 +3,7 @@ title: npm-team section: 1 description: Manage organization teams and team memberships github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-team.md redirect_from: - /cli-commands/npm-team @@ -140,6 +140,8 @@ use the `npm access` command to grant or revoke the appropriate permissions. The base URL of the npm registry. + + #### `otp` * Default: null @@ -151,6 +153,8 @@ when publishing or changing package permissions with `npm access`. 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. + + #### `parseable` * Default: false @@ -159,6 +163,8 @@ password, npm will prompt on the command line for one. Output parseable results from commands that write to standard output. For `npm search`, this will be tab-separated table format. + + #### `json` * Default: false @@ -171,6 +177,8 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + ### See Also * [npm access](/cli/v9/commands/npm-access) diff --git a/content/cli/v9/commands/npm-test.md b/content/cli/v9/commands/npm-test.md index 24ee750fa51..d203c166401 100644 --- a/content/cli/v9/commands/npm-test.md +++ b/content/cli/v9/commands/npm-test.md @@ -3,7 +3,7 @@ title: npm-test section: 1 description: Test a package github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-test.md redirect_from: - /cli-commands/npm-test @@ -80,6 +80,8 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + #### `script-shell` * Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows @@ -88,6 +90,8 @@ will *not* run any pre- or post-scripts. The shell to use for scripts run with the `npm exec`, `npm run` and `npm init ` commands. + + ### See Also * [npm run-script](/cli/v9/commands/npm-run-script) diff --git a/content/cli/v9/commands/npm-token.md b/content/cli/v9/commands/npm-token.md index bb45aa76260..ca368c82972 100644 --- a/content/cli/v9/commands/npm-token.md +++ b/content/cli/v9/commands/npm-token.md @@ -3,7 +3,7 @@ title: npm-token section: 1 description: Manage your authentication tokens github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-token.md redirect_from: - /cli-commands/npm-token @@ -116,6 +116,8 @@ This lets you list, create and revoke authentication tokens. This is used to mark a token as unable to publish when configuring limited access tokens with the `npm token create` command. + + #### `cidr` * Default: null @@ -124,6 +126,8 @@ access tokens with the `npm token create` command. This is a list of CIDR address to be used when configuring limited access tokens with the `npm token create` command. + + #### `registry` * Default: "https://registry.npmjs.org/" @@ -131,6 +135,8 @@ tokens with the `npm token create` command. The base URL of the npm registry. + + #### `otp` * Default: null @@ -142,6 +148,8 @@ when publishing or changing package permissions with `npm access`. 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. + + ### See Also * [npm adduser](/cli/v9/commands/npm-adduser) diff --git a/content/cli/v9/commands/npm-uninstall.md b/content/cli/v9/commands/npm-uninstall.md index 30f1776f733..35195487b27 100644 --- a/content/cli/v9/commands/npm-uninstall.md +++ b/content/cli/v9/commands/npm-uninstall.md @@ -3,7 +3,7 @@ title: npm-uninstall section: 1 description: Remove a package github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-uninstall.md redirect_from: - /cli-commands/npm-uninstall @@ -99,6 +99,24 @@ When used with the `npm rm` command, removes the dependency from Will also prevent writing to `package-lock.json` if set to `false`. + + +#### `global` + +* Default: false +* Type: Boolean + +Operates in "global" mode, so that packages are installed into the `prefix` +folder instead of the current working directory. See +[folders](/cli/v9/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + #### `workspace` * Default: @@ -161,6 +179,8 @@ 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. + + ### See Also * [npm prune](/cli/v9/commands/npm-prune) diff --git a/content/cli/v9/commands/npm-unpublish.md b/content/cli/v9/commands/npm-unpublish.md index 86fa5226e73..55387bd3c5e 100644 --- a/content/cli/v9/commands/npm-unpublish.md +++ b/content/cli/v9/commands/npm-unpublish.md @@ -3,7 +3,7 @@ title: npm-unpublish section: 1 description: Remove a package from the registry github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-unpublish.md redirect_from: - /cli-commands/npm-unpublish @@ -83,6 +83,8 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + #### `force` * Default: false @@ -109,6 +111,8 @@ mistakes, unnecessary performance degradation, and malicious input. 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! + + #### `workspace` * Default: diff --git a/content/cli/v9/commands/npm-unstar.md b/content/cli/v9/commands/npm-unstar.md index df66c19ad84..4602c58471a 100644 --- a/content/cli/v9/commands/npm-unstar.md +++ b/content/cli/v9/commands/npm-unstar.md @@ -3,7 +3,7 @@ title: npm-unstar section: 1 description: Remove an item from your favorite packages github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-unstar.md redirect_from: - /cli-commands/npm-unstar @@ -69,6 +69,8 @@ You can see all your starred packages using [`npm stars`](/cli/v9/commands/npm-s The base URL of the npm registry. + + #### `unicode` * Default: false on windows, true on mac/unix systems with a unicode locale, @@ -78,6 +80,8 @@ The base URL of the npm registry. When set to true, npm uses unicode characters in the tree output. When false, it uses ascii characters instead of unicode glyphs. + + #### `otp` * Default: null @@ -89,6 +93,8 @@ when publishing or changing package permissions with `npm access`. 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. + + ### See Also * [npm star](/cli/v9/commands/npm-star) diff --git a/content/cli/v9/commands/npm-update.md b/content/cli/v9/commands/npm-update.md index bc621cb147c..85d949dc431 100644 --- a/content/cli/v9/commands/npm-update.md +++ b/content/cli/v9/commands/npm-update.md @@ -3,7 +3,7 @@ title: npm-update section: 1 description: Update packages github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-update.md redirect_from: - /cli-commands/npm-update @@ -200,6 +200,8 @@ When used with the `npm rm` command, removes the dependency from Will also prevent writing to `package-lock.json` if set to `false`. + + #### `global` * Default: false @@ -214,6 +216,8 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + #### `install-strategy` * Default: "hoisted" @@ -226,6 +230,8 @@ place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted. + + #### `legacy-bundling` * Default: false @@ -238,6 +244,8 @@ 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`. + + #### `global-style` * Default: false @@ -248,6 +256,8 @@ de-duplicating. Sets `--install-strategy=nested`. Only install direct dependencies in the top level `node_modules`, but hoist on deeper dependencies. Sets `--install-strategy=shallow`. + + #### `omit` * Default: 'dev' if the `NODE_ENV` environment variable is set to @@ -266,6 +276,8 @@ it will be included. If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts. + + #### `strict-peer-deps` * Default: false @@ -285,6 +297,8 @@ When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If `--strict-peer-deps` is set, then this warning is treated as a failure. + + #### `package-lock` * Default: true @@ -293,7 +307,7 @@ this warning is treated as a failure. If set to false, then ignore `package-lock.json` files when installing. This will also prevent _writing_ `package-lock.json` if `save` is true. -This configuration does not affect `npm ci`. + #### `foreground-scripts` @@ -307,6 +321,8 @@ input, output, and error with the main npm process. Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging. + + #### `ignore-scripts` * Default: false @@ -319,6 +335,8 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + #### `audit` * Default: true @@ -329,6 +347,8 @@ default registry and all registries configured for scopes. See the documentation for [`npm audit`](/cli/v9/commands/npm-audit) for details on what is submitted. + + #### `bin-links` * Default: true @@ -341,6 +361,8 @@ 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. + + #### `fund` * Default: true @@ -350,6 +372,8 @@ When "true" displays the message at the end of each `npm install` acknowledging the number of dependencies looking for funding. See [`npm fund`](/cli/v9/commands/npm-fund) for details. + + #### `dry-run` * Default: false @@ -363,6 +387,8 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + #### `workspace` * Default: @@ -425,6 +451,8 @@ 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. + + ### See Also * [npm install](/cli/v9/commands/npm-install) diff --git a/content/cli/v9/commands/npm-version.md b/content/cli/v9/commands/npm-version.md index 8d709e38f35..0d5c79e43a5 100644 --- a/content/cli/v9/commands/npm-version.md +++ b/content/cli/v9/commands/npm-version.md @@ -3,7 +3,7 @@ title: npm-version section: 1 description: Bump a package version github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-version.md redirect_from: - /cli-commands/npm-version @@ -53,6 +53,8 @@ alias: verison Prevents throwing an error when `npm version` is used to set the new version to the same value as the current version. + + #### `commit-hooks` * Default: true @@ -60,6 +62,8 @@ to the same value as the current version. Run git commit hooks when using the `npm version` command. + + #### `git-tag-version` * Default: true @@ -68,6 +72,8 @@ Run git commit hooks when using the `npm version` command. Tag the commit when using the `npm version` command. Setting this to false results in no commit being made at all. + + #### `json` * Default: false @@ -80,6 +86,8 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + #### `preid` * Default: "" @@ -88,6 +96,8 @@ Not supported by all npm commands. The "prerelease identifier" to use as a prefix for the "prerelease" part of a semver. Like the `rc` in `1.2.0-rc.8`. + + #### `sign-git-tag` * Default: false @@ -99,6 +109,8 @@ If set to true, then the `npm version` command will tag the version using Note that git requires you to have set up GPG keys in your git configs for this to work properly. + + #### `workspace` * Default: @@ -147,6 +159,8 @@ This value is not exported to the environment for child processes. If set to true, the npm cli will run an update after operations that may possibly change the workspaces installed to the `node_modules` folder. + + #### `include-workspace-root` * Default: false diff --git a/content/cli/v9/commands/npm-view.md b/content/cli/v9/commands/npm-view.md index 564ae5a6446..15289521620 100644 --- a/content/cli/v9/commands/npm-view.md +++ b/content/cli/v9/commands/npm-view.md @@ -3,7 +3,7 @@ title: npm-view section: 1 description: View registry info github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-view.md redirect_from: - /cli-commands/npm-view @@ -145,6 +145,8 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + #### `workspace` * Default: diff --git a/content/cli/v9/commands/npm-whoami.md b/content/cli/v9/commands/npm-whoami.md index 6b26c204318..d4b8ea021e6 100644 --- a/content/cli/v9/commands/npm-whoami.md +++ b/content/cli/v9/commands/npm-whoami.md @@ -3,7 +3,7 @@ title: npm-whoami section: 1 description: Display npm username github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm-whoami.md redirect_from: - /cli-commands/npm-whoami @@ -63,6 +63,8 @@ If logged into a registry that uses Basic Auth, then simply print the The base URL of the npm registry. + + ### See Also * [npm config](/cli/v9/commands/npm-config) diff --git a/content/cli/v9/commands/npm.md b/content/cli/v9/commands/npm.md index 18825a93381..15d95bb7c29 100644 --- a/content/cli/v9/commands/npm.md +++ b/content/cli/v9/commands/npm.md @@ -3,7 +3,7 @@ title: npm section: 1 description: javascript package manager github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npm.md redirect_from: - /cli-commands/npm @@ -31,7 +31,7 @@ Note: This command is unaware of workspaces. ### Version -9.6.7 +9.8.1 ### Description diff --git a/content/cli/v9/commands/npx.md b/content/cli/v9/commands/npx.md index ac74b8992d0..5b99d748e6b 100644 --- a/content/cli/v9/commands/npx.md +++ b/content/cli/v9/commands/npx.md @@ -3,7 +3,7 @@ title: npx section: 1 description: Run a command from a local or remote npm package github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/commands/npx.md redirect_from: - /cli-commands/npx diff --git a/content/cli/v9/configuring-npm/folders.md b/content/cli/v9/configuring-npm/folders.md index b5fda91ccbf..340eef46423 100644 --- a/content/cli/v9/configuring-npm/folders.md +++ b/content/cli/v9/configuring-npm/folders.md @@ -3,7 +3,7 @@ title: folders section: 5 description: Folder Structures Used by npm github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/configuring-npm/folders.md redirect_from: - /cli-documentation/configuring-npm/folders diff --git a/content/cli/v9/configuring-npm/index.mdx b/content/cli/v9/configuring-npm/index.mdx index acafcfc76b9..a5295db96d6 100644 --- a/content/cli/v9/configuring-npm/index.mdx +++ b/content/cli/v9/configuring-npm/index.mdx @@ -2,7 +2,7 @@ title: Configuring npm shortName: Configuring github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/nav.yml redirect_from: - /cli-documentation/configuring-npm diff --git a/content/cli/v9/configuring-npm/install.md b/content/cli/v9/configuring-npm/install.md index 360221290fa..2473eb3248c 100644 --- a/content/cli/v9/configuring-npm/install.md +++ b/content/cli/v9/configuring-npm/install.md @@ -3,7 +3,7 @@ title: install section: 5 description: Download and install node and npm github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/configuring-npm/install.md redirect_from: - /cli-documentation/configuring-npm/install diff --git a/content/cli/v9/configuring-npm/npm-shrinkwrap-json.md b/content/cli/v9/configuring-npm/npm-shrinkwrap-json.md index 999df89e3f8..4f8325f4cbe 100644 --- a/content/cli/v9/configuring-npm/npm-shrinkwrap-json.md +++ b/content/cli/v9/configuring-npm/npm-shrinkwrap-json.md @@ -3,7 +3,7 @@ title: npm-shrinkwrap.json section: 5 description: A publishable lockfile github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/configuring-npm/npm-shrinkwrap-json.md redirect_from: - /cli-documentation/configuring-npm/npm-shrinkwrap-json diff --git a/content/cli/v9/configuring-npm/npmrc.md b/content/cli/v9/configuring-npm/npmrc.md index d342f8cd1ed..fc82fd21e40 100644 --- a/content/cli/v9/configuring-npm/npmrc.md +++ b/content/cli/v9/configuring-npm/npmrc.md @@ -3,7 +3,7 @@ title: npmrc section: 5 description: The npm config files github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/configuring-npm/npmrc.md redirect_from: - /cli-documentation/configuring-npm/npmrc diff --git a/content/cli/v9/configuring-npm/package-json.md b/content/cli/v9/configuring-npm/package-json.md index d64173633fb..c6b5ddce238 100644 --- a/content/cli/v9/configuring-npm/package-json.md +++ b/content/cli/v9/configuring-npm/package-json.md @@ -3,7 +3,7 @@ title: package.json section: 5 description: Specifics of npm's package.json handling github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/configuring-npm/package-json.md redirect_from: - /cli-documentation/configuring-npm/package-json @@ -302,9 +302,6 @@ it will. The `.npmignore` file works just like a `.gitignore`. If there is a `.gitignore` file, and `.npmignore` is missing, `.gitignore`'s contents will be used instead. -Files included with the "package.json#files" field _cannot_ be excluded -through `.npmignore` or `.gitignore`. - Certain files are always included, regardless of settings: * `package.json` diff --git a/content/cli/v9/configuring-npm/package-lock-json.md b/content/cli/v9/configuring-npm/package-lock-json.md index 6ad57a05376..529753e8530 100644 --- a/content/cli/v9/configuring-npm/package-lock-json.md +++ b/content/cli/v9/configuring-npm/package-lock-json.md @@ -3,7 +3,7 @@ title: package-lock.json section: 5 description: A manifestation of the manifest github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/configuring-npm/package-lock-json.md redirect_from: - /cli-documentation/configuring-npm/package-lock-json diff --git a/content/cli/v9/index.mdx b/content/cli/v9/index.mdx index 29aca049669..c59fc2fd5fd 100644 --- a/content/cli/v9/index.mdx +++ b/content/cli/v9/index.mdx @@ -2,7 +2,7 @@ title: npm CLI shortName: CLI github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/nav.yml redirect_from: - /cli diff --git a/content/cli/v9/using-npm/changelog.md b/content/cli/v9/using-npm/changelog.md index e362ba0a5af..bdfc3a32b02 100644 --- a/content/cli/v9/using-npm/changelog.md +++ b/content/cli/v9/using-npm/changelog.md @@ -1,7 +1,7 @@ --- title: Changelog github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: CHANGELOG.md redirect_from: - /cli-documentation/misc/changelog @@ -17,6 +17,125 @@ redirect_from: # Changelog +## [9.8.1](https://github.com/npm/cli/compare/v9.8.0...v9.8.1) (2023-07-18) + +### Bug Fixes + +* [`38351c9`](https://github.com/npm/cli/commit/38351c954040ddea56dc5db453f7f7d10964e5cd) [#6651](https://github.com/npm/cli/pull/6651) warn on autocorrected package.json entries during publish (@wraithgar) +* [`02c7ddb`](https://github.com/npm/cli/commit/02c7ddb4501682c9e84b8c1325638b7db1ca7deb) [#6642](https://github.com/npm/cli/pull/6642) much clearer npx 'canceled' error (#6642) (@rahulio96, @AaronHamilton965) + +### Documentation + +* [`36bf5fe`](https://github.com/npm/cli/commit/36bf5fe2a0a2ef7f7ffc0b302eea15e227556010) [#6643](https://github.com/npm/cli/pull/6643) Added steps for using npm/npx locally to CONTRIBUTING.md (#6643) (@AaronHamilton965, @rahulio96) + +### Dependencies + +* [`a0763d3`](https://github.com/npm/cli/commit/a0763d38d8934a6769e5aac08539291c5051f36e) [#6651](https://github.com/npm/cli/pull/6651) `@npmcli/package-json@4.0.1` +* [`24f5a8b`](https://github.com/npm/cli/commit/24f5a8b07909710e06f5aa3844d99c03cce0b9ca) [#6653](https://github.com/npm/cli/pull/6653) `supports-color@9.4.0` +* [`f45498b`](https://github.com/npm/cli/commit/f45498b33550d3874b9602ef027f215ea2590124) [#6653](https://github.com/npm/cli/pull/6653) `chalk@5.3.0` +* [`44d60eb`](https://github.com/npm/cli/commit/44d60eb0c4ee0456ee4c9f855f06348cfb4c0f9c) [#6653](https://github.com/npm/cli/pull/6653) `minimatch@9.0.3` +* [`fc9a843`](https://github.com/npm/cli/commit/fc9a843f59ec4c1733d427566b9df9a4b440bb7f) [#6653](https://github.com/npm/cli/pull/6653) `bin-links@3.0.2` +* [`daad9ad`](https://github.com/npm/cli/commit/daad9addc1e2587d162e06016498252cf0b6514a) [#6653](https://github.com/npm/cli/pull/6653) `semver@7.5.4` +* [`c1ffd6a`](https://github.com/npm/cli/commit/c1ffd6a2f91cdb5c8d3cd7524a3136346181f67f) [#6653](https://github.com/npm/cli/pull/6653) move @npmcli/fs, @npmcli/promise-spawn into dependencies +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v6.0.3): `libnpmexec@6.0.3` + +## [9.8.0](https://github.com/npm/cli/compare/v9.7.2...v9.8.0) (2023-07-05) + +### Features + +* [`67459e7`](https://github.com/npm/cli/commit/67459e7b56a5e8d2b4f8eb3a0487183013c63b99) [#6626](https://github.com/npm/cli/pull/6626) add `pkg fix` subcommand (@wraithgar) +* [`89b2741`](https://github.com/npm/cli/commit/89b27413952ca454f715fee314d37e26f371444d) [#6548](https://github.com/npm/cli/pull/6548) add ps1 scripts (#6548) (@mribbons, @lukekarrys) + +### Dependencies + +* [`b252164`](https://github.com/npm/cli/commit/b252164dd5c866bf2d25c96836ad829d4d6909ee) [#6626](https://github.com/npm/cli/pull/6626) `@npmcli/package-json@4.0.0` +* [`9238682`](https://github.com/npm/cli/commit/92386822ddf0a849fd2c269b1f5ee9ee47082da0) [#6623](https://github.com/npm/cli/pull/6623) `sigstore@1.7.0` (#6623) +* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.3.0): `@npmcli/arborist@6.3.0` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.19): `libnpmdiff@5.0.19` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v6.0.2): `libnpmexec@6.0.2` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.19): `libnpmfund@4.0.19` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.19): `libnpmpack@5.0.19` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v7.5.0): `libnpmpublish@7.5.0` + +## [9.7.2](https://github.com/npm/cli/compare/v9.7.1...v9.7.2) (2023-06-21) + +### Bug Fixes + +* [`939a188`](https://github.com/npm/cli/commit/939a188bc3ab9c2bfa49ccb4837fe4ad844131ed) [#6574](https://github.com/npm/cli/pull/6574) ignore node prereleases in npm engines check (#6574) (@wraithgar) +* [`d980405`](https://github.com/npm/cli/commit/d980405ffcbc80ad63fbea680ee40a57ffc4a210) [#6556](https://github.com/npm/cli/pull/6556) better color support detection (#6556) (@lukekarrys) +* [`40d7e09`](https://github.com/npm/cli/commit/40d7e09aa9c038bc20e37c4fbd21d02dc82b93a7) [#6555](https://github.com/npm/cli/pull/6555) remove unnecessary package.json values (#6555) (@lukekarrys) +* [`3a7378d`](https://github.com/npm/cli/commit/3a7378d889707d2a4c1f8a6397dda87825e9f5a3) [#6554](https://github.com/npm/cli/pull/6554) cleanup bin contents (@lukekarrys) +* [`e722439`](https://github.com/npm/cli/commit/e722439b05bb4da691975359db58eac794f1f5d9) [#6497](https://github.com/npm/cli/pull/6497) move all definitions to @npmcli/config package (@lukekarrys) + +### Documentation + +* [`405ffbf`](https://github.com/npm/cli/commit/405ffbfa2758ec388c06120fdf5fde2a07835779) [#6557](https://github.com/npm/cli/pull/6557) remove redundant statement about files attribute (#6557) (@DaviDevMod) +* [`cd1e6aa`](https://github.com/npm/cli/commit/cd1e6aa320ccc264f5027de5976bb7acc32f1ded) [#6551](https://github.com/npm/cli/pull/6551) add flag `package-lock-only` for `npm install` (#6551) (@m4rch3n1ng) + +### Dependencies + +* [`aebc523`](https://github.com/npm/cli/commit/aebc523c46f6e37c943a750e4cb6ec4b8f12ae01) [#6585](https://github.com/npm/cli/pull/6585) `safe-buffer@5.2.1` `string_decoder@1.3.0` (#6585) +* [`bb6054b`](https://github.com/npm/cli/commit/bb6054b9558efd859e32ba9227453b3c84ef647d) [#6573](https://github.com/npm/cli/pull/6573) `tuf-js@1.1.7` +* [`aee4a30`](https://github.com/npm/cli/commit/aee4a30bfb88ac147f5f8ac9bdb28cfc0be16e7f) [#6573](https://github.com/npm/cli/pull/6573) `strip-ansi@7.1.0` +* [`6105dbc`](https://github.com/npm/cli/commit/6105dbcc1c1647c66759e73ad8699a539e8a70c3) [#6573](https://github.com/npm/cli/pull/6573) `path-scurry@1.9.2` +* [`22d44e8`](https://github.com/npm/cli/commit/22d44e81d6bced4c9d5960b74023ee017df6606b) [#6573](https://github.com/npm/cli/pull/6573) `read-package-json@6.0.4` +* [`fdd02fd`](https://github.com/npm/cli/commit/fdd02fde1c53ce66a3b15b55907fd7e80680b89b) [#6573](https://github.com/npm/cli/pull/6573) `jackspeak@2.2.1` +* [`7797075`](https://github.com/npm/cli/commit/77970756cb2a18257a50e765617f2237abe245d6) [#6573](https://github.com/npm/cli/pull/6573) `is-core-module@2.12.1` +* [`f9780cc`](https://github.com/npm/cli/commit/f9780ccbde62feb59691b5c2f19ed5f3688b1e7e) [#6573](https://github.com/npm/cli/pull/6573) `sigstore@1.6.0` +* [`72d6a79`](https://github.com/npm/cli/commit/72d6a79fa28aec50dab576e93ef06a89694770a5) [#6573](https://github.com/npm/cli/pull/6573) `semver@7.5.2` +* [`98f1f5f`](https://github.com/npm/cli/commit/98f1f5fd2d6890c207c77452739053a674d83990) [#6573](https://github.com/npm/cli/pull/6573) `nopt@7.2.0` +* [`8710ff8`](https://github.com/npm/cli/commit/8710ff88afffb573b4f65c4a19303924935fecd2) [#6573](https://github.com/npm/cli/pull/6573) `pacote@15.2.0` +* [`0cb539d`](https://github.com/npm/cli/commit/0cb539dae1311ef0f60ccf5bd47def1763c38852) [#6573](https://github.com/npm/cli/pull/6573) `node-gyp@9.4.0` +* [`39ad586`](https://github.com/npm/cli/commit/39ad5862ffc99b3da365ab3dd8538b68a4352ea5) [#6573](https://github.com/npm/cli/pull/6573) `ini@4.1.1` +* [`5e0070c`](https://github.com/npm/cli/commit/5e0070cf28353e94458e0d8190833595aa143314) [#6573](https://github.com/npm/cli/pull/6573) `glob@10.2.7` `minimatch@9.0.1` +* [`26cf235`](https://github.com/npm/cli/commit/26cf235aa45d0d4100f061f009c1ffdf0a1fdf16) [#6573](https://github.com/npm/cli/pull/6573) `cacache@17.1.3` +* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.10): `@npmcli/arborist@6.2.10` +* [Workspace](https://github.com/npm/cli/releases/tag/config-v6.2.1): `@npmcli/config@6.2.1` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.18): `libnpmdiff@5.0.18` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v6.0.1): `libnpmexec@6.0.1` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.18): `libnpmfund@4.0.18` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.18): `libnpmpack@5.0.18` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v7.4.0): `libnpmpublish@7.4.0` + +## [9.7.1](https://github.com/npm/cli/compare/v9.7.0...v9.7.1) (2023-06-06) + +### Dependencies + +* [`7467ff6`](https://github.com/npm/cli/commit/7467ff680a3fffbf6b974c5779229c2e54e8515f) [#6518](https://github.com/npm/cli/pull/6518) `@npmcli/package-json@3.1.1`, `@npmcli/git@4.1.0` + +## [9.7.0](https://github.com/npm/cli/compare/v9.6.7...v9.7.0) (2023-05-31) + +### Features + +* [`a63a6d8`](https://github.com/npm/cli/commit/a63a6d8d6fd339d504ab94c0364ce7ee3d4e3775) [#6490](https://github.com/npm/cli/pull/6490) add provenanceFile option for libnpmpublish (@bdehamer) +* [`2a8f4f2`](https://github.com/npm/cli/commit/2a8f4f203a47f60cc96312934927419a7d83c2f1) [#6490](https://github.com/npm/cli/pull/6490) add new exclusive config item publish-file (@wraithgar) +* [`361e194`](https://github.com/npm/cli/commit/361e1945b5a34230690ccf37a14687d021e1dbce) [#6483](https://github.com/npm/cli/pull/6483) implement flag --prefer-dedupe for `npm install` (#6483) (@m4rch3n1ng) + +### Bug Fixes + +* [`38eb39b`](https://github.com/npm/cli/commit/38eb39b8068ab4e3b0a544234ac5df804469e3d8) [#6514](https://github.com/npm/cli/pull/6514) strip ansi characters from search results (#6514) (@wraithgar) +* [`4b5ccfc`](https://github.com/npm/cli/commit/4b5ccfce376378521cb743bfbd32a724340e75b8) [#6477](https://github.com/npm/cli/pull/6477) make usage and completion static functions (#6477) (@lukekarrys) +* [`4f39e8c`](https://github.com/npm/cli/commit/4f39e8c983e652b66f9c342b93694a29dc5a0b92) [#6479](https://github.com/npm/cli/pull/6479) refactor engines validation to lint syntax (#6479) (@lukekarrys) +* [`f3cfe12`](https://github.com/npm/cli/commit/f3cfe129b2602e8f454acac572a51d8adc6c1111) [#6482](https://github.com/npm/cli/pull/6482) remove unused lib/npm relics (#6482) (@lukekarrys) +* [`87de0c7`](https://github.com/npm/cli/commit/87de0c79cca0788d728095cfb537447745bada13) [#6472](https://github.com/npm/cli/pull/6472) move explore command to @npmcli/package-json (@wraithgar) +* [`636e29e`](https://github.com/npm/cli/commit/636e29e2c887e7f197977e3215642b6778eb59de) [#6472](https://github.com/npm/cli/pull/6472) move to @npmcli/package-json where possible (@wraithgar) +* [`37cc797`](https://github.com/npm/cli/commit/37cc797341100cd0a8371e80b25b938f166c9d71) [#6418](https://github.com/npm/cli/pull/6418) retrieve registry keys via TUF (#6418) (@bdehamer) + +### Documentation + +* [`83cd5bd`](https://github.com/npm/cli/commit/83cd5bd68aa6255c598b8dd3a544f16129885aee) [#6480](https://github.com/npm/cli/pull/6480) add global option for uninstall (#6480) (@m4rch3n1ng) +* [`0400ce3`](https://github.com/npm/cli/commit/0400ce3c9d7af792c9931f1ba365e25b899833b6) [#6481](https://github.com/npm/cli/pull/6481) add cli params to `npm set`, `npm get` (#6481) (@m4rch3n1ng) +* [`c3638ce`](https://github.com/npm/cli/commit/c3638ce613364aff50fedb493a97f1ee60211158) [#6468](https://github.com/npm/cli/pull/6468) remove `package-lock` option for `npm ci` (#6468) (@m4rch3n1ng) + +### Dependencies + +* [`060d587`](https://github.com/npm/cli/commit/060d587f6f5a60db0c02c319c1df1a11c146442f) `chalk@5.2.0`, `npm-audit-report@5.0.0` +* [`fc52ca8`](https://github.com/npm/cli/commit/fc52ca8c0bd2aeb4e3885e5395ec647628bdd87c) [#6472](https://github.com/npm/cli/pull/6472) remove read-package-json-fast +* [`3238aa7`](https://github.com/npm/cli/commit/3238aa78905bc90b404dc3075ec810884f8fd1c8) [#6472](https://github.com/npm/cli/pull/6472) remove read-package-json +* [Workspace](https://github.com/npm/cli/releases/tag/config-v6.2.0): `@npmcli/config@6.2.0` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v6.0.0): `libnpmexec@6.0.0` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v7.3.0): `libnpmpublish@7.3.0` + ## [9.6.7](https://github.com/npm/cli/compare/v9.6.6...v9.6.7) (2023-05-17) ### Bug Fixes diff --git a/content/cli/v9/using-npm/config.md b/content/cli/v9/using-npm/config.md index c0c73c02f52..fd4f6edcf2f 100644 --- a/content/cli/v9/using-npm/config.md +++ b/content/cli/v9/using-npm/config.md @@ -3,7 +3,7 @@ title: config section: 7 description: More than you probably want to know about npm configuration github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/using-npm/config.md redirect_from: - /cli-documentation/misc/config @@ -149,6 +149,8 @@ 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 `npm login`. + + #### `access` * Default: 'public' for new packages, existing packages it will not change the @@ -165,6 +167,8 @@ 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 @@ -174,6 +178,8 @@ When running `npm outdated` and `npm ls`, setting `--all` will show all outdated or installed packages, rather than only those directly depended upon by the current project. + + #### `allow-same-version` * Default: false @@ -182,6 +188,8 @@ upon by the current project. Prevents throwing an error when `npm version` is used to set the new version to the same value as the current version. + + #### `audit` * Default: true @@ -192,6 +200,8 @@ default registry and all registries configured for scopes. See the documentation for [`npm audit`](/cli/v9/commands/npm-audit) for details on what is submitted. + + #### `audit-level` * Default: null @@ -200,6 +210,8 @@ submitted. The minimum level of vulnerability for `npm audit` to exit with a non-zero exit code. + + #### `auth-type` * Default: "web" @@ -208,6 +220,8 @@ exit code. What authentication strategy to use with `login`. Note that if an `otp` config is given, this value will always be set to `legacy`. + + #### `before` * Default: null @@ -223,6 +237,8 @@ If the requested version is a `dist-tag` and the given tag does not pass the will be used. For example, `foo@latest` might install `foo@1.2` even though `latest` is `2.0`. + + #### `bin-links` * Default: true @@ -235,6 +251,8 @@ 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. + + #### `browser` * Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"` @@ -247,6 +265,8 @@ terminal. Set to `true` to use default system URL opener. + + #### `ca` * Default: null @@ -273,6 +293,8 @@ ca[]="..." See also the `strict-ssl` config. + + #### `cache` * Default: Windows: `%LocalAppData%\npm-cache`, Posix: `~/.npm` @@ -280,6 +302,8 @@ See also the `strict-ssl` config. The location of npm's cache directory. + + #### `cafile` * Default: null @@ -289,6 +313,8 @@ A path to a file containing one or multiple Certificate Authority signing certificates. Similar to the `ca` setting, but allows for multiple CA's, as well as for the CA information to be stored in a file on disk. + + #### `call` * Default: "" @@ -302,6 +328,7 @@ npm exec --package yo --package generator-node --call "yo node" ``` + #### `cidr` * Default: null @@ -310,6 +337,8 @@ npm exec --package yo --package generator-node --call "yo node" This is a list of CIDR address to be used when configuring limited access tokens with the `npm token create` command. + + #### `color` * Default: true unless the NO_COLOR environ is set to something other than '0' @@ -318,6 +347,8 @@ tokens with the `npm token create` command. If false, never shows colors. If `"always"` then always shows colors. If true, then only prints color codes for tty file descriptors. + + #### `commit-hooks` * Default: true @@ -325,6 +356,8 @@ true, then only prints color codes for tty file descriptors. Run git commit hooks when using the `npm version` command. + + #### `depth` * Default: `Infinity` if `--all` is set, otherwise `1` @@ -335,6 +368,8 @@ The depth to go when recursing packages for `npm ls`. If not set, `npm ls` will show only the immediate dependencies of the root project. If `--all` is set, then npm will show all dependencies by default. + + #### `description` * Default: true @@ -342,6 +377,8 @@ project. If `--all` is set, then npm will show all dependencies by default. Show the description in `npm search` + + #### `diff` * Default: @@ -349,6 +386,8 @@ Show the description in `npm search` Define arguments to compare in `npm diff`. + + #### `diff-dst-prefix` * Default: "b/" @@ -356,6 +395,8 @@ Define arguments to compare in `npm diff`. Destination prefix to be used in `npm diff` output. + + #### `diff-ignore-all-space` * Default: false @@ -363,6 +404,8 @@ Destination prefix to be used in `npm diff` output. Ignore whitespace when comparing lines in `npm diff`. + + #### `diff-name-only` * Default: false @@ -370,6 +413,8 @@ Ignore whitespace when comparing lines in `npm diff`. Prints only filenames when using `npm diff`. + + #### `diff-no-prefix` * Default: false @@ -380,6 +425,8 @@ Do not show any source or destination prefix in `npm diff` output. Note: this causes `npm diff` to ignore the `--diff-src-prefix` and `--diff-dst-prefix` configs. + + #### `diff-src-prefix` * Default: "a/" @@ -387,6 +434,8 @@ Note: this causes `npm diff` to ignore the `--diff-src-prefix` and Source prefix to be used in `npm diff` output. + + #### `diff-text` * Default: false @@ -394,6 +443,8 @@ Source prefix to be used in `npm diff` output. Treat all files as text in `npm diff`. + + #### `diff-unified` * Default: 3 @@ -401,6 +452,8 @@ Treat all files as text in `npm diff`. The number of lines of context to print in `npm diff`. + + #### `dry-run` * Default: false @@ -414,6 +467,8 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + #### `editor` * Default: The EDITOR or VISUAL environment variables, or @@ -422,6 +477,8 @@ Note: This is NOT honored by other network related commands, eg `dist-tags`, The command to run for `npm edit` and `npm config edit`. + + #### `engine-strict` * Default: false @@ -433,6 +490,8 @@ Node.js version. This can be overridden by setting the `--force` flag. + + #### `fetch-retries` * Default: 2 @@ -444,6 +503,8 @@ from the registry. npm will retry idempotent read requests to the registry in the case of network failures or 5xx HTTP errors. + + #### `fetch-retry-factor` * Default: 10 @@ -451,6 +512,8 @@ network failures or 5xx HTTP errors. The "factor" config for the `retry` module to use when fetching packages. + + #### `fetch-retry-maxtimeout` * Default: 60000 (1 minute) @@ -459,6 +522,8 @@ The "factor" config for the `retry` module to use when fetching packages. The "maxTimeout" config for the `retry` module to use when fetching packages. + + #### `fetch-retry-mintimeout` * Default: 10000 (10 seconds) @@ -467,6 +532,8 @@ packages. The "minTimeout" config for the `retry` module to use when fetching packages. + + #### `fetch-timeout` * Default: 300000 (5 minutes) @@ -474,6 +541,8 @@ packages. The maximum amount of time to wait for HTTP requests to complete. + + #### `force` * Default: false @@ -500,6 +569,8 @@ mistakes, unnecessary performance degradation, and malicious input. 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! + + #### `foreground-scripts` * Default: false @@ -512,6 +583,8 @@ input, output, and error with the main npm process. Note that this will generally make installs run slower, and be much noisier, but can be useful for debugging. + + #### `format-package-lock` * Default: true @@ -520,6 +593,8 @@ but can be useful for debugging. Format `package-lock.json` or `npm-shrinkwrap.json` as a human readable file. + + #### `fund` * Default: true @@ -529,6 +604,8 @@ When "true" displays the message at the end of each `npm install` acknowledging the number of dependencies looking for funding. See [`npm fund`](/cli/v9/commands/npm-fund) for details. + + #### `git` * Default: "git" @@ -537,6 +614,8 @@ fund`](/cli/v9/commands/npm-fund) for details. The command to use for git commands. If git is installed on the computer, but is not in the `PATH`, then set this to the full path to the git binary. + + #### `git-tag-version` * Default: true @@ -545,6 +624,8 @@ but is not in the `PATH`, then set this to the full path to the git binary. Tag the commit when using the `npm version` command. Setting this to false results in no commit being made at all. + + #### `global` * Default: false @@ -559,6 +640,8 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + #### `globalconfig` * Default: The global --prefix setting plus 'etc/npmrc'. For example, @@ -567,6 +650,8 @@ folder instead of the current working directory. See The config file to read for global config options. + + #### `heading` * Default: "npm" @@ -574,6 +659,8 @@ The config file to read for global config options. The string that starts all the debugging log output. + + #### `https-proxy` * Default: null @@ -584,6 +671,8 @@ A proxy to use for outgoing https requests. If the `HTTPS_PROXY` or proxy settings will be honored by the underlying `make-fetch-happen` library. + + #### `if-present` * Default: false @@ -610,6 +699,8 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + #### `include` * Default: @@ -622,6 +713,8 @@ This is the inverse of `--omit=`. Dependency types specified in `--include` will not be omitted, regardless of the order in which omit/include are specified on the command-line. + + #### `include-staged` * Default: false @@ -632,6 +725,8 @@ Allow installing "staged" published packages, as defined by [npm RFC PR This is experimental, and not implemented by the npm public registry. + + #### `include-workspace-root` * Default: false @@ -652,6 +747,8 @@ This value is not exported to the environment for child processes. The value `npm init` should use by default for the package author's email. + + #### `init-author-name` * Default: "" @@ -659,6 +756,8 @@ The value `npm init` should use by default for the package author's email. The value `npm init` should use by default for the package author's name. + + #### `init-author-url` * Default: "" @@ -667,6 +766,8 @@ The value `npm init` should use by default for the package author's name. The value `npm init` should use by default for the package author's homepage. + + #### `init-license` * Default: "ISC" @@ -674,6 +775,8 @@ homepage. The value `npm init` should use by default for the package license. + + #### `init-module` * Default: "~/.npm-init.js" @@ -684,6 +787,8 @@ documentation for the [init-package-json](https://github.com/npm/init-package-json) module for more information, or [npm init](/cli/v9/commands/npm-init). + + #### `init-version` * Default: "1.0.0" @@ -692,6 +797,8 @@ more information, or [npm init](/cli/v9/commands/npm-init). The value that `npm init` should use by default for the package version number, if not already set in package.json. + + #### `install-links` * Default: false @@ -701,6 +808,8 @@ 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" @@ -713,6 +822,8 @@ place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted. + + #### `json` * Default: false @@ -725,6 +836,8 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + #### `legacy-peer-deps` * Default: false @@ -743,6 +856,8 @@ This differs from `--omit=peer`, in that `--omit=peer` will avoid unpacking Use of `legacy-peer-deps` is not recommended, as it will not enforce the `peerDependencies` contract that meta-dependencies may rely on. + + #### `link` * Default: false @@ -750,6 +865,8 @@ Use of `legacy-peer-deps` is not recommended, as it will not enforce the Used with `npm ls`, limiting output to only those packages that are linked. + + #### `local-address` * Default: null @@ -758,6 +875,8 @@ Used with `npm ls`, limiting output to only those packages that are linked. 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. + + #### `location` * Default: "user" unless `--global` is passed, which will also set this value @@ -775,6 +894,8 @@ instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + #### `lockfile-version` * Default: Version 3 if no lockfile, auto-converting v1 lockfiles to v3, @@ -797,6 +918,8 @@ determinism and interoperability, at the expense of more bytes on disk. 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" @@ -811,6 +934,8 @@ Any logs of a higher level than the setting are shown. The default is See also the `foreground-scripts` config. + + #### `logs-dir` * Default: A directory named `_logs` inside the cache @@ -819,6 +944,8 @@ See also the `foreground-scripts` config. The location of npm's log directory. See [`npm logging`](/cli/v9/using-npm/logging) for more information. + + #### `logs-max` * Default: 10 @@ -828,6 +955,8 @@ The maximum number of log files to store. If set to 0, no log files will be written for the current run. + + #### `long` * Default: false @@ -835,6 +964,8 @@ If set to 0, no log files will be written for the current run. Show extended information in `ls`, `search`, and `help-search`. + + #### `maxsockets` * Default: 15 @@ -843,6 +974,8 @@ Show extended information in `ls`, `search`, and `help-search`. The maximum number of connections to use per origin (protocol/host/port combination). + + #### `message` * Default: "%s" @@ -852,6 +985,8 @@ Commit message which is used by `npm version` when creating version commit. Any "%s" in the message will be replaced with the version number. + + #### `node-options` * Default: null @@ -861,6 +996,8 @@ 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. + + #### `noproxy` * Default: The value of the NO_PROXY environment variable @@ -870,6 +1007,8 @@ Domain extensions that should bypass any proxies. Also accepts a comma-delimited string. + + #### `offline` * Default: false @@ -878,6 +1017,8 @@ Also accepts a comma-delimited string. Force offline mode: no network requests will be done during install. To allow the CLI to fill in missing cache data, see `--prefer-offline`. + + #### `omit` * Default: 'dev' if the `NODE_ENV` environment variable is set to @@ -896,6 +1037,8 @@ it will be included. If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts. + + #### `omit-lockfile-registry-resolved` * Default: false @@ -906,6 +1049,8 @@ registry dependencies. Subsequent installs will need to resolve tarball endpoints with the configured registry, likely resulting in a longer install time. + + #### `otp` * Default: null @@ -917,6 +1062,8 @@ when publishing or changing package permissions with `npm access`. 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. + + #### `pack-destination` * Default: "." @@ -924,6 +1071,8 @@ password, npm will prompt on the command line for one. Directory in which `npm pack` will save tarballs. + + #### `package` * Default: @@ -931,6 +1080,8 @@ Directory in which `npm pack` will save tarballs. The package or packages to install for [`npm exec`](/cli/v9/commands/npm-exec) + + #### `package-lock` * Default: true @@ -939,7 +1090,7 @@ The package or packages to install for [`npm exec`](/cli/v9/commands/npm-exec) If set to false, then ignore `package-lock.json` files when installing. This will also prevent _writing_ `package-lock.json` if `save` is true. -This configuration does not affect `npm ci`. + #### `package-lock-only` @@ -955,6 +1106,8 @@ instead of checking `node_modules` and downloading dependencies. For `list` this means the output will be based on the tree described by the `package-lock.json`, rather than the contents of `node_modules`. + + #### `parseable` * Default: false @@ -963,6 +1116,18 @@ For `list` this means the output will be based on the tree described by the Output parseable results from commands that write to standard output. For `npm search`, this will be tab-separated table format. + + +#### `prefer-dedupe` + +* Default: false +* Type: Boolean + +Prefer to deduplicate packages if possible, rather than choosing a newer +version of a dependency. + + + #### `prefer-offline` * Default: false @@ -972,6 +1137,8 @@ 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 `--offline`. + + #### `prefer-online` * Default: false @@ -980,6 +1147,8 @@ will be requested from the server. To force full offline mode, use If true, staleness checks for cached data will be forced, making the CLI look for updates immediately even for fresh package data. + + #### `prefix` * Default: In global mode, the folder where the node executable is installed. @@ -990,6 +1159,8 @@ look for updates immediately even for fresh package data. The location to install global items. If set on the command line, then it forces non-global commands to run in the specified folder. + + #### `preid` * Default: "" @@ -998,6 +1169,8 @@ forces non-global commands to run in the specified folder. The "prerelease identifier" to use as a prefix for the "prerelease" part of a semver. Like the `rc` in `1.2.0-rc.8`. + + #### `progress` * Default: `true` unless running in a known CI system @@ -1008,6 +1181,8 @@ operations, if `process.stderr` is a TTY. Set to `false` to suppress the progress bar. + + #### `provenance` * Default: false @@ -1016,6 +1191,17 @@ Set to `false` to suppress the progress bar. When publishing from a supported cloud CI/CD system, the package will be publicly linked to where it was built and published from. +This config can not be used with: `provenance-file` + +#### `provenance-file` + +* Default: null +* Type: Path + +When publishing, the provenance bundle at the given path will be used. + +This config can not be used with: `provenance` + #### `proxy` * Default: null @@ -1025,6 +1211,8 @@ A proxy to use for outgoing http requests. If the `HTTP_PROXY` or `http_proxy` environment variables are set, proxy settings will be honored by the underlying `request` library. + + #### `read-only` * Default: false @@ -1033,6 +1221,8 @@ by the underlying `request` library. This is used to mark a token as unable to publish when configuring limited access tokens with the `npm token create` command. + + #### `rebuild-bundle` * Default: true @@ -1040,6 +1230,8 @@ access tokens with the `npm token create` command. Rebuild bundled dependencies after installation. + + #### `registry` * Default: "https://registry.npmjs.org/" @@ -1047,6 +1239,8 @@ Rebuild bundled dependencies after installation. The base URL of the npm registry. + + #### `replace-registry-host` * Default: "npmjs" @@ -1062,6 +1256,8 @@ registry host with the configured host every time. You may also specify a bare hostname (e.g., "registry.npmjs.org"). + + #### `save` * Default: `true` unless when using `npm update` where it defaults to `false` @@ -1074,6 +1270,8 @@ When used with the `npm rm` command, removes the dependency from Will also prevent writing to `package-lock.json` if set to `false`. + + #### `save-bundle` * Default: false @@ -1085,6 +1283,8 @@ If a package would be saved at install time by the use of `--save`, Ignored if `--save-peer` is set, since peerDependencies cannot be bundled. + + #### `save-dev` * Default: false @@ -1092,6 +1292,8 @@ Ignored if `--save-peer` is set, since peerDependencies cannot be bundled. Save installed packages to a package.json file as `devDependencies`. + + #### `save-exact` * Default: false @@ -1100,6 +1302,8 @@ Save installed packages to a package.json file as `devDependencies`. Dependencies saved to package.json will be configured with an exact version rather than using npm's default semver range operator. + + #### `save-optional` * Default: false @@ -1107,6 +1311,8 @@ rather than using npm's default semver range operator. Save installed packages to a package.json file as `optionalDependencies`. + + #### `save-peer` * Default: false @@ -1114,6 +1320,8 @@ Save installed packages to a package.json file as `optionalDependencies`. Save installed packages to a package.json file as `peerDependencies` + + #### `save-prefix` * Default: "^" @@ -1127,6 +1335,8 @@ to `^1.2.3` which allows minor upgrades for that package, but after `npm config set save-prefix='~'` it would be set to `~1.2.3` which only allows patch upgrades. + + #### `save-prod` * Default: false @@ -1139,6 +1349,8 @@ you want to move it to be a non-optional production dependency. This is the default behavior if `--save` is true, and neither `--save-dev` or `--save-optional` are true. + + #### `scope` * Default: the scope of the current project, if any, or "" @@ -1169,6 +1381,7 @@ npm init --scope=@foo --yes ``` + #### `script-shell` * Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows @@ -1177,6 +1390,8 @@ npm init --scope=@foo --yes The shell to use for scripts run with the `npm exec`, `npm run` and `npm init ` commands. + + #### `searchexclude` * Default: "" @@ -1184,6 +1399,8 @@ init ` commands. Space-separated options that limit the results from search. + + #### `searchlimit` * Default: 20 @@ -1192,6 +1409,8 @@ Space-separated options that limit the results from search. Number of items to limit search results to. Will not apply at all to legacy searches. + + #### `searchopts` * Default: "" @@ -1199,6 +1418,8 @@ searches. Space-separated options that are always passed to search. + + #### `searchstaleness` * Default: 900 @@ -1207,6 +1428,8 @@ Space-separated options that are always passed to search. The age of the cache, in seconds, before another registry request is made if using legacy search endpoint. + + #### `shell` * Default: SHELL environment variable, or "bash" on Posix, or "cmd.exe" on @@ -1215,6 +1438,8 @@ using legacy search endpoint. The shell to run for the `npm explore` command. + + #### `sign-git-commit` * Default: false @@ -1226,6 +1451,8 @@ version using `-S` to add a signature. Note that git requires you to have set up GPG keys in your git configs for this to work properly. + + #### `sign-git-tag` * Default: false @@ -1237,6 +1464,8 @@ If set to true, then the `npm version` command will tag the version using Note that git requires you to have set up GPG keys in your git configs for this to work properly. + + #### `strict-peer-deps` * Default: false @@ -1256,6 +1485,8 @@ When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If `--strict-peer-deps` is set, then this warning is treated as a failure. + + #### `strict-ssl` * Default: true @@ -1266,6 +1497,8 @@ via https. See also the `ca` config. + + #### `tag` * Default: "latest" @@ -1280,6 +1513,8 @@ command, if no explicit tag is given. When used by the `npm diff` command, this is the tag used to fetch the tarball that will be compared with the local files by default. + + #### `tag-version-prefix` * Default: "v" @@ -1293,6 +1528,8 @@ 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 particular, use care when overriding this setting for public packages. + + #### `timing` * Default: false @@ -1307,6 +1544,8 @@ You can quickly view it with this [json](https://npm.im/json) command line: Timing information will also be reported in the terminal. To suppress this while still writing the timing file, use `--silent`. + + #### `umask` * Default: 0 @@ -1327,6 +1566,8 @@ Thus, the effective default umask value on most POSIX systems is 0o22, meaning that folders and executables are created with a mode of 0o755 and other files are created with a mode of 0o644. + + #### `unicode` * Default: false on windows, true on mac/unix systems with a unicode locale, @@ -1336,6 +1577,8 @@ other files are created with a mode of 0o644. When set to true, npm uses unicode characters in the tree output. When false, it uses ascii characters instead of unicode glyphs. + + #### `update-notifier` * Default: true @@ -1344,6 +1587,8 @@ false, it uses ascii characters instead of unicode glyphs. Set to false to suppress the update notification when using an older version of npm than the latest. + + #### `usage` * Default: false @@ -1351,6 +1596,8 @@ of npm than the latest. Show short usage output about the command specified. + + #### `user-agent` * Default: "npm/{npm-version} node/{node-version} {platform} {arch} @@ -1369,6 +1616,8 @@ their actual counterparts: * `{ci}` - The value of the `ci-name` config, if set, prefixed with `ci/`, or an empty string if `ci-name` is empty. + + #### `userconfig` * Default: "~/.npmrc" @@ -1380,6 +1629,8 @@ This may be overridden by the `npm_config_userconfig` environment variable or the `--userconfig` command line option, but may _not_ be overridden by settings in the `globalconfig` file. + + #### `version` * Default: false @@ -1389,6 +1640,8 @@ If true, output the npm version and exit successfully. Only relevant when specified explicitly on the command line. + + #### `versions` * Default: false @@ -1400,6 +1653,8 @@ exists, and exit successfully. Only relevant when specified explicitly on the command line. + + #### `viewer` * Default: "man" on Posix, "browser" on Windows @@ -1409,6 +1664,8 @@ The program to use to view help content. Set to `"browser"` to view html help content in the default web browser. + + #### `which` * Default: null @@ -1416,6 +1673,8 @@ Set to `"browser"` to view html help content in the default web browser. If there are multiple funding sources, which 1-indexed source URL to open. + + #### `workspace` * Default: @@ -1464,6 +1723,8 @@ This value is not exported to the environment for child processes. If set to true, the npm cli will run an update after operations that may possibly change the workspaces installed to the `node_modules` folder. + + #### `yes` * Default: null @@ -1472,6 +1733,8 @@ possibly change the workspaces installed to the `node_modules` folder. Automatically answer "yes" to any prompts that npm might print on the command line. + + #### `also` * Default: null @@ -1480,6 +1743,8 @@ command line. When set to `dev` or `development`, this is an alias for `--include=dev`. + + #### `cache-max` * Default: Infinity @@ -1488,6 +1753,8 @@ When set to `dev` or `development`, this is an alias for `--include=dev`. `--cache-max=0` is an alias for `--prefer-online` + + #### `cache-min` * Default: 0 @@ -1496,6 +1763,8 @@ When set to `dev` or `development`, this is an alias for `--include=dev`. `--cache-min=9999 (or bigger)` is an alias for `--prefer-offline`. + + #### `cert` * Default: null @@ -1517,6 +1786,8 @@ 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 @@ -1529,6 +1800,8 @@ The name of a continuous integration system. If not set explicitly, npm will detect the current CI environment using the [`ci-info`](http://npm.im/ci-info) module. + + #### `dev` * Default: false @@ -1537,6 +1810,8 @@ detect the current CI environment using the Alias for `--include=dev`. + + #### `global-style` * Default: false @@ -1547,6 +1822,8 @@ Alias for `--include=dev`. Only install direct dependencies in the top level `node_modules`, but hoist on deeper dependencies. Sets `--install-strategy=shallow`. + + #### `init.author.email` * Default: "" @@ -1555,6 +1832,8 @@ on deeper dependencies. Sets `--install-strategy=shallow`. Alias for `--init-author-email` + + #### `init.author.name` * Default: "" @@ -1563,6 +1842,8 @@ Alias for `--init-author-email` Alias for `--init-author-name` + + #### `init.author.url` * Default: "" @@ -1571,6 +1852,8 @@ Alias for `--init-author-name` Alias for `--init-author-url` + + #### `init.license` * Default: "ISC" @@ -1579,6 +1862,8 @@ Alias for `--init-author-url` Alias for `--init-license` + + #### `init.module` * Default: "~/.npm-init.js" @@ -1587,6 +1872,8 @@ Alias for `--init-license` Alias for `--init-module` + + #### `init.version` * Default: "1.0.0" @@ -1595,6 +1882,8 @@ Alias for `--init-module` Alias for `--init-version` + + #### `key` * Default: null @@ -1614,6 +1903,8 @@ 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 @@ -1626,6 +1917,8 @@ 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 @@ -1634,6 +1927,8 @@ de-duplicating. Sets `--install-strategy=nested`. When set to `prod` or `production`, this is an alias for `--omit=dev`. + + #### `optional` * Default: null @@ -1645,6 +1940,8 @@ Default value does install optional deps unless otherwise omitted. Alias for --include=optional or --omit=optional + + #### `production` * Default: null @@ -1653,6 +1950,8 @@ Alias for --include=optional or --omit=optional Alias for `--omit=dev` + + #### `shrinkwrap` * Default: true @@ -1661,6 +1960,8 @@ Alias for `--omit=dev` Alias for --package-lock + + #### `tmp` * Default: The value returned by the Node.js `os.tmpdir()` method @@ -1673,6 +1974,8 @@ Alias for --package-lock Historically, the location where temporary files were stored. No longer relevant. + + ### See also * [npm config](/cli/v9/commands/npm-config) diff --git a/content/cli/v9/using-npm/dependency-selectors.md b/content/cli/v9/using-npm/dependency-selectors.md index 28ced8cb50a..02289bbb9d8 100644 --- a/content/cli/v9/using-npm/dependency-selectors.md +++ b/content/cli/v9/using-npm/dependency-selectors.md @@ -3,7 +3,7 @@ title: Dependency Selector Syntax & Querying section: 7 description: Dependency Selector Syntax & Querying github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/using-npm/dependency-selectors.md redirect_from: - /cli-documentation/misc/dependency-selectors diff --git a/content/cli/v9/using-npm/developers.md b/content/cli/v9/using-npm/developers.md index a5c33823472..689d6da533a 100644 --- a/content/cli/v9/using-npm/developers.md +++ b/content/cli/v9/using-npm/developers.md @@ -3,7 +3,7 @@ title: developers section: 7 description: Developer Guide github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/using-npm/developers.md redirect_from: - /cli-documentation/misc/developers diff --git a/content/cli/v9/using-npm/index.mdx b/content/cli/v9/using-npm/index.mdx index 0487f526e2c..cee3a672bfb 100644 --- a/content/cli/v9/using-npm/index.mdx +++ b/content/cli/v9/using-npm/index.mdx @@ -2,7 +2,7 @@ title: Using npm shortName: Using github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/nav.yml redirect_from: - /cli-documentation/misc diff --git a/content/cli/v9/using-npm/logging.md b/content/cli/v9/using-npm/logging.md index f964ad9be4c..594ee8b5df8 100644 --- a/content/cli/v9/using-npm/logging.md +++ b/content/cli/v9/using-npm/logging.md @@ -3,7 +3,7 @@ title: Logging section: 7 description: Why, What & How We Log github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/using-npm/logging.md redirect_from: - /cli-documentation/misc/logging diff --git a/content/cli/v9/using-npm/orgs.md b/content/cli/v9/using-npm/orgs.md index f497bb34c53..0f0eacc4c39 100644 --- a/content/cli/v9/using-npm/orgs.md +++ b/content/cli/v9/using-npm/orgs.md @@ -3,7 +3,7 @@ title: orgs section: 7 description: Working with Teams & Orgs github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/using-npm/orgs.md redirect_from: - /cli-documentation/misc/orgs diff --git a/content/cli/v9/using-npm/package-spec.md b/content/cli/v9/using-npm/package-spec.md index d315d41ace6..571bd7eed98 100644 --- a/content/cli/v9/using-npm/package-spec.md +++ b/content/cli/v9/using-npm/package-spec.md @@ -3,7 +3,7 @@ title: package-spec section: 7 description: Package name specifier github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/using-npm/package-spec.md redirect_from: - /cli-documentation/misc/package-spec diff --git a/content/cli/v9/using-npm/registry.md b/content/cli/v9/using-npm/registry.md index bd7020d4d17..0e20726d150 100644 --- a/content/cli/v9/using-npm/registry.md +++ b/content/cli/v9/using-npm/registry.md @@ -3,7 +3,7 @@ title: registry section: 7 description: The JavaScript Package Registry github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/using-npm/registry.md redirect_from: - /cli-documentation/misc/registry diff --git a/content/cli/v9/using-npm/removal.md b/content/cli/v9/using-npm/removal.md index 247e68bbdfe..fae60db1225 100644 --- a/content/cli/v9/using-npm/removal.md +++ b/content/cli/v9/using-npm/removal.md @@ -3,7 +3,7 @@ title: removal section: 7 description: Cleaning the Slate github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/using-npm/removal.md redirect_from: - /cli-documentation/misc/removal diff --git a/content/cli/v9/using-npm/scope.md b/content/cli/v9/using-npm/scope.md index dc037b40523..51fd38edb5c 100644 --- a/content/cli/v9/using-npm/scope.md +++ b/content/cli/v9/using-npm/scope.md @@ -3,7 +3,7 @@ title: scope section: 7 description: Scoped packages github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/using-npm/scope.md redirect_from: - /cli-documentation/misc/npm-scope diff --git a/content/cli/v9/using-npm/scripts.md b/content/cli/v9/using-npm/scripts.md index 0b1833b4c6c..a2b08df0888 100644 --- a/content/cli/v9/using-npm/scripts.md +++ b/content/cli/v9/using-npm/scripts.md @@ -3,7 +3,7 @@ title: scripts section: 7 description: How npm handles the "scripts" field github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/using-npm/scripts.md redirect_from: - /cli-documentation/misc/scripts diff --git a/content/cli/v9/using-npm/workspaces.md b/content/cli/v9/using-npm/workspaces.md index 32b78b643ea..d8fabb04140 100644 --- a/content/cli/v9/using-npm/workspaces.md +++ b/content/cli/v9/using-npm/workspaces.md @@ -3,7 +3,7 @@ title: workspaces section: 7 description: Working with workspaces github_repo: npm/cli -github_branch: latest +github_branch: release/v9 github_path: docs/lib/content/using-npm/workspaces.md redirect_from: - /cli-documentation/misc/workspaces diff --git a/content/integrations/integrating-npm-with-external-services/about-access-tokens.mdx b/content/integrations/integrating-npm-with-external-services/about-access-tokens.mdx index 74d199428a9..b66a401bfcf 100644 --- a/content/integrations/integrating-npm-with-external-services/about-access-tokens.mdx +++ b/content/integrations/integrating-npm-with-external-services/about-access-tokens.mdx @@ -40,7 +40,7 @@ There are three different types of legacy tokens: * **Read-only**: You can use these tokens to download packages from the registry. These tokens are best for automation and workflows where you are installing packages. For greater security, we recommend using [granular access tokens](#about-granular-access-tokens) instead. * **Automation**: You can use these tokens to download packages and install new ones. These tokens are best for automation workflows where you are publishing new packages. Automation tokens do not 2FA for executing operations on npm and are suitable for CI/CD workflows. For greater security, we recommend using [granular access tokens](#about-granular-access-tokens) instead. -* **Publish**: You can use these tokens to download packages, install packages, and update user and package settings. We recommend using them for interactive workflows such as a CLI. If 2FA is enabled on your account, publish tokens will require 2FA to execute sensitive operations on npm. +* **Publish**: You can use these tokens to download packages, install packages, and update user and package settings. We recommend using them for interactive workflows such as a CLI. If 2FA is enabled on your account, publish tokens will require 2FA to execute sensitive operations on npm. Legacy tokens do not have an expiration date. It is important to be aware of your tokens and keep them protected for account security. For more information, see "[Securing your token][secure-token]." @@ -54,9 +54,9 @@ Granular access tokens allow you to restrict access provided to the token based * Limit token access based on IP address ranges * Select between **read-only** or **read and write** access -You can create up to 50 granular access tokens on your npm account. You can set how long your token is valid for, up to a maximum expiration of 365 days from creation. Each token can access up to 50 organizations, and up to either 50 packages, 50 scopes, or a combination of 50 packages and scopes. Access tokens are tied to users’ permission; hence it cannot have more permission than the user at any point in time. If a user has their access revoked from a package or an org., their granular access token also will have its access revoked from those packages or org. +You can create up to 1000 granular access tokens on your npm account. You can set how long your token is valid for, at least one day in the future. Each token can access up to 50 organizations, and up to either 50 packages, 50 scopes, or a combination of 50 packages and scopes. Access tokens are tied to users’ permission; hence it cannot have more permission than the user at any point in time. If a user has their access revoked from a package or an org., their granular access token also will have its access revoked from those packages or org. -When you give a token access to an organization, the token can only be used for managing organization settings and teams or users associated with the organization. It does not give the token the right to publish packages managed by the organization. +When you give a token access to an organization, the token can only be used for managing organization settings and teams or users associated with the organization. It does not give the token the right to publish packages managed by the organization. [create-token]: creating-and-viewing-access-tokens [secure-token]: using-private-packages-in-a-ci-cd-workflow#securing-your-token diff --git a/content/integrations/integrating-npm-with-external-services/creating-and-viewing-access-tokens.mdx b/content/integrations/integrating-npm-with-external-services/creating-and-viewing-access-tokens.mdx index d60e1666d05..32241e566fa 100644 --- a/content/integrations/integrating-npm-with-external-services/creating-and-viewing-access-tokens.mdx +++ b/content/integrations/integrating-npm-with-external-services/creating-and-viewing-access-tokens.mdx @@ -51,19 +51,19 @@ You can [create](#creating-access-tokens) and [view](#viewing-access-tokens) acc 3. In the **Token name** field, enter a name for your token. - + 4. (Optional) In the **Description** field, enter a description for your token. -5. In the **Expiration** field, enter a token expiration period. This must be between 1 and 365 days. - -6. (Optional) In the **Allowed IP Ranges** field, enter IP address ranges to restrict your access token to. You must use [CIDR][cidr-wiki] notation to enter IP address ranges. To add more than one allowed IP range, click **Add IP Range** and enter an IP range in the new text field. +5. In the **Expiration** field, enter a token expiration period. The date must be at least 1 day in the future. + +6. (Optional) In the **Allowed IP Ranges** field, enter IP address ranges to restrict your access token to. You must use [CIDR][cidr-wiki] notation to enter IP address ranges. To add more than one allowed IP range, click **Add IP Range** and enter an IP range in the new text field. - -7. (Optional) In the **Packages and scopes** section, configure your token's access to packages and scopes. + +7. (Optional) In the **Packages and scopes** section, configure your token's access to packages and scopes. - In the **Permissions** dropdown menu, select **No access**, **Read-only**, or **Read and write**. - - Under **Select Packages**, select either: + - Under **Select Packages**, select either: - **All Packages** to grant the token access to all packages the user account has access to. - **Only select packages and scopes** to choose up to 50 specific packages or scopes to give the token access to. Then select specific packages or scopes from the dropdown menu. @@ -71,14 +71,14 @@ You can [create](#creating-access-tokens) and [view](#viewing-access-tokens) acc 8. (Optional) In the **Organizations** section, configure your token's access to organizations. - In the **Permissions** dropdown menu, select **No access**, **Read-only**, or **Read and write**. - - Under **Select organizations**, select the organizations you want to grant your token access to. + - Under **Select organizations**, select the organizations you want to grant your token access to. _**Note**: When you give a token access to an organization, the token can only be used for managing organization settings and teams or users associated with the organization. It does not give the token the right to publish packages managed by the organization._ 9. Review the token summary, then click **Generate Token**. - + 10. Copy the token from the top of page. @@ -91,7 +91,7 @@ You can create tokens with **read-only** permissions or **read and publish** per **Note:** You cannot create legacy automation tokens or granular access tokens from the CLI. You must use the website to generate these types of tokens. For more information, see "[Creating legacy tokens on the website](#creating-legacy-tokens-on-the-website)" and "[Creating granular access tokens on the website](#creating-granular-access-tokens-on-the-website)." - + - **Read-only:** Tokens that allow installation and distribution only, but no publishing or other rights associated with your account. - **Publish:** The default setting for new tokens, and most permissive token type. Publish tokens allow installation, distribution, modification, publishing, and all rights that you have on your account. diff --git a/content/organizations/managing-organization-members/organization-roles-and-permissions.mdx b/content/organizations/managing-organization-members/organization-roles-and-permissions.mdx index 9881e2bdcc8..99ee196472e 100644 --- a/content/organizations/managing-organization-members/organization-roles-and-permissions.mdx +++ b/content/organizations/managing-organization-members/organization-roles-and-permissions.mdx @@ -15,15 +15,16 @@ There are three roles in an organization: | Action | **Owner** | **Admin** | **Member** | |:------------------------------------------------------|:---------:|:---------:|:----------:| -| Manage organization billing | X | | | -| Add members to the organization | X | | | -| Remove members from the organization | X | | | -| Rename an organization | X | | | -| Delete an organization | X | | | -| Change any organization member's role | X | | | -| Create teams | X | X | | -| Delete teams | X | X | | -| Add any member to any team | X | X | | -| Remove any member from any team | X | X | | -| Manage team package access | X | X | | -| Create and publish packages in the organization scope | X | X | X | +| Manage organization billing | X | | | +| Add members to the organization | X | | | +| Remove members from the organization | X | | | +| Rename an organization | X | | | +| Delete an organization | X | | | +| Change any organization member's role | X | | | +| Add org owned packages to other orgs | X | | | +| Create teams | X | X | | +| Delete teams | X | X | | +| Add any member to any team | X | X | | +| Remove any member from any team | X | X | | +| Manage team package access | X | X | | +| Create and publish packages in the organization scope | X | X | X | diff --git a/content/packages-and-modules/contributing-packages-to-the-registry/creating-and-publishing-scoped-public-packages.mdx b/content/packages-and-modules/contributing-packages-to-the-registry/creating-and-publishing-scoped-public-packages.mdx index 491a7e38dcc..d09cc30b616 100644 --- a/content/packages-and-modules/contributing-packages-to-the-registry/creating-and-publishing-scoped-public-packages.mdx +++ b/content/packages-and-modules/contributing-packages-to-the-registry/creating-and-publishing-scoped-public-packages.mdx @@ -101,7 +101,7 @@ By default, scoped packages are published with private visibility. To publish a For more information on the `publish` command, see the [CLI documentation][cli-publish]. -[scopes]: about-scopes +[scopes]: /about-scopes [user-signup]: https://www.npmjs.com/signup [create-org]: https://www.npmjs.com/signup?next=/org/create [reg-config]: configuring-your-registry-settings-as-an-npm-enterprise-user diff --git a/content/packages-and-modules/contributing-packages-to-the-registry/index.mdx b/content/packages-and-modules/contributing-packages-to-the-registry/index.mdx index 0a7966aa4ed..010340d71bd 100644 --- a/content/packages-and-modules/contributing-packages-to-the-registry/index.mdx +++ b/content/packages-and-modules/contributing-packages-to-the-registry/index.mdx @@ -4,4 +4,4 @@ redirect_from: [ /getting-started/publishing-npm-packages ] --- - + diff --git a/content/packages-and-modules/getting-packages-from-the-registry/searching-for-and-choosing-packages-to-download.mdx b/content/packages-and-modules/getting-packages-from-the-registry/searching-for-and-choosing-packages-to-download.mdx index 523a299d4d7..b262be28f24 100644 --- a/content/packages-and-modules/getting-packages-from-the-registry/searching-for-and-choosing-packages-to-download.mdx +++ b/content/packages-and-modules/getting-packages-from-the-registry/searching-for-and-choosing-packages-to-download.mdx @@ -48,7 +48,7 @@ You can use this information to audit packages and determine whether or not you To view provenance information for a package in the npm registry: -1. In the npm registry, navigate to a package. +1. In the npm registry, navigate to a package. 2. On the package's page, in the **Version** field to the right of the README, look for a green check mark. If there is a green check mark, this means the package was published with provenance. @@ -66,6 +66,14 @@ To view provenance information for a package in the npm registry: + + +**Note:** Whenever you access a package's provenance information on npmjs.com, the linked source commit and repository are checked by npm. If the linked source commit or repository cannot be found, an error message will appear at the top of the page and alongside the provenance information. This is to inform you that the provenance for this package can no longer be established, which may occur when a repository is deleted or made private. + + + + + ### Verifying provenance attestations When you download a package from the registry, you can verify the provenance of a package with the following CLI command: diff --git a/content/packages-and-modules/securing-your-code/generating-provenance-statements.mdx b/content/packages-and-modules/securing-your-code/generating-provenance-statements.mdx index d29b6ef54ca..2a34da9f8b1 100644 --- a/content/packages-and-modules/securing-your-code/generating-provenance-statements.mdx +++ b/content/packages-and-modules/securing-your-code/generating-provenance-statements.mdx @@ -26,7 +26,7 @@ The transparency log service provides a public, verifiable, tamper-evident ledge ## Provenance limitations -- In order to publish a package with provenance, you must build your package with a supported cloud CI/CD provider using a cloud-hosted runner. Today this includes GitHub Actions, and we are collaborating with additional providers to expand support. For more information on how to establish provenance using GitHub Actions, see "[Publishing packages with provenance via GitHub Actions][publishing-with-provenance]." +- In order to publish a package with provenance, you must build your package with a supported cloud CI/CD provider using a cloud-hosted runner from a public source repository. Today this includes GitHub Actions and GitLab CI, and we are collaborating with additional providers to expand support. For more information on how to establish provenance using GitHub Actions, see "[Publishing packages with provenance via GitHub Actions][publishing-with-provenance]." - When a package in the npm registry has established provenance, it does not guarantee the package has no malicious code. Instead, npm provenance provides a verifiable link to the package's source code and build instructions, which developers can then audit and determine whether to trust it or not. For more information, see "[Searching for and choosing packages to download][provenance-info]." ## Prerequisites @@ -35,9 +35,9 @@ Before you can publish your packages with provenance, you must: - Review the [Linux Foundation Immutable Record notice](https://lfprojects.org/policies/hosted-project-tools-immutable-records/), which applies to the public transparency log. -- Install the latest version of the npm CLI. For more information, see "[Try the latest stable version of npm][update-npm]." +- Install the latest version of the npm CLI (ensure you are on `9.5.0+` as older versions don't support npm provenance). For more information, see "[Try the latest stable version of npm][update-npm]." -- Ensure your `package.json` is configured with a `repository` that matches where you are publishing with provenance from. +- Ensure your `package.json` is configured with a public `repository` that matches where you are publishing with provenance from. - Set up a GitHub Actions workflow to publish your packages to the npm registry. For more information, see [Understanding GitHub Actions][understand-actions] in the GitHub documentation. @@ -49,49 +49,72 @@ To update your GitHub Actions workflow to publish your packages with provenance, - Give permission to mint an ID-token: - ``` + ```yaml permissions: id-token: write ``` - Run on a [GitHub-hosted runner](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources): - ``` + ```yaml runs-on: ubuntu-latest ``` - Add the `--provenance` flag to your publish command: - ``` + ```sh npm publish --provenance ``` +- If you are publishing a package for the first time you will also need to explicitly set access to public: + + ```sh + npm publish --provenance --access public + ``` + ### Example GitHub Actions workflow This example workflow publishes a package to the npm registry with provenance. -``` +```yaml name: Publish Package to npmjs on: - release: - types: [created] + release: + types: [created] jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '18.x' - registry-url: 'https://registry.npmjs.org' - - run: npm install -g npm - - run: npm ci - - run: npm publish --provenance --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + build: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '18.x' + registry-url: 'https://registry.npmjs.org' + - run: npm install -g npm + - run: npm ci + - run: npm publish --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} +``` + +### Example GitLab CI job + +This example job publishes a package to the npm registry with provenance when a git tag is pushed. Don’t forget to define the `NPM_TOKEN` variable in your GitLab project settings. + +```yaml +publish: + image: 'node:20' + rules: + - if: $CI_COMMIT_TAG + id_tokens: + SIGSTORE_ID_TOKEN: + aud: sigstore + script: + - npm config set //registry.npmjs.org/:_authToken "$NPM_TOKEN" + - npm publish --provenance --access publich ``` ### Using third-party package publishing tools diff --git a/content/policies/unpublish.mdx b/content/policies/unpublish.mdx index 359fa022e39..d0e6ee8b621 100644 --- a/content/policies/unpublish.mdx +++ b/content/policies/unpublish.mdx @@ -44,12 +44,6 @@ This can be achieved by using one of the following from your command line: If the entire package is deprecated, the package name will be dropped from our search results. -Once deprecated, if you would also like for the package to be removed from your user profile, it can be [transferred](https://docs.npmjs.com/cli/owner) to our [@npm](https://www.npmjs.com/~npm) account. This can be achieved by using the following from your command line: - -- `npm owner add npm ` -- `npm owner rm ` - - ## More on our unpublish policy This document is additive to the [unpublish procedures](https://docs.npmjs.com/unpublishing-packages-from-the-registry), the CLI commands [unpublish documentation](https://docs.npmjs.com/cli/unpublish) and the ["Changes to npm Unpublish Policy - January 2020"](https://blog.npmjs.org/post/190553543620/changes-to-npmunpublish-policy-january-2020) blog post. @@ -76,4 +70,4 @@ Attribution-ShareAlike License](https://creativecommons.org/licenses/by-sa/4.0/). [dmca]: /policies/dmca -[contact]: /policies/privacy#contact \ No newline at end of file +[contact]: /policies/privacy#contact diff --git a/src/theme/nav.yml b/src/theme/nav.yml index 293d08a9a23..2b51e6245df 100644 --- a/src/theme/nav.yml +++ b/src/theme/nav.yml @@ -1055,7 +1055,7 @@ - title: Changelog url: /cli/v8/using-npm/changelog description: Changelog notes for each version - - title: Version 9.6.7 (Latest Release) + - title: Version 9.8.1 (Latest Release) shortName: v9 url: /cli/v9 default: true diff --git a/static/packages-and-modules/getting-packages-from-the-registry/npm-provenance-unreachable-source-commit@2x.png b/static/packages-and-modules/getting-packages-from-the-registry/npm-provenance-unreachable-source-commit@2x.png new file mode 100644 index 00000000000..6534a9ef76a Binary files /dev/null and b/static/packages-and-modules/getting-packages-from-the-registry/npm-provenance-unreachable-source-commit@2x.png differ