diff --git a/docs/content/commands/npm-audit.md b/docs/content/commands/npm-audit.md index 6a5c3e6be676e..dda1c31c864c4 100644 --- a/docs/content/commands/npm-audit.md +++ b/docs/content/commands/npm-audit.md @@ -109,9 +109,9 @@ the path `/-/npm/v1/security/advisories/bulk`. Any packages in the tree that do not have a `version` field in their package.json file will be ignored. If any `--omit` options are specified -(either via the `--omit` config, or one of the shorthands such as -`--production`, `--only=dev`, and so on), then packages will be omitted -from the submitted payload as appropriate. +(either via the [`--omit` config](/using-npm/config#omit), or one of the +shorthands such as `--production`, `--only=dev`, and so on), then packages will +be omitted from the submitted payload as appropriate. If the registry responds with an error, or with an invalid response, then npm will attempt to load advisory data from the `Quick Audit` endpoint. @@ -188,7 +188,7 @@ vulnerabilities are found _or_ if the remediation is able to successfully fix all vulnerabilities. If vulnerabilities were found the exit code will depend on the -`audit-level` configuration setting. +[`audit-level` config](/using-npm/config#audit-level). ### Examples diff --git a/docs/content/commands/npm-bugs.md b/docs/content/commands/npm-bugs.md index 6b45f1f18ac66..af52548389c92 100644 --- a/docs/content/commands/npm-bugs.md +++ b/docs/content/commands/npm-bugs.md @@ -25,8 +25,9 @@ alias: issues This command tries to guess at the likely location of a package's bug tracker URL or the `mailto` URL of the support email, and then tries to -open it using the `--browser` config param. If no package name is provided, it -will search for a `package.json` in the current folder and use the `name` property. +open it using the [`--browser` config](/using-npm/config#browser) param. If no +package name is provided, it will search for a `package.json` in the current +folder and use the `name` property. ### Configuration diff --git a/docs/content/commands/npm-dist-tag.md b/docs/content/commands/npm-dist-tag.md index 123e67dbf3b23..e505fba36414b 100644 --- a/docs/content/commands/npm-dist-tag.md +++ b/docs/content/commands/npm-dist-tag.md @@ -28,8 +28,8 @@ alias: dist-tags Add, remove, and enumerate distribution tags on a package: * add: Tags the specified version of the package with the specified tag, - or the `--tag` config if not specified. If you have two-factor - authentication on auth-and-writes then you’ll need to include a + or the [`--tag` config](/using-npm/config#tag) if not specified. If you have + two-factor authentication on auth-and-writes then you’ll need to include a one-time password on the command line with `--otp `, or at the OTP prompt. diff --git a/docs/content/commands/npm-docs.md b/docs/content/commands/npm-docs.md index 790d563bdb1fb..e48695ced005a 100644 --- a/docs/content/commands/npm-docs.md +++ b/docs/content/commands/npm-docs.md @@ -24,10 +24,10 @@ alias: home ### Description This command tries to guess at the likely location of a package's -documentation URL, and then tries to open it using the `--browser` config -param. You can pass multiple package names at once. If no package name is -provided, it will search for a `package.json` in the current folder and use -the `name` property. +documentation URL, and then tries to open it using the +[`--browser` config](/using-npm/config#browser) param. You can pass multiple +package names at once. If no package name is provided, it will search for a +`package.json` in the current folder and use the `name` property. ### Configuration diff --git a/docs/content/commands/npm-exec.md b/docs/content/commands/npm-exec.md index 3d8de1ea54ad6..7a66fbc27eb08 100644 --- a/docs/content/commands/npm-exec.md +++ b/docs/content/commands/npm-exec.md @@ -240,7 +240,8 @@ $ npx -c 'eslint && say "hooray, lint passed"' ### Workspaces support -You may use the `workspace` or `workspaces` configs in order to run an +You may use the [`workspace`](/using-npm/config#workspace) or +[`workspaces`](/using-npm/config#workspaces) configs in order to run an arbitrary command from an npm package (either one installed locally, or fetched remotely) in the context of the specified workspaces. If no positional argument or `--call` option is provided, it will open an @@ -271,9 +272,9 @@ Assuming the workspace configuration is properly set up at the root level ``` You can execute an arbitrary command from a package in the context of each of -the configured workspaces when using the `workspaces` configuration options, -in this example we're using **eslint** to lint any js file found within each -workspace folder: +the configured workspaces when using the +[`workspaces` config options](/using-npm/config#workspace), in this example +we're using **eslint** to lint any js file found within each workspace folder: ``` npm exec --ws -- eslint ./*.js diff --git a/docs/content/commands/npm-fund.md b/docs/content/commands/npm-fund.md index 8db0ce910de96..53100f6716537 100644 --- a/docs/content/commands/npm-fund.md +++ b/docs/content/commands/npm-fund.md @@ -25,9 +25,10 @@ This command retrieves information on how to fund the dependencies of a given project. If no package name is provided, it will list all dependencies that are looking for funding in a tree structure, listing the type of funding and the url to visit. If a package name is provided -then it tries to open its funding url using the `--browser` config -param; if there are multiple funding sources for the package, the user -will be instructed to pass the `--which` option to disambiguate. +then it tries to open its funding url using the +[`--browser` config](/using-npm/config#browser) param; if there are multiple +funding sources for the package, the user will be instructed to pass the +`--which` option to disambiguate. The list will avoid duplicated entries and will stack all packages that share the same url as a single entry. Thus, the list does not have the @@ -38,7 +39,8 @@ same shape of the output from `npm ls`. ### Workspaces support It's possible to filter the results to only include a single workspace -and its dependencies using the `workspace` config option. +and its dependencies using the +[`workspace` config](/using-npm/config#workspace) option. #### Example: diff --git a/docs/content/commands/npm-pkg.md b/docs/content/commands/npm-pkg.md index deff7e82c694d..32772ae080a8b 100644 --- a/docs/content/commands/npm-pkg.md +++ b/docs/content/commands/npm-pkg.md @@ -153,7 +153,8 @@ Returned values are always in **json** format. ### Workspaces support You can set/get/delete items across your configured workspaces by using the -`workspace` or `workspaces` config options. +[`workspace`](/using-npm/config#workspace) or +[`workspaces`](/using-npm/config#workspaces) config options. For example, setting a `funding` value across all configured workspaces of a project: diff --git a/docs/content/commands/npm-repo.md b/docs/content/commands/npm-repo.md index fc540a9382b23..4d69a922c63a9 100644 --- a/docs/content/commands/npm-repo.md +++ b/docs/content/commands/npm-repo.md @@ -22,9 +22,10 @@ npm repo [ [ ...]] ### Description This command tries to guess at the likely location of a package's -repository URL, and then tries to open it using the `--browser` config -param. If no package name is provided, it will search for a `package.json` -in the current folder and use the `repository` property. +repository URL, and then tries to open it using the +[`--browser` config](/using-npm/config#browser) param. If no package name is +provided, it will search for a `package.json` in the current folder and use the +`repository` property. ### Configuration diff --git a/docs/content/commands/npm-run-script.md b/docs/content/commands/npm-run-script.md index f606ec6bf59e5..a68b9b65dcd4f 100644 --- a/docs/content/commands/npm-run-script.md +++ b/docs/content/commands/npm-run-script.md @@ -68,7 +68,8 @@ The actual shell your script is run within is platform dependent. By default, on Unix-like systems it is the `/bin/sh` command, on Windows it is `cmd.exe`. The actual shell referred to by `/bin/sh` also depends on the system. -You can customize the shell with the `script-shell` configuration. +You can customize the shell with the +[`script-shell` config](/using-npm/config#script-shell). Scripts are run from the root of the package folder, regardless of what the current working directory is when `npm run` is called. If you want your @@ -85,7 +86,8 @@ forgotten. ### Workspaces support -You may use the `workspace` or `workspaces` configs in order to run an +You may use the [`workspace`](/using-npm/config#workspace) or +[`workspaces`](/using-npm/config#workspaces) configs in order to run an arbitrary command from a package's `"scripts"` object in the context of the specified workspaces. If no `"command"` is provided, it will list the available scripts for each of these configured workspaces. @@ -114,7 +116,8 @@ Assuming the workspace configuration is properly set up at the root level ``` And that each of the configured workspaces has a configured `test` script, -we can run tests in all of them using the `workspaces` config: +we can run tests in all of them using the +[`workspaces` config](/using-npm/config#workspaces): ``` npm test --workspaces diff --git a/docs/content/commands/npm-update.md b/docs/content/commands/npm-update.md index cd77b7baddf19..5e21bdeebbb99 100644 --- a/docs/content/commands/npm-update.md +++ b/docs/content/commands/npm-update.md @@ -24,9 +24,9 @@ aliases: up, upgrade, udpate ### Description This command will update all the packages listed to the latest version -(specified by the `tag` config), respecting the semver constraints of -both your package and its dependencies (if they also require the same -package). +(specified by the [`tag` config](/using-npm/config#tag)), respecting the semver +constraints of both your package and its dependencies (if they also require the +same package). It will also install missing packages. diff --git a/docs/content/commands/npm-version.md b/docs/content/commands/npm-version.md index 8e3334d788984..3c6b24d7d9ad8 100644 --- a/docs/content/commands/npm-version.md +++ b/docs/content/commands/npm-version.md @@ -192,18 +192,18 @@ disabled on the command line by running `npm --no-git-tag-version version`. It will fail if the working directory is not clean, unless the `-f` or `--force` flag is set. -If supplied with `-m` or `--message` config option, npm will use it as a -commit message when creating a version commit. If the `message` config -contains `%s` then that will be replaced with the resulting version number. -For example: +If supplied with `-m` or [`--message` config](/using-npm/config#message) option, +npm will use it as a commit message when creating a version commit. If the +`message` config contains `%s` then that will be replaced with the resulting +version number. For example: ```bash npm version patch -m "Upgrade to %s for reasons" ``` -If the `sign-git-tag` config is set, then the tag will be signed using the -`-s` flag to git. Note that you must have a default GPG key set up in your -git config for this to work properly. For example: +If the [`sign-git-tag` config](/using-npm/config#sign-git-tag) is set, then the +tag will be signed using the `-s` flag to git. Note that you must have a default +GPG key set up in your git config for this to work properly. For example: ```bash $ npm config set sign-git-tag true diff --git a/docs/content/configuring-npm/folders.md b/docs/content/configuring-npm/folders.md index 5bab80ec169c5..aa1c5738e3a4e 100644 --- a/docs/content/configuring-npm/folders.md +++ b/docs/content/configuring-npm/folders.md @@ -22,10 +22,10 @@ This document will tell you what it puts where. #### prefix Configuration -The `prefix` config defaults to the location where node is installed. -On most systems, this is `/usr/local`. On Windows, it's `%AppData%\npm`. -On Unix systems, it's one level up, since node is typically installed at -`{prefix}/bin/node` rather than `{prefix}/node.exe`. +The [`prefix` config](/using-npm/config#prefix) defaults to the location where +node is installed. On most systems, this is `/usr/local`. On Windows, it's +`%AppData%\npm`. On Unix systems, it's one level up, since node is typically +installed at `{prefix}/bin/node` rather than `{prefix}/node.exe`. When the `global` flag is set, npm installs things into this prefix. When it is not set, it uses the root of the current package, or the @@ -74,13 +74,13 @@ Man pages are not installed on Windows systems. See [`npm cache`](/commands/npm-cache). Cache files are stored in `~/.npm` on Posix, or `%AppData%/npm-cache` on Windows. -This is controlled by the `cache` configuration param. +This is controlled by the [`cache` config](/using-npm/config#cache) param. #### Temp Files Temporary files are stored by default in the folder specified by the -`tmp` config, which defaults to the TMPDIR, TMP, or TEMP environment -variables, or `/tmp` on Unix and `c:\windows\temp` on Windows. +[`tmp` config](/using-npm/config#tmp), which defaults to the TMPDIR, TMP, or +TEMP environment variables, or `/tmp` on Unix and `c:\windows\temp` on Windows. Temp files are given a unique folder under this root for each run of the program, and are deleted upon successful exit. @@ -111,7 +111,7 @@ be found by npm scripts when necessary. #### Global Installation -If the `global` configuration is set to true, then npm will +If the [`global` config](/using-npm/config#global) is set to true, then npm will install packages "globally". For global installation, packages are installed roughly the same way, diff --git a/docs/content/configuring-npm/package-json.md b/docs/content/configuring-npm/package-json.md index 39d672124ba25..68a4a62d2ae0a 100644 --- a/docs/content/configuring-npm/package-json.md +++ b/docs/content/configuring-npm/package-json.md @@ -1032,9 +1032,10 @@ capable of properly installing your program. For example: } ``` -Unless the user has set the `engine-strict` config flag, this field is -advisory only and will only produce warnings when your package is installed -as a dependency. +Unless the user has set the +[`engine-strict` config](/using-npm/config#engine-strict) flag, this field is +advisory only and will only produce warnings when your package is installed as a +dependency. ### os diff --git a/docs/content/using-npm/logging.md b/docs/content/using-npm/logging.md index eb83b167e698b..d699c8dca6ccc 100644 --- a/docs/content/using-npm/logging.md +++ b/docs/content/using-npm/logging.md @@ -58,7 +58,8 @@ The `npm` CLI began hiding the output of lifecycle scripts for `npm install` as ### Timing Information -The `--timing` config can be set which does two things: +The [`--timing` config](/using-npm/config#timing) can be set which does two +things: 1. Always shows the full path to the debug log regardless of command exit status 1. Write timing information to a timing file in the cache or `logs-dir` diff --git a/docs/content/using-npm/registry.md b/docs/content/using-npm/registry.md index fd7e44de48eba..5fab60ff4d49c 100644 --- a/docs/content/using-npm/registry.md +++ b/docs/content/using-npm/registry.md @@ -26,9 +26,11 @@ The npm public registry is powered by a CouchDB database, of which there is a public mirror at . The registry URL used is determined by the scope of the package (see -[`scope`](/using-npm/scope). If no scope is specified, the default registry is used, which is -supplied by the `registry` config parameter. See [`npm config`](/commands/npm-config), -[`npmrc`](/configuring-npm/npmrc), and [`config`](/using-npm/config) for more on managing npm's configuration. +[`scope`](/using-npm/scope). If no scope is specified, the default registry is +used, which is supplied by the [`registry` config](/using-npm/config#registry) +parameter. See [`npm config`](/commands/npm-config), +[`npmrc`](/configuring-npm/npmrc), and [`config`](/using-npm/config) for more on +managing npm's configuration. When the default registry is used in a package-lock or shrinkwrap is has the special meaning of "the currently configured registry". If you create a lock