diff --git a/docs/content/commands/npm-bin.md b/docs/content/commands/npm-bin.md index 94b72cfd5c81c..befdf74900124 100644 --- a/docs/content/commands/npm-bin.md +++ b/docs/content/commands/npm-bin.md @@ -34,6 +34,8 @@ Print the folder where npm will install executables. * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local` + are all deprecated Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/docs/content/commands/npm-config.md b/docs/content/commands/npm-config.md index a66a198ce42d1..b41c67ac5f0d2 100644 --- a/docs/content/commands/npm-config.md +++ b/docs/content/commands/npm-config.md @@ -124,6 +124,8 @@ Not supported by all npm commands. * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local` + are all deprecated Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See @@ -153,6 +155,8 @@ The command to run for `npm edit` and `npm config edit`. * Default: "user" unless `--global` is passed, which will also set this value to "global" * Type: "global", "user", or "project" +* DEPRECATED: `--location=global` is deprecated, but the values "user" and + "project" are not. When passed to `npm config` this refers to which config file to use. diff --git a/docs/content/commands/npm-diff.md b/docs/content/commands/npm-diff.md index 7dcc8af7c3b4c..351d8246d09c1 100644 --- a/docs/content/commands/npm-diff.md +++ b/docs/content/commands/npm-diff.md @@ -248,6 +248,8 @@ Treat all files as text in `npm diff`. * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local` + are all deprecated Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/docs/content/commands/npm-install-test.md b/docs/content/commands/npm-install-test.md index 3dd860ea5c6f6..3f338e7f4552c 100644 --- a/docs/content/commands/npm-install-test.md +++ b/docs/content/commands/npm-install-test.md @@ -70,6 +70,8 @@ rather than using npm's default semver range operator. * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local` + are all deprecated Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/docs/content/commands/npm-install.md b/docs/content/commands/npm-install.md index 445772f0353a1..69f487bb6ac7d 100644 --- a/docs/content/commands/npm-install.md +++ b/docs/content/commands/npm-install.md @@ -460,6 +460,8 @@ rather than using npm's default semver range operator. * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local` + are all deprecated Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/docs/content/commands/npm-link.md b/docs/content/commands/npm-link.md index 975c807c38b34..1bece903abd7a 100644 --- a/docs/content/commands/npm-link.md +++ b/docs/content/commands/npm-link.md @@ -153,6 +153,8 @@ rather than using npm's default semver range operator. * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local` + are all deprecated Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/docs/content/commands/npm-ls.md b/docs/content/commands/npm-ls.md index ded8c0c0d26ef..d665d67cc39d7 100644 --- a/docs/content/commands/npm-ls.md +++ b/docs/content/commands/npm-ls.md @@ -137,6 +137,8 @@ Output parseable results from commands that write to standard output. For * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local` + are all deprecated Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/docs/content/commands/npm-outdated.md b/docs/content/commands/npm-outdated.md index 6fa026550e747..4bbb65a178fc9 100644 --- a/docs/content/commands/npm-outdated.md +++ b/docs/content/commands/npm-outdated.md @@ -150,6 +150,8 @@ Output parseable results from commands that write to standard output. For * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local` + are all deprecated Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/docs/content/commands/npm-prefix.md b/docs/content/commands/npm-prefix.md index 39328bcc88a14..66bf82ffc4c05 100644 --- a/docs/content/commands/npm-prefix.md +++ b/docs/content/commands/npm-prefix.md @@ -51,6 +51,8 @@ npm prefix -g * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local` + are all deprecated Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/docs/content/commands/npm-rebuild.md b/docs/content/commands/npm-rebuild.md index 52c368c8c513b..890636b183cce 100644 --- a/docs/content/commands/npm-rebuild.md +++ b/docs/content/commands/npm-rebuild.md @@ -42,6 +42,8 @@ will be rebuilt. * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local` + are all deprecated Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/docs/content/commands/npm-root.md b/docs/content/commands/npm-root.md index 40b58e4b33d0b..1ec7cedee7a91 100644 --- a/docs/content/commands/npm-root.md +++ b/docs/content/commands/npm-root.md @@ -41,6 +41,8 @@ echo "Global packages installed in: ${global_node_modules}" * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local` + are all deprecated Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/docs/content/commands/npm-update.md b/docs/content/commands/npm-update.md index 421d04ca3dc58..7ddd8c0e621d8 100644 --- a/docs/content/commands/npm-update.md +++ b/docs/content/commands/npm-update.md @@ -188,6 +188,8 @@ Will also prevent writing to `package-lock.json` if set to `false`. * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local` + are all deprecated Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/docs/content/using-npm/config.md b/docs/content/using-npm/config.md index df1d996110b31..f76015ac0156c 100644 --- a/docs/content/using-npm/config.md +++ b/docs/content/using-npm/config.md @@ -687,23 +687,6 @@ results in no commit being made at all. -#### `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` - - - - #### `global-style` * Default: false @@ -993,17 +976,6 @@ 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 - to "global" -* Type: "global", "user", or "project" - -When passed to `npm config` this refers to which config file to use. - - - - #### `lockfile-version` * Default: Version 2 if no lockfile or current lockfile version less than or @@ -1928,6 +1900,25 @@ Alias for `--include=dev`. +#### `global` + +* Default: false +* Type: Boolean +* DEPRECATED: `--global`, `--location=global`, `--no-global`, and `--local` + are all deprecated + +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` + + + + #### `init.author.email` * Default: "" @@ -1994,6 +1985,19 @@ Alias for `--init-version` +#### `location` + +* Default: "user" unless `--global` is passed, which will also set this value + to "global" +* Type: "global", "user", or "project" +* DEPRECATED: `--location=global` is deprecated, but the values "user" and + "project" are not. + +When passed to `npm config` this refers to which config file to use. + + + + #### `only` * Default: null diff --git a/lib/utils/config/definitions.js b/lib/utils/config/definitions.js index a5eac8c826c84..e9e69f6fd89b3 100644 --- a/lib/utils/config/definitions.js +++ b/lib/utils/config/definitions.js @@ -811,6 +811,9 @@ define('global', { default: false, type: Boolean, short: 'g', + deprecated: ` + \`--global\`, \`--location=global\`, \`--no-global\`, and \`--local\` are all deprecated + `, description: ` Operates in "global" mode, so that packages are installed into the \`prefix\` folder instead of the current working directory. See @@ -1177,6 +1180,9 @@ define('location', { defaultDescription: ` "user" unless \`--global\` is passed, which will also set this value to "global" `, + deprecated: ` + \`--location=global\` is deprecated, but the values "user" and "project" are not. + `, description: ` When passed to \`npm config\` this refers to which config file to use. `, diff --git a/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs b/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs index 42db6ce030b53..9107b8b5bb2cc 100644 --- a/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs +++ b/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs @@ -730,6 +730,8 @@ exports[`test/lib/utils/config/definitions.js TAP > config description for globa * Default: false * Type: Boolean +* DEPRECATED: \`--global\`, \`--location=global\`, \`--no-global\`, and \`--local\` + are all deprecated Operates in "global" mode, so that packages are installed into the \`prefix\` folder instead of the current working directory. See @@ -1074,6 +1076,8 @@ exports[`test/lib/utils/config/definitions.js TAP > config description for locat * Default: "user" unless \`--global\` is passed, which will also set this value to "global" * Type: "global", "user", or "project" +* DEPRECATED: \`--location=global\` is deprecated, but the values "user" and + "project" are not. When passed to \`npm config\` this refers to which config file to use. ` diff --git a/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs b/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs index d0ce3a26f764f..8d3e10fde6086 100644 --- a/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs +++ b/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs @@ -560,23 +560,6 @@ results in no commit being made at all. -#### \`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\` - - - - #### \`global-style\` * Default: false @@ -866,17 +849,6 @@ 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 - to "global" -* Type: "global", "user", or "project" - -When passed to \`npm config\` this refers to which config file to use. - - - - #### \`lockfile-version\` * Default: Version 2 if no lockfile or current lockfile version less than or @@ -1801,6 +1773,25 @@ Alias for \`--include=dev\`. +#### \`global\` + +* Default: false +* Type: Boolean +* DEPRECATED: \`--global\`, \`--location=global\`, \`--no-global\`, and \`--local\` + are all deprecated + +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\` + + + + #### \`init.author.email\` * Default: "" @@ -1867,6 +1858,19 @@ Alias for \`--init-version\` +#### \`location\` + +* Default: "user" unless \`--global\` is passed, which will also set this value + to "global" +* Type: "global", "user", or "project" +* DEPRECATED: \`--location=global\` is deprecated, but the values "user" and + "project" are not. + +When passed to \`npm config\` this refers to which config file to use. + + + + #### \`only\` * Default: null