diff --git a/deps/npm/README.md b/deps/npm/README.md index 7e4a5f38a7607f..b88882fadfee09 100644 --- a/deps/npm/README.md +++ b/deps/npm/README.md @@ -9,9 +9,9 @@ One of the following versions of [Node.js](https://nodejs.org/en/download/) must be installed to run **`npm`**: -* `12.x.x` >= `12.13.0` -* `14.x.x` >= `14.15.0` -* `16.0.0` or higher +* `14.x.x` >= `14.17.0` +* `16.x.x` >= `16.13.0` +* `18.0.0` or higher ### Installation diff --git a/deps/npm/bin/npx-cli.js b/deps/npm/bin/npx-cli.js index cb05e1cb706c6e..75090aed41f1fb 100755 --- a/deps/npm/bin/npx-cli.js +++ b/deps/npm/bin/npx-cli.js @@ -98,6 +98,7 @@ for (i = 3; i < process.argv.length; i++) { } if (removed.has(key)) { + // eslint-disable-next-line no-console console.error(`npx: the --${key} argument has been removed.`) sawRemovedFlags = true process.argv.splice(i, 1) @@ -122,6 +123,7 @@ for (i = 3; i < process.argv.length; i++) { } if (sawRemovedFlags) { + // eslint-disable-next-line no-console console.error('See `npm help exec` for more information') } diff --git a/deps/npm/docs/README.md b/deps/npm/docs/README.md new file mode 100644 index 00000000000000..5fc7ccf6cd60ac --- /dev/null +++ b/deps/npm/docs/README.md @@ -0,0 +1,5 @@ +# docs + +[![CI - docs](https://github.com/npm/cli/actions/workflows/ci-docs.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-docs.yml) + +Scripts to build the npm docs. diff --git a/deps/npm/docs/content/commands/npm-access.md b/deps/npm/docs/content/commands/npm-access.md index e707eb6f5e212d..f2078e1c9c38dd 100644 --- a/deps/npm/docs/content/commands/npm-access.md +++ b/deps/npm/docs/content/commands/npm-access.md @@ -7,15 +7,13 @@ description: Set access level on published packages ### Synopsis ```bash -npm access public [] -npm access restricted [] +npm access list packages [|| [] +npm access list collaborators [ []] +npm access get status [] +npm access set status=public|private [] +npm access set mfa=none|publish|automation [] npm access grant [] npm access revoke [] -npm access 2fa-required [] -npm access 2fa-not-required [] -npm access ls-packages [||] -npm access ls-collaborators [ []] -npm access edit [] ``` ### Description @@ -79,12 +77,17 @@ Management of teams and team memberships is done with the `npm team` command. ### Configuration -#### `registry` +#### `json` -* Default: "https://registry.npmjs.org/" -* Type: URL +* Default: false +* Type: Boolean -The base URL of the npm registry. +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. #### `otp` @@ -97,6 +100,13 @@ 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/" +* Type: URL + +The base URL of the npm registry. + ### See Also * [`libnpmaccess`](https://npm.im/libnpmaccess) diff --git a/deps/npm/docs/content/commands/npm-adduser.md b/deps/npm/docs/content/commands/npm-adduser.md index 2d040c6a4a5792..f0cd57be25a2b6 100644 --- a/deps/npm/docs/content/commands/npm-adduser.md +++ b/deps/npm/docs/content/commands/npm-adduser.md @@ -9,29 +9,19 @@ description: Add a registry user account ```bash npm adduser -aliases: login, add-user +alias: add-user ``` Note: This command is unaware of workspaces. ### Description -Create or verify a user named `` in the specified registry, and -save the credentials to the `.npmrc` file. If no registry is specified, -the default registry will be used (see [`config`](/using-npm/config)). +Create a new user in the specified registry, and save the credentials to +the `.npmrc` file. If no registry is specified, the default registry +will be used (see [`registry`](/using-npm/registry)). -The username, password, and email are read in from prompts. - -To reset your password, go to - -To change your email address, go to - -You may use this command multiple times with the same user account to -authorize on a new machine. When authenticating on a new machine, -the username, password and email address must all match with -your existing record. - -`npm login` is an alias to `adduser` and behaves exactly the same way. +When using `legacy` for your `auth-type`, the username, password, and +email are read in from prompts. ### Configuration @@ -74,11 +64,8 @@ npm init --scope=@foo --yes #### `auth-type` -* Default: "legacy" -* Type: "legacy", "web", "sso", "saml", "oauth", or "webauthn" - -NOTE: auth-type values "sso", "saml", "oauth", and "webauthn" will be -removed in a future version. +* Default: "web" +* Type: "legacy" or "web" What authentication strategy to use with `login`. diff --git a/deps/npm/docs/content/commands/npm-audit.md b/deps/npm/docs/content/commands/npm-audit.md index ab6395502328ea..25c733243660e9 100644 --- a/deps/npm/docs/content/commands/npm-audit.md +++ b/deps/npm/docs/content/commands/npm-audit.md @@ -100,9 +100,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. @@ -179,7 +179,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 @@ -408,12 +408,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### See Also diff --git a/deps/npm/docs/content/commands/npm-bin.md b/deps/npm/docs/content/commands/npm-bin.md deleted file mode 100644 index 16a28a8e1c3ace..00000000000000 --- a/deps/npm/docs/content/commands/npm-bin.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: npm-bin -section: 1 -description: Display npm bin folder ---- - -### Synopsis - -```bash -npm bin -``` - -Note: This command is unaware of workspaces. - -### Description - -Print the folder where npm will install executables. - -### Configuration - -#### `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](/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` - -### See Also - -* [npm prefix](/commands/npm-prefix) -* [npm root](/commands/npm-root) -* [npm folders](/configuring-npm/folders) -* [npm config](/commands/npm-config) -* [npmrc](/configuring-npm/npmrc) diff --git a/deps/npm/docs/content/commands/npm-bugs.md b/deps/npm/docs/content/commands/npm-bugs.md index 153355fc694f7e..1f135fc6c933a9 100644 --- a/deps/npm/docs/content/commands/npm-bugs.md +++ b/deps/npm/docs/content/commands/npm-bugs.md @@ -16,8 +16,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/deps/npm/docs/content/commands/npm-cache.md b/deps/npm/docs/content/commands/npm-cache.md index a6ef86dd22501f..a9d76179e81162 100644 --- a/deps/npm/docs/content/commands/npm-cache.md +++ b/deps/npm/docs/content/commands/npm-cache.md @@ -75,8 +75,7 @@ verify`. * Default: Windows: `%LocalAppData%\npm-cache`, Posix: `~/.npm` * Type: Path -The location of npm's cache directory. See [`npm -cache`](/commands/npm-cache) +The location of npm's cache directory. ### See Also diff --git a/deps/npm/docs/content/commands/npm-ci.md b/deps/npm/docs/content/commands/npm-ci.md index 474e27cdd0d967..4a5caf7d0c691f 100644 --- a/deps/npm/docs/content/commands/npm-ci.md +++ b/deps/npm/docs/content/commands/npm-ci.md @@ -106,27 +106,39 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` -#### `global-style` +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", or "shallow" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (coming soon) install in node_modules/.store, +link in place, unhoisted. + +#### `legacy-bundling` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. -#### `legacy-bundling` +#### `global-style` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependendencies. Sets `--install-strategy=shallow`. #### `omit` @@ -298,12 +310,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### See Also diff --git a/deps/npm/docs/content/commands/npm-config.md b/deps/npm/docs/content/commands/npm-config.md index 311183b9170101..fe87abac903e8a 100644 --- a/deps/npm/docs/content/commands/npm-config.md +++ b/deps/npm/docs/content/commands/npm-config.md @@ -12,6 +12,7 @@ npm config get [ [ ...]] npm config delete [ ...] npm config list [--json] npm config edit +npm config fix alias: c ``` @@ -26,7 +27,7 @@ variables, `npmrc` files, and in some cases, the `package.json` file. See [npmrc](/configuring-npm/npmrc) for more information about the npmrc files. -See [config(7)](/using-npm/config) for a more thorough explanation of the +See [config](/using-npm/config) for a more thorough explanation of the mechanisms involved, and a full list of config options available. The `npm config` command can be used to update and edit the contents @@ -91,6 +92,16 @@ npm config edit Opens the config file in an editor. Use the `--global` flag to edit the global config. +#### fix + +```bash +npm config fix +``` + +Attempts to repair invalid configuration items. Usually this means +attaching authentication config (i.e. `_auth`, `_authToken`) to the +configured `registry`. + ### Configuration #### `json` @@ -121,8 +132,8 @@ folder instead of the current working directory. See #### `editor` -* Default: The EDITOR or VISUAL environment variables, or 'notepad.exe' on - Windows, or 'vim' on Unix systems +* Default: The EDITOR or VISUAL environment variables, or + '%SYSTEMROOT%\notepad.exe' on Windows, or 'vi' on Unix systems * Type: String The command to run for `npm edit` and `npm config edit`. diff --git a/deps/npm/docs/content/commands/npm-dedupe.md b/deps/npm/docs/content/commands/npm-dedupe.md index f7fff73dc1786e..80353bad5d0d7a 100644 --- a/deps/npm/docs/content/commands/npm-dedupe.md +++ b/deps/npm/docs/content/commands/npm-dedupe.md @@ -77,27 +77,39 @@ values in `package.json` you can run: `npm update --save` instead. ### Configuration -#### `global-style` +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", or "shallow" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (coming soon) install in node_modules/.store, +link in place, unhoisted. + +#### `legacy-bundling` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. -#### `legacy-bundling` +#### `global-style` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependendencies. Sets `--install-strategy=shallow`. #### `strict-peer-deps` @@ -257,12 +269,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### See Also diff --git a/deps/npm/docs/content/commands/npm-dist-tag.md b/deps/npm/docs/content/commands/npm-dist-tag.md index d22831d2ce823e..e4a7fba665db38 100644 --- a/deps/npm/docs/content/commands/npm-dist-tag.md +++ b/deps/npm/docs/content/commands/npm-dist-tag.md @@ -19,8 +19,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/deps/npm/docs/content/commands/npm-docs.md b/deps/npm/docs/content/commands/npm-docs.md index e4c88dc19d337c..027a101d121e6b 100644 --- a/deps/npm/docs/content/commands/npm-docs.md +++ b/deps/npm/docs/content/commands/npm-docs.md @@ -15,10 +15,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/deps/npm/docs/content/commands/npm-edit.md b/deps/npm/docs/content/commands/npm-edit.md index 9f6750ff175415..04a4d15b5afcd9 100644 --- a/deps/npm/docs/content/commands/npm-edit.md +++ b/deps/npm/docs/content/commands/npm-edit.md @@ -29,8 +29,8 @@ changes to your locally installed copy. #### `editor` -* Default: The EDITOR or VISUAL environment variables, or 'notepad.exe' on - Windows, or 'vim' on Unix systems +* Default: The EDITOR or VISUAL environment variables, or + '%SYSTEMROOT%\notepad.exe' on Windows, or 'vi' on Unix systems * Type: String The command to run for `npm edit` and `npm config edit`. diff --git a/deps/npm/docs/content/commands/npm-exec.md b/deps/npm/docs/content/commands/npm-exec.md index b968671ed84670..af19ec5f077838 100644 --- a/deps/npm/docs/content/commands/npm-exec.md +++ b/deps/npm/docs/content/commands/npm-exec.md @@ -33,10 +33,11 @@ specified multiple times, to execute the supplied command in an environment where all specified packages are available. If any requested packages are not present in the local project -dependencies, then they are installed to a folder in the npm cache, which -is added to the `PATH` environment variable in the executed process. A -prompt is printed (which can be suppressed by providing either `--yes` or -`--no`). +dependencies, then a prompt is printed, which can be suppressed by +providing either `--yes` or `--no`. When standard input is not a TTY or a +CI environment is detected, `--yes` is assumed. The requested packages are +installed to a folder in the npm cache, which is added to the `PATH` +environment variable in the executed process. Package names provided without a specifier will be matched with whatever version exists in the local project. Package names with a specifier will @@ -211,7 +212,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 @@ -242,9 +244,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/deps/npm/docs/content/commands/npm-find-dupes.md b/deps/npm/docs/content/commands/npm-find-dupes.md index 723f04cfb11887..a3ef44eb5b7fb1 100644 --- a/deps/npm/docs/content/commands/npm-find-dupes.md +++ b/deps/npm/docs/content/commands/npm-find-dupes.md @@ -17,27 +17,39 @@ duplications, without actually changing the package tree. ### Configuration -#### `global-style` +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", or "shallow" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (coming soon) install in node_modules/.store, +link in place, unhoisted. + +#### `legacy-bundling` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. -#### `legacy-bundling` +#### `global-style` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependendencies. Sets `--install-strategy=shallow`. #### `strict-peer-deps` @@ -184,12 +196,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### See Also diff --git a/deps/npm/docs/content/commands/npm-fund.md b/deps/npm/docs/content/commands/npm-fund.md index 25a6735ec75473..0db66f49ad65b1 100644 --- a/deps/npm/docs/content/commands/npm-fund.md +++ b/deps/npm/docs/content/commands/npm-fund.md @@ -16,9 +16,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 @@ -29,7 +30,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/deps/npm/docs/content/commands/npm-install-ci-test.md b/deps/npm/docs/content/commands/npm-install-ci-test.md index c6c7f2196da2e5..9fd7c267b102f5 100644 --- a/deps/npm/docs/content/commands/npm-install-ci-test.md +++ b/deps/npm/docs/content/commands/npm-install-ci-test.md @@ -52,27 +52,39 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` -#### `global-style` +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", or "shallow" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (coming soon) install in node_modules/.store, +link in place, unhoisted. + +#### `legacy-bundling` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. -#### `legacy-bundling` +#### `global-style` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependendencies. Sets `--install-strategy=shallow`. #### `omit` @@ -244,12 +256,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### See Also diff --git a/deps/npm/docs/content/commands/npm-install-test.md b/deps/npm/docs/content/commands/npm-install-test.md index aa1ff35bc45892..5642472630b530 100644 --- a/deps/npm/docs/content/commands/npm-install-test.md +++ b/deps/npm/docs/content/commands/npm-install-test.md @@ -53,27 +53,39 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` -#### `global-style` +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", or "shallow" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (coming soon) install in node_modules/.store, +link in place, unhoisted. + +#### `legacy-bundling` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. -#### `legacy-bundling` +#### `global-style` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependendencies. Sets `--install-strategy=shallow`. #### `omit` @@ -245,12 +257,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### See Also diff --git a/deps/npm/docs/content/commands/npm-install.md b/deps/npm/docs/content/commands/npm-install.md index dc935de70aaf0f..3604aab4b940f2 100644 --- a/deps/npm/docs/content/commands/npm-install.md +++ b/deps/npm/docs/content/commands/npm-install.md @@ -118,7 +118,7 @@ into a tarball (b). * `npm install [<@scope>/]`: Do a `@` install, where `` is the "tag" config. (See - [`config`](/using-npm/config). The config's default value is `latest`.) + [`config`](/using-npm/config#tag). The config's default value is `latest`.) In most cases, this will install the version of the modules tagged as `latest` on the npm registry. @@ -443,27 +443,39 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` -#### `global-style` +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", or "shallow" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (coming soon) install in node_modules/.store, +link in place, unhoisted. + +#### `legacy-bundling` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. -#### `legacy-bundling` +#### `global-style` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependendencies. Sets `--install-strategy=shallow`. #### `omit` @@ -635,12 +647,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### Algorithm diff --git a/deps/npm/docs/content/commands/npm-link.md b/deps/npm/docs/content/commands/npm-link.md index 07917bc833003b..09459cc0ca8a50 100644 --- a/deps/npm/docs/content/commands/npm-link.md +++ b/deps/npm/docs/content/commands/npm-link.md @@ -144,27 +144,39 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` -#### `global-style` +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", or "shallow" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (coming soon) install in node_modules/.store, +link in place, unhoisted. + +#### `legacy-bundling` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. -#### `legacy-bundling` +#### `global-style` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependendencies. Sets `--install-strategy=shallow`. #### `strict-peer-deps` @@ -324,12 +336,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### See Also diff --git a/deps/npm/docs/content/commands/npm-login.md b/deps/npm/docs/content/commands/npm-login.md new file mode 100644 index 00000000000000..4feb7150400268 --- /dev/null +++ b/deps/npm/docs/content/commands/npm-login.md @@ -0,0 +1,87 @@ +--- +title: npm-login +section: 1 +description: Login to a registry user account +--- + +### Synopsis + +```bash +npm login +``` + +Note: This command is unaware of workspaces. + +### Description + +Verify a user in the specified registry, and save the credentials to the +`.npmrc` file. If no registry is specified, the default registry will be +used (see [`config`](/using-npm/config)). + +When using `legacy` for your `auth-type`, the username and password, are +read in from prompts. + +To reset your password, go to + +To change your email address, go to + +You may use this command multiple times with the same user account to +authorize on a new machine. When authenticating on a new machine, +the username, password and email address must all match with +your existing record. + +### Configuration + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + +#### `scope` + +* Default: the scope of the current project, if any, or "" +* Type: String + +Associate an operation with a scope for a scoped registry. + +Useful when logging in to or out of a private registry: + +``` +# log in, linking the scope to the custom registry +npm login --scope=@mycorp --registry=https://registry.mycorp.com + +# log out, removing the link and the auth token +npm logout --scope=@mycorp +``` + +This will cause `@mycorp` to be mapped to the registry for future +installation of packages specified according to the pattern +`@mycorp/package`. + +This will also cause `npm init` to create a scoped package. + +``` +# accept all defaults, and create a package named "@foo/whatever", +# instead of just named "whatever" +npm init --scope=@foo --yes +``` + + +#### `auth-type` + +* Default: "web" +* Type: "legacy" or "web" + +What authentication strategy to use with `login`. + +### See Also + +* [npm registry](/using-npm/registry) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) +* [npm owner](/commands/npm-owner) +* [npm whoami](/commands/npm-whoami) +* [npm token](/commands/npm-token) +* [npm profile](/commands/npm-profile) diff --git a/deps/npm/docs/content/commands/npm-ls.md b/deps/npm/docs/content/commands/npm-ls.md index 43d4eb7d6791cb..385c36728b7e70 100644 --- a/deps/npm/docs/content/commands/npm-ls.md +++ b/deps/npm/docs/content/commands/npm-ls.md @@ -27,7 +27,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@8.19.3 /path/to/npm +npm@9.1.3 /path/to/npm └─┬ init-package-json@0.0.4 └── promzard@0.1.5 ``` @@ -236,12 +236,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### See Also diff --git a/deps/npm/docs/content/commands/npm-pkg.md b/deps/npm/docs/content/commands/npm-pkg.md index 519104457df79e..484aabfca5431c 100644 --- a/deps/npm/docs/content/commands/npm-pkg.md +++ b/deps/npm/docs/content/commands/npm-pkg.md @@ -144,7 +144,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/deps/npm/docs/content/commands/npm-prune.md b/deps/npm/docs/content/commands/npm-prune.md index 95946d9dc969ca..0cd540f5c2d429 100644 --- a/deps/npm/docs/content/commands/npm-prune.md +++ b/deps/npm/docs/content/commands/npm-prune.md @@ -157,12 +157,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### See Also diff --git a/deps/npm/docs/content/commands/npm-publish.md b/deps/npm/docs/content/commands/npm-publish.md index 4963cf158a660d..09756aedf02724 100644 --- a/deps/npm/docs/content/commands/npm-publish.md +++ b/deps/npm/docs/content/commands/npm-publish.md @@ -103,19 +103,19 @@ tarball that will be compared with the local files by default. #### `access` -* Default: 'restricted' for scoped packages, 'public' for unscoped packages +* Default: 'public' for new packages, existing packages it will not change the + current level * Type: null, "restricted", or "public" -When publishing scoped packages, the access level defaults to `restricted`. -If you want your scoped package to be publicly viewable (and installable) -set `--access=public`. The only valid values for `access` are `public` and -`restricted`. Unscoped packages _always_ have an access level of `public`. +If do not want your scoped package to be publicly viewable (and installable) +set `--access=restricted`. -Note: Using the `--access` flag on the `npm publish` command will only set -the package access level on the initial publish of the package. Any -subsequent `npm publish` commands using the `--access` flag will not have an -effect to the access level. To make changes to the access level after the -initial publish use `npm access`. +Unscoped packages can not be set to `restricted`. + +Note: This defaults to not changing the current access level for existing +packages. Specifying a value of `restricted` or `public` during publish will +change the access for an existing package the same way that `npm access set +status` would. #### `dry-run` diff --git a/deps/npm/docs/content/commands/npm-rebuild.md b/deps/npm/docs/content/commands/npm-rebuild.md index 75f1efe1b69641..a6955ec80c7e7c 100644 --- a/deps/npm/docs/content/commands/npm-rebuild.md +++ b/deps/npm/docs/content/commands/npm-rebuild.md @@ -130,12 +130,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### See Also diff --git a/deps/npm/docs/content/commands/npm-repo.md b/deps/npm/docs/content/commands/npm-repo.md index eb55780de907aa..10ddc139f8535a 100644 --- a/deps/npm/docs/content/commands/npm-repo.md +++ b/deps/npm/docs/content/commands/npm-repo.md @@ -13,9 +13,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/deps/npm/docs/content/commands/npm-run-script.md b/deps/npm/docs/content/commands/npm-run-script.md index 16a5c693f9ba25..26011e4f7959a6 100644 --- a/deps/npm/docs/content/commands/npm-run-script.md +++ b/deps/npm/docs/content/commands/npm-run-script.md @@ -59,7 +59,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 @@ -76,7 +77,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. @@ -105,7 +107,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/deps/npm/docs/content/commands/npm-set-script.md b/deps/npm/docs/content/commands/npm-set-script.md deleted file mode 100644 index 9bbf09ea9076ad..00000000000000 --- a/deps/npm/docs/content/commands/npm-set-script.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: npm-set-script -section: 1 -description: Set tasks in the scripts section of package.json ---- - -### Synopsis -An npm command that lets you create a task in the `scripts` section of the `package.json`. - -Deprecated. - -```bash -npm set-script [