diff --git a/docs/lib/content/commands/npm-access.md b/docs/lib/content/commands/npm-access.md index bc481eac16336..819fe9ad323bb 100644 --- a/docs/lib/content/commands/npm-access.md +++ b/docs/lib/content/commands/npm-access.md @@ -6,24 +6,7 @@ description: Set access level on published packages ### Synopsis - - - - -```bash -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 [] -``` - - - - - + ### Description @@ -86,49 +69,7 @@ Management of teams and team memberships is done with the `npm team` command. ### Configuration - - - -#### `json` - -* Default: false -* Type: Boolean - -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` - -* Default: null -* Type: null or String - -This is a one-time password from a two-factor authenticator. It's needed -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 diff --git a/docs/lib/content/commands/npm-adduser.md b/docs/lib/content/commands/npm-adduser.md index 710060f838ff7..fa957cba47d02 100644 --- a/docs/lib/content/commands/npm-adduser.md +++ b/docs/lib/content/commands/npm-adduser.md @@ -6,20 +6,7 @@ description: Add a registry user account ### Synopsis - - - - -```bash -npm adduser - -alias: add-user -``` - - - - - + Note: This command is unaware of workspaces. @@ -34,63 +21,7 @@ email are read in from prompts. ### 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 diff --git a/docs/lib/content/commands/npm-audit.md b/docs/lib/content/commands/npm-audit.md index e08aace0163c1..7a39b34d875be 100644 --- a/docs/lib/content/commands/npm-audit.md +++ b/docs/lib/content/commands/npm-audit.md @@ -6,18 +6,7 @@ description: Run a security audit ### Synopsis - - - - -```bash -npm audit [fix|signatures] -``` - - - - - + ### Description @@ -247,223 +236,7 @@ $ npm audit --audit-level=moderate ### Configuration - - - -#### `audit-level` - -* Default: null -* Type: null, "info", "low", "moderate", "high", "critical", or "none" - -The minimum level of vulnerability for `npm audit` to exit with a non-zero -exit code. - - - - -#### `dry-run` - -* Default: false -* Type: Boolean - -Indicates that you don't want npm to make any changes and that it should -only report what it would have done. This can be passed into any of the -commands that modify your local installation, eg, `install`, `update`, -`dedupe`, `uninstall`, as well as `pack` and `publish`. - -Note: This is NOT honored by other network related commands, eg `dist-tags`, -`owner`, etc. - - - - -#### `force` - -* Default: false -* Type: Boolean - -Removes various protections against unfortunate side effects, common -mistakes, unnecessary performance degradation, and malicious input. - -* Allow clobbering non-npm files in global installs. -* Allow the `npm version` command to work on an unclean git repository. -* Allow deleting the cache folder with `npm cache clean`. -* Allow installing packages that have an `engines` declaration requiring a - different version of npm. -* Allow installing packages that have an `engines` declaration requiring a - different version of `node`, even if `--engine-strict` is enabled. -* Allow `npm audit fix` to install modules outside your stated dependency - range (including SemVer-major changes). -* Allow unpublishing all versions of a published package. -* Allow conflicting peerDependencies to be installed in the root project. -* Implicitly set `--yes` during `npm init`. -* Allow clobbering existing values in `npm pkg` -* Allow unpublishing of entire packages (not just a single version). - -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 -* Type: Boolean - -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. - - - - -#### `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`. - - - - -#### `omit` - -* Default: 'dev' if the `NODE_ENV` environment variable is set to - 'production', otherwise empty. -* Type: "dev", "optional", or "peer" (can be set multiple times) - -Dependency types to omit from the installation tree on disk. - -Note that these dependencies _are_ still resolved and added to the -`package-lock.json` or `npm-shrinkwrap.json` file. They are just not -physically installed on disk. - -If a package type appears in both the `--include` and `--omit` lists, then -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 -* Type: Boolean - -Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) -scripts for installed packages in the foreground process, sharing standard -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 -* Type: Boolean - -If true, npm does not run scripts specified in package.json files. - -Note that commands explicitly intended to run a particular script, such as -`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script` -will still run their intended script if `ignore-scripts` is set, but they -will *not* run any pre- or post-scripts. - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - -#### `install-links` - -* Default: true -* Type: Boolean - -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/docs/lib/content/commands/npm-bin.md b/docs/lib/content/commands/npm-bin.md deleted file mode 100644 index 94b72cfd5c81c..0000000000000 --- a/docs/lib/content/commands/npm-bin.md +++ /dev/null @@ -1,58 +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/docs/lib/content/commands/npm-bugs.md b/docs/lib/content/commands/npm-bugs.md index af52548389c92..4cf90510d7124 100644 --- a/docs/lib/content/commands/npm-bugs.md +++ b/docs/lib/content/commands/npm-bugs.md @@ -6,20 +6,7 @@ description: Report bugs for a package in a web browser ### Synopsis - - - - -```bash -npm bugs [ [ ...]] - -alias: issues -``` - - - - - + ### Description @@ -31,97 +18,7 @@ folder and use the `name` property. ### Configuration - - - -#### `browser` - -* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"` -* Type: null, Boolean, or String - -The browser that is called by npm commands to open websites. - -Set to `false` to suppress browser behavior and instead print urls to -terminal. - -Set to `true` to use default system URL opener. - - - - -#### `registry` - -* Default: "https://registry.npmjs.org/" -* Type: URL - -The base URL of the npm registry. - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-cache.md b/docs/lib/content/commands/npm-cache.md index 68c4faff57582..2aedc546b64a7 100644 --- a/docs/lib/content/commands/npm-cache.md +++ b/docs/lib/content/commands/npm-cache.md @@ -6,21 +6,7 @@ description: Manipulates packages cache ### Synopsis - - - - -```bash -npm cache add -npm cache clean [] -npm cache ls [@] -npm cache verify -``` - - - - - + Note: This command is unaware of workspaces. @@ -79,20 +65,7 @@ verify`. ### Configuration - - - -#### `cache` - -* Default: Windows: `%LocalAppData%\npm-cache`, Posix: `~/.npm` -* Type: Path - -The location of npm's cache directory. - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-ci.md b/docs/lib/content/commands/npm-ci.md index fee305618cca3..d26691c3c29c6 100644 --- a/docs/lib/content/commands/npm-ci.md +++ b/docs/lib/content/commands/npm-ci.md @@ -6,20 +6,7 @@ description: Clean install a project ### Synopsis - - - - -```bash -npm ci - -aliases: clean-install, ic, install-clean, isntall-clean -``` - - - - - + ### Description @@ -81,297 +68,7 @@ cache: ### Configuration - - - -#### `save` - -* Default: `true` unless when using `npm update` where it defaults to `false` -* Type: Boolean - -Save installed packages to a `package.json` file as dependencies. - -When used with the `npm rm` command, removes the dependency from -`package.json`. - -Will also prevent writing to `package-lock.json` if set to `false`. - - - - -#### `save-exact` - -* Default: false -* Type: Boolean - -Dependencies saved to package.json will be configured with an exact version -rather than using npm's default semver range operator. - - - - -#### `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 -* Type: Boolean - -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. - - - - -#### `legacy-bundling` - -* Default: false -* Type: Boolean - -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. - - - - -#### `omit` - -* Default: 'dev' if the `NODE_ENV` environment variable is set to - 'production', otherwise empty. -* Type: "dev", "optional", or "peer" (can be set multiple times) - -Dependency types to omit from the installation tree on disk. - -Note that these dependencies _are_ still resolved and added to the -`package-lock.json` or `npm-shrinkwrap.json` file. They are just not -physically installed on disk. - -If a package type appears in both the `--include` and `--omit` lists, then -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 -* Type: Boolean - -If set to `true`, and `--legacy-peer-deps` is not set, then _any_ -conflicting `peerDependencies` will be treated as an install failure, even -if npm could reasonably guess the appropriate resolution based on non-peer -dependency relationships. - -By default, conflicting `peerDependencies` deep in the dependency graph will -be resolved using the nearest non-peer dependency specification, even if -doing so will result in some packages receiving a peer dependency outside -the range set in their package's `peerDependencies` object. - -When such and 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` - -* Default: false -* Type: Boolean - -Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) -scripts for installed packages in the foreground process, sharing standard -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 -* Type: Boolean - -If true, npm does not run scripts specified in package.json files. - -Note that commands explicitly intended to run a particular script, such as -`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script` -will still run their intended script if `ignore-scripts` is set, but they -will *not* run any pre- or post-scripts. - - - - -#### `audit` - -* Default: true -* Type: Boolean - -When "true" submit audit reports alongside the current npm command to the -default registry and all registries configured for scopes. See the -documentation for [`npm audit`](/commands/npm-audit) for details on what is -submitted. - - - - -#### `bin-links` - -* Default: true -* Type: Boolean - -Tells npm to create symlinks (or `.cmd` shims on Windows) for package -executables. - -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 -* Type: Boolean - -When "true" displays the message at the end of each `npm install` -acknowledging the number of dependencies looking for funding. See [`npm -fund`](/commands/npm-fund) for details. - - - - -#### `dry-run` - -* Default: false -* Type: Boolean - -Indicates that you don't want npm to make any changes and that it should -only report what it would have done. This can be passed into any of the -commands that modify your local installation, eg, `install`, `update`, -`dedupe`, `uninstall`, as well as `pack` and `publish`. - -Note: This is NOT honored by other network related commands, eg `dist-tags`, -`owner`, etc. - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - -#### `install-links` - -* Default: true -* Type: Boolean - -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/docs/lib/content/commands/npm-completion.md b/docs/lib/content/commands/npm-completion.md index d73a98f2e50f7..3a5bae3bc9a3a 100644 --- a/docs/lib/content/commands/npm-completion.md +++ b/docs/lib/content/commands/npm-completion.md @@ -6,18 +6,7 @@ description: Tab Completion for npm ### Synopsis - - - - -```bash -npm completion -``` - - - - - + Note: This command is unaware of workspaces. diff --git a/docs/lib/content/commands/npm-config.md b/docs/lib/content/commands/npm-config.md index 6e0c0b682d724..270858f8bff8f 100644 --- a/docs/lib/content/commands/npm-config.md +++ b/docs/lib/content/commands/npm-config.md @@ -6,24 +6,7 @@ description: Manage the npm configuration files ### Synopsis - - - - -```bash -npm config set = [= ...] -npm config get [ [ ...]] -npm config delete [ ...] -npm config list [--json] -npm config edit - -alias: c -``` - - - - - + Note: This command is unaware of workspaces. @@ -102,83 +85,7 @@ global config. ### Configuration - - - -#### `json` - -* Default: false -* Type: Boolean - -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. - - - - -#### `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` - - - - -#### `editor` - -* Default: The EDITOR or VISUAL environment variables, or 'notepad.exe' on - Windows, or 'vim' on Unix systems -* Type: String - -The command to run for `npm edit` and `npm config edit`. - - - - -#### `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. - -When set to "global" mode, 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` - - - - -#### `long` - -* Default: false -* Type: Boolean - -Show extended information in `ls`, `search`, and `help-search`. - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-dedupe.md b/docs/lib/content/commands/npm-dedupe.md index 4a7e0ab6b9851..877a130c1431c 100644 --- a/docs/lib/content/commands/npm-dedupe.md +++ b/docs/lib/content/commands/npm-dedupe.md @@ -6,20 +6,7 @@ description: Reduce duplication in the package tree ### Synopsis - - - - -```bash -npm dedupe - -alias: ddp -``` - - - - - + ### Description @@ -86,239 +73,7 @@ values in `package.json` you can run: `npm update --save` instead. ### Configuration - - - -#### `global-style` - -* Default: false -* Type: Boolean - -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. - - - - -#### `legacy-bundling` - -* Default: false -* Type: Boolean - -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. - - - - -#### `strict-peer-deps` - -* Default: false -* Type: Boolean - -If set to `true`, and `--legacy-peer-deps` is not set, then _any_ -conflicting `peerDependencies` will be treated as an install failure, even -if npm could reasonably guess the appropriate resolution based on non-peer -dependency relationships. - -By default, conflicting `peerDependencies` deep in the dependency graph will -be resolved using the nearest non-peer dependency specification, even if -doing so will result in some packages receiving a peer dependency outside -the range set in their package's `peerDependencies` object. - -When such and 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`. - - - - -#### `omit` - -* Default: 'dev' if the `NODE_ENV` environment variable is set to - 'production', otherwise empty. -* Type: "dev", "optional", or "peer" (can be set multiple times) - -Dependency types to omit from the installation tree on disk. - -Note that these dependencies _are_ still resolved and added to the -`package-lock.json` or `npm-shrinkwrap.json` file. They are just not -physically installed on disk. - -If a package type appears in both the `--include` and `--omit` lists, then -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 -* Type: Boolean - -If true, npm does not run scripts specified in package.json files. - -Note that commands explicitly intended to run a particular script, such as -`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script` -will still run their intended script if `ignore-scripts` is set, but they -will *not* run any pre- or post-scripts. - - - - -#### `audit` - -* Default: true -* Type: Boolean - -When "true" submit audit reports alongside the current npm command to the -default registry and all registries configured for scopes. See the -documentation for [`npm audit`](/commands/npm-audit) for details on what is -submitted. - - - - -#### `bin-links` - -* Default: true -* Type: Boolean - -Tells npm to create symlinks (or `.cmd` shims on Windows) for package -executables. - -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 -* Type: Boolean - -When "true" displays the message at the end of each `npm install` -acknowledging the number of dependencies looking for funding. See [`npm -fund`](/commands/npm-fund) for details. - - - - -#### `dry-run` - -* Default: false -* Type: Boolean - -Indicates that you don't want npm to make any changes and that it should -only report what it would have done. This can be passed into any of the -commands that modify your local installation, eg, `install`, `update`, -`dedupe`, `uninstall`, as well as `pack` and `publish`. - -Note: This is NOT honored by other network related commands, eg `dist-tags`, -`owner`, etc. - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - -#### `install-links` - -* Default: true -* Type: Boolean - -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/docs/lib/content/commands/npm-deprecate.md b/docs/lib/content/commands/npm-deprecate.md index 20f65140fc735..3cf02acb7f05a 100644 --- a/docs/lib/content/commands/npm-deprecate.md +++ b/docs/lib/content/commands/npm-deprecate.md @@ -6,18 +6,7 @@ description: Deprecate a version of a package ### Synopsis - - - - -```bash -npm deprecate -``` - - - - - + Note: This command is unaware of workspaces. @@ -51,34 +40,7 @@ format an empty string. ### Configuration - - - -#### `registry` - -* Default: "https://registry.npmjs.org/" -* Type: URL - -The base URL of the npm registry. - - - - -#### `otp` - -* Default: null -* Type: null or String - -This is a one-time password from a two-factor authenticator. It's needed -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 diff --git a/docs/lib/content/commands/npm-diff.md b/docs/lib/content/commands/npm-diff.md index 7dcc8af7c3b4c..5a10841a9c2d8 100644 --- a/docs/lib/content/commands/npm-diff.md +++ b/docs/lib/content/commands/npm-diff.md @@ -6,18 +6,7 @@ description: The registry diff command ### Synopsis - - - - -```bash -npm diff [...] -``` - - - - - + ### Description @@ -158,189 +147,7 @@ located within the folder `./lib/` and changed lines of code within the ### Configuration - - - -#### `diff` - -* Default: -* Type: String (can be set multiple times) - -Define arguments to compare in `npm diff`. - - - - -#### `diff-name-only` - -* Default: false -* Type: Boolean - -Prints only filenames when using `npm diff`. - - - - -#### `diff-unified` - -* Default: 3 -* Type: Number - -The number of lines of context to print in `npm diff`. - - - - -#### `diff-ignore-all-space` - -* Default: false -* Type: Boolean - -Ignore whitespace when comparing lines in `npm diff`. - - - - -#### `diff-no-prefix` - -* Default: false -* Type: Boolean - -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/" -* Type: String - -Source prefix to be used in `npm diff` output. - - - - -#### `diff-dst-prefix` - -* Default: "b/" -* Type: String - -Destination prefix to be used in `npm diff` output. - - - - -#### `diff-text` - -* Default: false -* Type: Boolean - -Treat all files as text in `npm diff`. - - - - -#### `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` - - - - -#### `tag` - -* Default: "latest" -* Type: String - -If you ask npm to install a package and don't tell it a specific version, -then it will install the specified tag. - -Also the tag that is added to the package@version specified by the `npm tag` -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: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - - + ## See Also * [npm outdated](/commands/npm-outdated) diff --git a/docs/lib/content/commands/npm-dist-tag.md b/docs/lib/content/commands/npm-dist-tag.md index e505fba36414b..34781ebe6777d 100644 --- a/docs/lib/content/commands/npm-dist-tag.md +++ b/docs/lib/content/commands/npm-dist-tag.md @@ -6,22 +6,7 @@ description: Modify package distribution tags ### Synopsis - - - - -```bash -npm dist-tag add [] -npm dist-tag rm -npm dist-tag ls [] - -alias: dist-tags -``` - - - - - + ### Description @@ -99,72 +84,7 @@ not begin with a number or the letter `v`. ### Configuration - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-docs.md b/docs/lib/content/commands/npm-docs.md index e48695ced005a..140d23dfa7e86 100644 --- a/docs/lib/content/commands/npm-docs.md +++ b/docs/lib/content/commands/npm-docs.md @@ -6,20 +6,7 @@ description: Open documentation for a package in a web browser ### Synopsis - - - - -```bash -npm docs [ [ ...]] - -alias: home -``` - - - - - + ### Description @@ -31,97 +18,7 @@ package names at once. If no package name is provided, it will search for a ### Configuration - - - -#### `browser` - -* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"` -* Type: null, Boolean, or String - -The browser that is called by npm commands to open websites. - -Set to `false` to suppress browser behavior and instead print urls to -terminal. - -Set to `true` to use default system URL opener. - - - - -#### `registry` - -* Default: "https://registry.npmjs.org/" -* Type: URL - -The base URL of the npm registry. - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-doctor.md b/docs/lib/content/commands/npm-doctor.md index 7fb63bab16e83..3abb1e29a24e2 100644 --- a/docs/lib/content/commands/npm-doctor.md +++ b/docs/lib/content/commands/npm-doctor.md @@ -6,18 +6,7 @@ description: Check your npm environment ### Synopsis - - - - -```bash -npm doctor -``` - - - - - + Note: This command is unaware of workspaces. @@ -113,20 +102,7 @@ reset the cache. ### Configuration - - - -#### `registry` - -* Default: "https://registry.npmjs.org/" -* Type: URL - -The base URL of the npm registry. - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-edit.md b/docs/lib/content/commands/npm-edit.md index 39fc49592c571..6de2b6e8542e1 100644 --- a/docs/lib/content/commands/npm-edit.md +++ b/docs/lib/content/commands/npm-edit.md @@ -6,18 +6,7 @@ description: Edit an installed package ### Synopsis - - - - -```bash -npm edit [/...] -``` - - - - - + Note: This command is unaware of workspaces. @@ -36,21 +25,7 @@ changes to your locally installed copy. ### Configuration - - - -#### `editor` - -* Default: The EDITOR or VISUAL environment variables, or 'notepad.exe' on - Windows, or 'vim' on Unix systems -* Type: String - -The command to run for `npm edit` and `npm config edit`. - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-exec.md b/docs/lib/content/commands/npm-exec.md index 7a66fbc27eb08..f156a9c8382ee 100644 --- a/docs/lib/content/commands/npm-exec.md +++ b/docs/lib/content/commands/npm-exec.md @@ -6,23 +6,7 @@ description: Run a command from a local or remote npm package ### Synopsis - - - - -```bash -npm exec -- [@] [args...] -npm exec --package=[@] -- [args...] -npm exec -c ' [args...]' -npm exec --package=foo -c ' [args...]' - -alias: x -``` - - - - - + ### Description @@ -119,98 +103,7 @@ $ npm exec -- foo@latest bar --package=@npmcli/foo ### Configuration - - - -#### `package` - -* Default: -* Type: String (can be set multiple times) - -The package or packages to install for [`npm exec`](/commands/npm-exec) - - - - -#### `call` - -* Default: "" -* Type: String - -Optional companion option for `npm exec`, `npx` that allows for specifying a -custom command to be run along with the installed packages. - -```bash -npm exec --package yo --package generator-node --call "yo node" -``` - - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - - + ### Examples diff --git a/docs/lib/content/commands/npm-explain.md b/docs/lib/content/commands/npm-explain.md index 5ba2fe8206ba1..8de05c92f8b2c 100644 --- a/docs/lib/content/commands/npm-explain.md +++ b/docs/lib/content/commands/npm-explain.md @@ -6,20 +6,7 @@ description: Explain installed packages ### Synopsis - - - - -```bash -npm explain - -alias: why -``` - - - - - + ### Description @@ -64,50 +51,7 @@ node_modules/nyc/node_modules/find-up ``` ### Configuration - - - -#### `json` - -* Default: false -* Type: Boolean - -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. - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-explore.md b/docs/lib/content/commands/npm-explore.md index 90753c7e09199..7557d9ae74adb 100644 --- a/docs/lib/content/commands/npm-explore.md +++ b/docs/lib/content/commands/npm-explore.md @@ -6,18 +6,7 @@ description: Browse an installed package ### Synopsis - - - - -```bash -npm explore [ -- ] -``` - - - - - + Note: This command is unaware of workspaces. @@ -40,21 +29,7 @@ sure to use `npm rebuild ` if you make any changes. ### Configuration - - - -#### `shell` - -* Default: SHELL environment variable, or "bash" on Posix, or "cmd.exe" on - Windows -* Type: String - -The shell to run for the `npm explore` command. - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-find-dupes.md b/docs/lib/content/commands/npm-find-dupes.md index af41f5ccb14f2..1e0e8df3d21d0 100644 --- a/docs/lib/content/commands/npm-find-dupes.md +++ b/docs/lib/content/commands/npm-find-dupes.md @@ -6,18 +6,7 @@ description: Find duplication in the package tree ### Synopsis - - - - -```bash -npm find-dupes -``` - - - - - + ### Description @@ -26,223 +15,7 @@ duplications, without actually changing the package tree. ### Configuration - - - -#### `global-style` - -* Default: false -* Type: Boolean - -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. - - - - -#### `legacy-bundling` - -* Default: false -* Type: Boolean - -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. - - - - -#### `strict-peer-deps` - -* Default: false -* Type: Boolean - -If set to `true`, and `--legacy-peer-deps` is not set, then _any_ -conflicting `peerDependencies` will be treated as an install failure, even -if npm could reasonably guess the appropriate resolution based on non-peer -dependency relationships. - -By default, conflicting `peerDependencies` deep in the dependency graph will -be resolved using the nearest non-peer dependency specification, even if -doing so will result in some packages receiving a peer dependency outside -the range set in their package's `peerDependencies` object. - -When such and 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`. - - - - -#### `omit` - -* Default: 'dev' if the `NODE_ENV` environment variable is set to - 'production', otherwise empty. -* Type: "dev", "optional", or "peer" (can be set multiple times) - -Dependency types to omit from the installation tree on disk. - -Note that these dependencies _are_ still resolved and added to the -`package-lock.json` or `npm-shrinkwrap.json` file. They are just not -physically installed on disk. - -If a package type appears in both the `--include` and `--omit` lists, then -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 -* Type: Boolean - -If true, npm does not run scripts specified in package.json files. - -Note that commands explicitly intended to run a particular script, such as -`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script` -will still run their intended script if `ignore-scripts` is set, but they -will *not* run any pre- or post-scripts. - - - - -#### `audit` - -* Default: true -* Type: Boolean - -When "true" submit audit reports alongside the current npm command to the -default registry and all registries configured for scopes. See the -documentation for [`npm audit`](/commands/npm-audit) for details on what is -submitted. - - - - -#### `bin-links` - -* Default: true -* Type: Boolean - -Tells npm to create symlinks (or `.cmd` shims on Windows) for package -executables. - -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 -* Type: Boolean - -When "true" displays the message at the end of each `npm install` -acknowledging the number of dependencies looking for funding. See [`npm -fund`](/commands/npm-fund) for details. - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - -#### `install-links` - -* Default: true -* Type: Boolean - -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/docs/lib/content/commands/npm-fund.md b/docs/lib/content/commands/npm-fund.md index 53100f6716537..f200aafc3e828 100644 --- a/docs/lib/content/commands/npm-fund.md +++ b/docs/lib/content/commands/npm-fund.md @@ -6,18 +6,7 @@ description: Retrieve funding information ### Synopsis - - - - -```bash -npm fund [] -``` - - - - - + ### Description @@ -74,87 +63,7 @@ test-workspaces-fund@1.0.0 ### Configuration - - - -#### `json` - -* Default: false -* Type: Boolean - -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. - - - - -#### `browser` - -* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"` -* Type: null, Boolean, or String - -The browser that is called by npm commands to open websites. - -Set to `false` to suppress browser behavior and instead print urls to -terminal. - -Set to `true` to use default system URL opener. - - - - -#### `unicode` - -* Default: false on windows, true on mac/unix systems with a unicode locale, - as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables. -* Type: Boolean - -When set to true, npm uses unicode characters in the tree output. When -false, it uses ascii characters instead of unicode glyphs. - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `which` - -* Default: null -* Type: null or Number - -If there are multiple funding sources, which 1-indexed source URL to open. - - - - - + ## See Also diff --git a/docs/lib/content/commands/npm-help-search.md b/docs/lib/content/commands/npm-help-search.md index 152f9f6bec16f..fb37036364f49 100644 --- a/docs/lib/content/commands/npm-help-search.md +++ b/docs/lib/content/commands/npm-help-search.md @@ -6,18 +6,7 @@ description: Search npm help documentation ### Synopsis - - - - -```bash -npm help-search -``` - - - - - + Note: This command is unaware of workspaces. @@ -34,20 +23,7 @@ directly. ### Configuration - - - -#### `long` - -* Default: false -* Type: Boolean - -Show extended information in `ls`, `search`, and `help-search`. - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-help.md b/docs/lib/content/commands/npm-help.md index 83c595db696b9..717092cb92788 100644 --- a/docs/lib/content/commands/npm-help.md +++ b/docs/lib/content/commands/npm-help.md @@ -6,20 +6,7 @@ description: Get help on npm ### Synopsis - - - - -```bash -npm help [] - -alias: hlep -``` - - - - - + Note: This command is unaware of workspaces. @@ -34,22 +21,7 @@ topic, so unique matches are equivalent to specifying a topic name. ### Configuration - - - -#### `viewer` - -* Default: "man" on Posix, "browser" on Windows -* Type: String - -The program to use to view help content. - -Set to `"browser"` to view html help content in the default web browser. - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-hook.md b/docs/lib/content/commands/npm-hook.md index 4a9805d02f9d4..75e7fcc44dbcd 100644 --- a/docs/lib/content/commands/npm-hook.md +++ b/docs/lib/content/commands/npm-hook.md @@ -6,21 +6,7 @@ description: Manage registry hooks ### Synopsis - - - - -```bash -npm hook add [--type=] -npm hook ls [pkg] -npm hook rm -npm hook update -``` - - - - - + Note: This command is unaware of workspaces. @@ -94,34 +80,7 @@ $ npm hook rm id-deadbeef ### Configuration - - - -#### `registry` - -* Default: "https://registry.npmjs.org/" -* Type: URL - -The base URL of the npm registry. - - - - -#### `otp` - -* Default: null -* Type: null or String - -This is a one-time password from a two-factor authenticator. It's needed -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 diff --git a/docs/lib/content/commands/npm-init.md b/docs/lib/content/commands/npm-init.md index f3124a7768dfc..832d786e66853 100644 --- a/docs/lib/content/commands/npm-init.md +++ b/docs/lib/content/commands/npm-init.md @@ -6,21 +6,7 @@ description: Create a package.json file ### Synopsis - - - - -```bash -npm init (same as `npx ) -npm init <@scope> (same as `npx <@scope>/create`) - -aliases: create, innit -``` - - - - - + ### Description @@ -165,156 +151,7 @@ dot to represent the current directory in that context, e.g: `react-app .`: ### Configuration - - - -#### `yes` - -* Default: null -* Type: null or Boolean - -Automatically answer "yes" to any prompts that npm might print on the -command line. - - - - -#### `force` - -* Default: false -* Type: Boolean - -Removes various protections against unfortunate side effects, common -mistakes, unnecessary performance degradation, and malicious input. - -* Allow clobbering non-npm files in global installs. -* Allow the `npm version` command to work on an unclean git repository. -* Allow deleting the cache folder with `npm cache clean`. -* Allow installing packages that have an `engines` declaration requiring a - different version of npm. -* Allow installing packages that have an `engines` declaration requiring a - different version of `node`, even if `--engine-strict` is enabled. -* Allow `npm audit fix` to install modules outside your stated dependency - range (including SemVer-major changes). -* Allow unpublishing all versions of a published package. -* Allow conflicting peerDependencies to be installed in the root project. -* Implicitly set `--yes` during `npm init`. -* Allow clobbering existing values in `npm pkg` -* Allow unpublishing of entire packages (not just a single version). - -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 "" -* 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 -``` - - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces-update` - -* Default: true -* Type: Boolean - -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 -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-install-ci-test.md b/docs/lib/content/commands/npm-install-ci-test.md index 4de56d372fefe..9685eaaa1aa91 100644 --- a/docs/lib/content/commands/npm-install-ci-test.md +++ b/docs/lib/content/commands/npm-install-ci-test.md @@ -6,20 +6,7 @@ description: Install a project with a clean slate and run tests ### Synopsis - - - - -```bash -npm install-ci-test - -alias: cit -``` - - - - - + ### Description @@ -27,297 +14,7 @@ This command runs `npm ci` followed immediately by `npm test`. ### Configuration - - - -#### `save` - -* Default: `true` unless when using `npm update` where it defaults to `false` -* Type: Boolean - -Save installed packages to a `package.json` file as dependencies. - -When used with the `npm rm` command, removes the dependency from -`package.json`. - -Will also prevent writing to `package-lock.json` if set to `false`. - - - - -#### `save-exact` - -* Default: false -* Type: Boolean - -Dependencies saved to package.json will be configured with an exact version -rather than using npm's default semver range operator. - - - - -#### `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 -* Type: Boolean - -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. - - - - -#### `legacy-bundling` - -* Default: false -* Type: Boolean - -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. - - - - -#### `omit` - -* Default: 'dev' if the `NODE_ENV` environment variable is set to - 'production', otherwise empty. -* Type: "dev", "optional", or "peer" (can be set multiple times) - -Dependency types to omit from the installation tree on disk. - -Note that these dependencies _are_ still resolved and added to the -`package-lock.json` or `npm-shrinkwrap.json` file. They are just not -physically installed on disk. - -If a package type appears in both the `--include` and `--omit` lists, then -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 -* Type: Boolean - -If set to `true`, and `--legacy-peer-deps` is not set, then _any_ -conflicting `peerDependencies` will be treated as an install failure, even -if npm could reasonably guess the appropriate resolution based on non-peer -dependency relationships. - -By default, conflicting `peerDependencies` deep in the dependency graph will -be resolved using the nearest non-peer dependency specification, even if -doing so will result in some packages receiving a peer dependency outside -the range set in their package's `peerDependencies` object. - -When such and 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` - -* Default: false -* Type: Boolean - -Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) -scripts for installed packages in the foreground process, sharing standard -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 -* Type: Boolean - -If true, npm does not run scripts specified in package.json files. - -Note that commands explicitly intended to run a particular script, such as -`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script` -will still run their intended script if `ignore-scripts` is set, but they -will *not* run any pre- or post-scripts. - - - - -#### `audit` - -* Default: true -* Type: Boolean - -When "true" submit audit reports alongside the current npm command to the -default registry and all registries configured for scopes. See the -documentation for [`npm audit`](/commands/npm-audit) for details on what is -submitted. - - - - -#### `bin-links` - -* Default: true -* Type: Boolean - -Tells npm to create symlinks (or `.cmd` shims on Windows) for package -executables. - -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 -* Type: Boolean - -When "true" displays the message at the end of each `npm install` -acknowledging the number of dependencies looking for funding. See [`npm -fund`](/commands/npm-fund) for details. - - - - -#### `dry-run` - -* Default: false -* Type: Boolean - -Indicates that you don't want npm to make any changes and that it should -only report what it would have done. This can be passed into any of the -commands that modify your local installation, eg, `install`, `update`, -`dedupe`, `uninstall`, as well as `pack` and `publish`. - -Note: This is NOT honored by other network related commands, eg `dist-tags`, -`owner`, etc. - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - -#### `install-links` - -* Default: true -* Type: Boolean - -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/docs/lib/content/commands/npm-install-test.md b/docs/lib/content/commands/npm-install-test.md index 4dad775e927c9..4a2798b41be29 100644 --- a/docs/lib/content/commands/npm-install-test.md +++ b/docs/lib/content/commands/npm-install-test.md @@ -6,20 +6,7 @@ description: Install package(s) and run tests ### Synopsis - - - - -```bash -npm install-test [ ...] - -alias: it -``` - - - - - + ### Description @@ -28,297 +15,7 @@ takes exactly the same arguments as `npm install`. ### Configuration - - - -#### `save` - -* Default: `true` unless when using `npm update` where it defaults to `false` -* Type: Boolean - -Save installed packages to a `package.json` file as dependencies. - -When used with the `npm rm` command, removes the dependency from -`package.json`. - -Will also prevent writing to `package-lock.json` if set to `false`. - - - - -#### `save-exact` - -* Default: false -* Type: Boolean - -Dependencies saved to package.json will be configured with an exact version -rather than using npm's default semver range operator. - - - - -#### `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 -* Type: Boolean - -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. - - - - -#### `legacy-bundling` - -* Default: false -* Type: Boolean - -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. - - - - -#### `omit` - -* Default: 'dev' if the `NODE_ENV` environment variable is set to - 'production', otherwise empty. -* Type: "dev", "optional", or "peer" (can be set multiple times) - -Dependency types to omit from the installation tree on disk. - -Note that these dependencies _are_ still resolved and added to the -`package-lock.json` or `npm-shrinkwrap.json` file. They are just not -physically installed on disk. - -If a package type appears in both the `--include` and `--omit` lists, then -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 -* Type: Boolean - -If set to `true`, and `--legacy-peer-deps` is not set, then _any_ -conflicting `peerDependencies` will be treated as an install failure, even -if npm could reasonably guess the appropriate resolution based on non-peer -dependency relationships. - -By default, conflicting `peerDependencies` deep in the dependency graph will -be resolved using the nearest non-peer dependency specification, even if -doing so will result in some packages receiving a peer dependency outside -the range set in their package's `peerDependencies` object. - -When such and 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` - -* Default: false -* Type: Boolean - -Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) -scripts for installed packages in the foreground process, sharing standard -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 -* Type: Boolean - -If true, npm does not run scripts specified in package.json files. - -Note that commands explicitly intended to run a particular script, such as -`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script` -will still run their intended script if `ignore-scripts` is set, but they -will *not* run any pre- or post-scripts. - - - - -#### `audit` - -* Default: true -* Type: Boolean - -When "true" submit audit reports alongside the current npm command to the -default registry and all registries configured for scopes. See the -documentation for [`npm audit`](/commands/npm-audit) for details on what is -submitted. - - - - -#### `bin-links` - -* Default: true -* Type: Boolean - -Tells npm to create symlinks (or `.cmd` shims on Windows) for package -executables. - -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 -* Type: Boolean - -When "true" displays the message at the end of each `npm install` -acknowledging the number of dependencies looking for funding. See [`npm -fund`](/commands/npm-fund) for details. - - - - -#### `dry-run` - -* Default: false -* Type: Boolean - -Indicates that you don't want npm to make any changes and that it should -only report what it would have done. This can be passed into any of the -commands that modify your local installation, eg, `install`, `update`, -`dedupe`, `uninstall`, as well as `pack` and `publish`. - -Note: This is NOT honored by other network related commands, eg `dist-tags`, -`owner`, etc. - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - -#### `install-links` - -* Default: true -* Type: Boolean - -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/docs/lib/content/commands/npm-install.md b/docs/lib/content/commands/npm-install.md index f9d14fb338c9a..a705da2cb32d3 100644 --- a/docs/lib/content/commands/npm-install.md +++ b/docs/lib/content/commands/npm-install.md @@ -6,20 +6,7 @@ description: Install a package ### Synopsis - - - - -```bash -npm install [ ...] - -aliases: add, i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall -``` - - - - - + ### Description @@ -418,297 +405,7 @@ does. These are some of the most common options related to installation. - - - -#### `save` - -* Default: `true` unless when using `npm update` where it defaults to `false` -* Type: Boolean - -Save installed packages to a `package.json` file as dependencies. - -When used with the `npm rm` command, removes the dependency from -`package.json`. - -Will also prevent writing to `package-lock.json` if set to `false`. - - - - -#### `save-exact` - -* Default: false -* Type: Boolean - -Dependencies saved to package.json will be configured with an exact version -rather than using npm's default semver range operator. - - - - -#### `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 -* Type: Boolean - -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. - - - - -#### `legacy-bundling` - -* Default: false -* Type: Boolean - -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. - - - - -#### `omit` - -* Default: 'dev' if the `NODE_ENV` environment variable is set to - 'production', otherwise empty. -* Type: "dev", "optional", or "peer" (can be set multiple times) - -Dependency types to omit from the installation tree on disk. - -Note that these dependencies _are_ still resolved and added to the -`package-lock.json` or `npm-shrinkwrap.json` file. They are just not -physically installed on disk. - -If a package type appears in both the `--include` and `--omit` lists, then -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 -* Type: Boolean - -If set to `true`, and `--legacy-peer-deps` is not set, then _any_ -conflicting `peerDependencies` will be treated as an install failure, even -if npm could reasonably guess the appropriate resolution based on non-peer -dependency relationships. - -By default, conflicting `peerDependencies` deep in the dependency graph will -be resolved using the nearest non-peer dependency specification, even if -doing so will result in some packages receiving a peer dependency outside -the range set in their package's `peerDependencies` object. - -When such and 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` - -* Default: false -* Type: Boolean - -Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) -scripts for installed packages in the foreground process, sharing standard -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 -* Type: Boolean - -If true, npm does not run scripts specified in package.json files. - -Note that commands explicitly intended to run a particular script, such as -`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script` -will still run their intended script if `ignore-scripts` is set, but they -will *not* run any pre- or post-scripts. - - - - -#### `audit` - -* Default: true -* Type: Boolean - -When "true" submit audit reports alongside the current npm command to the -default registry and all registries configured for scopes. See the -documentation for [`npm audit`](/commands/npm-audit) for details on what is -submitted. - - - - -#### `bin-links` - -* Default: true -* Type: Boolean - -Tells npm to create symlinks (or `.cmd` shims on Windows) for package -executables. - -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 -* Type: Boolean - -When "true" displays the message at the end of each `npm install` -acknowledging the number of dependencies looking for funding. See [`npm -fund`](/commands/npm-fund) for details. - - - - -#### `dry-run` - -* Default: false -* Type: Boolean - -Indicates that you don't want npm to make any changes and that it should -only report what it would have done. This can be passed into any of the -commands that modify your local installation, eg, `install`, `update`, -`dedupe`, `uninstall`, as well as `pack` and `publish`. - -Note: This is NOT honored by other network related commands, eg `dist-tags`, -`owner`, etc. - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - -#### `install-links` - -* Default: true -* Type: Boolean - -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/docs/lib/content/commands/npm-link.md b/docs/lib/content/commands/npm-link.md index 81a31acfa0272..232e55ff9fcd9 100644 --- a/docs/lib/content/commands/npm-link.md +++ b/docs/lib/content/commands/npm-link.md @@ -6,20 +6,7 @@ description: Symlink a package folder ### Synopsis - - - - -```bash -npm link [] - -alias: ln -``` - - - - - + ### Description @@ -119,282 +106,7 @@ workspace(s). ### Configuration - - - -#### `save` - -* Default: `true` unless when using `npm update` where it defaults to `false` -* Type: Boolean - -Save installed packages to a `package.json` file as dependencies. - -When used with the `npm rm` command, removes the dependency from -`package.json`. - -Will also prevent writing to `package-lock.json` if set to `false`. - - - - -#### `save-exact` - -* Default: false -* Type: Boolean - -Dependencies saved to package.json will be configured with an exact version -rather than using npm's default semver range operator. - - - - -#### `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 -* Type: Boolean - -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. - - - - -#### `legacy-bundling` - -* Default: false -* Type: Boolean - -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. - - - - -#### `strict-peer-deps` - -* Default: false -* Type: Boolean - -If set to `true`, and `--legacy-peer-deps` is not set, then _any_ -conflicting `peerDependencies` will be treated as an install failure, even -if npm could reasonably guess the appropriate resolution based on non-peer -dependency relationships. - -By default, conflicting `peerDependencies` deep in the dependency graph will -be resolved using the nearest non-peer dependency specification, even if -doing so will result in some packages receiving a peer dependency outside -the range set in their package's `peerDependencies` object. - -When such and 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`. - - - - -#### `omit` - -* Default: 'dev' if the `NODE_ENV` environment variable is set to - 'production', otherwise empty. -* Type: "dev", "optional", or "peer" (can be set multiple times) - -Dependency types to omit from the installation tree on disk. - -Note that these dependencies _are_ still resolved and added to the -`package-lock.json` or `npm-shrinkwrap.json` file. They are just not -physically installed on disk. - -If a package type appears in both the `--include` and `--omit` lists, then -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 -* Type: Boolean - -If true, npm does not run scripts specified in package.json files. - -Note that commands explicitly intended to run a particular script, such as -`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script` -will still run their intended script if `ignore-scripts` is set, but they -will *not* run any pre- or post-scripts. - - - - -#### `audit` - -* Default: true -* Type: Boolean - -When "true" submit audit reports alongside the current npm command to the -default registry and all registries configured for scopes. See the -documentation for [`npm audit`](/commands/npm-audit) for details on what is -submitted. - - - - -#### `bin-links` - -* Default: true -* Type: Boolean - -Tells npm to create symlinks (or `.cmd` shims on Windows) for package -executables. - -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 -* Type: Boolean - -When "true" displays the message at the end of each `npm install` -acknowledging the number of dependencies looking for funding. See [`npm -fund`](/commands/npm-fund) for details. - - - - -#### `dry-run` - -* Default: false -* Type: Boolean - -Indicates that you don't want npm to make any changes and that it should -only report what it would have done. This can be passed into any of the -commands that modify your local installation, eg, `install`, `update`, -`dedupe`, `uninstall`, as well as `pack` and `publish`. - -Note: This is NOT honored by other network related commands, eg `dist-tags`, -`owner`, etc. - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - -#### `install-links` - -* Default: true -* Type: Boolean - -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/docs/lib/content/commands/npm-login.md b/docs/lib/content/commands/npm-login.md index a3772dc882a9d..f1dd29dfbe1c5 100644 --- a/docs/lib/content/commands/npm-login.md +++ b/docs/lib/content/commands/npm-login.md @@ -6,18 +6,7 @@ description: Login to a registry user account ### Synopsis - - - - -```bash -npm login -``` - - - - - + Note: This command is unaware of workspaces. @@ -41,63 +30,7 @@ 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 diff --git a/docs/lib/content/commands/npm-logout.md b/docs/lib/content/commands/npm-logout.md index f0dd5cb856eae..df58af14289af 100644 --- a/docs/lib/content/commands/npm-logout.md +++ b/docs/lib/content/commands/npm-logout.md @@ -6,18 +6,7 @@ description: Log out of the registry ### Synopsis - - - - -```bash -npm logout -``` - - - - - + Note: This command is unaware of workspaces. @@ -36,53 +25,7 @@ connected to that scope, if set. ### 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 -``` - - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-ls.md b/docs/lib/content/commands/npm-ls.md index 0e01dc3409011..04c4f2cb6f1e2 100644 --- a/docs/lib/content/commands/npm-ls.md +++ b/docs/lib/content/commands/npm-ls.md @@ -6,20 +6,7 @@ description: List installed packages ### Synopsis - - - - -```bash -npm ls - -alias: list -``` - - - - - + ### Description @@ -82,222 +69,7 @@ least the default human-readable `npm ls` output in npm v8. ### Configuration - - - -#### `all` - -* Default: false -* Type: Boolean - -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 -* Type: Boolean - -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. - - - - -#### `long` - -* Default: false -* Type: Boolean - -Show extended information in `ls`, `search`, and `help-search`. - - - - -#### `parseable` - -* Default: false -* Type: Boolean - -Output parseable results from commands that write to standard output. For -`npm search`, this will be tab-separated table format. - - - - -#### `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` - - - - -#### `depth` - -* Default: `Infinity` if `--all` is set, otherwise `1` -* Type: null or Number - -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 - 'production', otherwise empty. -* Type: "dev", "optional", or "peer" (can be set multiple times) - -Dependency types to omit from the installation tree on disk. - -Note that these dependencies _are_ still resolved and added to the -`package-lock.json` or `npm-shrinkwrap.json` file. They are just not -physically installed on disk. - -If a package type appears in both the `--include` and `--omit` lists, then -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 -* Type: Boolean - -Used with `npm ls`, limiting output to only those packages that are linked. - - - - -#### `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`. - - - - -#### `unicode` - -* Default: false on windows, true on mac/unix systems with a unicode locale, - as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables. -* Type: Boolean - -When set to true, npm uses unicode characters in the tree output. When -false, it uses ascii characters instead of unicode glyphs. - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - -#### `install-links` - -* Default: true -* Type: Boolean - -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/docs/lib/content/commands/npm-org.md b/docs/lib/content/commands/npm-org.md index 975581c860df6..ca4d887de3cbd 100644 --- a/docs/lib/content/commands/npm-org.md +++ b/docs/lib/content/commands/npm-org.md @@ -6,22 +6,7 @@ description: Manage orgs ### Synopsis - - - - -```bash -npm org set orgname username [developer | admin | owner] -npm org rm orgname username -npm org ls orgname [] - -alias: ogr -``` - - - - - + Note: This command is unaware of workspaces. @@ -71,60 +56,7 @@ listing them, and finding specific ones and their roles. ### Configuration - - - -#### `registry` - -* Default: "https://registry.npmjs.org/" -* Type: URL - -The base URL of the npm registry. - - - - -#### `otp` - -* Default: null -* Type: null or String - -This is a one-time password from a two-factor authenticator. It's needed -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 -* Type: Boolean - -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. - - - - -#### `parseable` - -* Default: false -* Type: Boolean - -Output parseable results from commands that write to standard output. For -`npm search`, this will be tab-separated table format. - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-outdated.md b/docs/lib/content/commands/npm-outdated.md index c4e07a0cd36f0..c4d39a64f38b4 100644 --- a/docs/lib/content/commands/npm-outdated.md +++ b/docs/lib/content/commands/npm-outdated.md @@ -6,18 +6,7 @@ description: Check for outdated packages ### Synopsis - - - - -```bash -npm outdated [ ...] -``` - - - - - + ### Description @@ -95,100 +84,7 @@ A few things to note: ### Configuration - - - -#### `all` - -* Default: false -* Type: Boolean - -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 -* Type: Boolean - -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. - - - - -#### `long` - -* Default: false -* Type: Boolean - -Show extended information in `ls`, `search`, and `help-search`. - - - - -#### `parseable` - -* Default: false -* Type: Boolean - -Output parseable results from commands that write to standard output. For -`npm search`, this will be tab-separated table format. - - - - -#### `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` - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-owner.md b/docs/lib/content/commands/npm-owner.md index ebc29ef693939..c35b369ab2da3 100644 --- a/docs/lib/content/commands/npm-owner.md +++ b/docs/lib/content/commands/npm-owner.md @@ -6,22 +6,7 @@ description: Manage package owners ### Synopsis - - - - -```bash -npm owner add -npm owner rm -npm owner ls - -alias: author -``` - - - - - + Note: This command is unaware of workspaces. @@ -46,80 +31,7 @@ on the command line when changing ownership with `--otp`. ### Configuration - - - -#### `registry` - -* Default: "https://registry.npmjs.org/" -* Type: URL - -The base URL of the npm registry. - - - - -#### `otp` - -* Default: null -* Type: null or String - -This is a one-time password from a two-factor authenticator. It's needed -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: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-pack.md b/docs/lib/content/commands/npm-pack.md index 7921042eae8fe..0793ee2d39217 100644 --- a/docs/lib/content/commands/npm-pack.md +++ b/docs/lib/content/commands/npm-pack.md @@ -6,128 +6,11 @@ description: Create a tarball from a package ### Synopsis - - - - -```bash -npm pack -``` - - - - - + ### Configuration - - - -#### `dry-run` - -* Default: false -* Type: Boolean - -Indicates that you don't want npm to make any changes and that it should -only report what it would have done. This can be passed into any of the -commands that modify your local installation, eg, `install`, `update`, -`dedupe`, `uninstall`, as well as `pack` and `publish`. - -Note: This is NOT honored by other network related commands, eg `dist-tags`, -`owner`, etc. - - - - -#### `json` - -* Default: false -* Type: Boolean - -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. - - - - -#### `pack-destination` - -* Default: "." -* Type: String - -Directory in which `npm pack` will save tarballs. - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - - + ### Description diff --git a/docs/lib/content/commands/npm-ping.md b/docs/lib/content/commands/npm-ping.md index 161d7292f8c97..2bf16b2bc8114 100644 --- a/docs/lib/content/commands/npm-ping.md +++ b/docs/lib/content/commands/npm-ping.md @@ -6,18 +6,7 @@ description: Ping npm registry ### Synopsis - - - - -```bash -npm ping -``` - - - - - + Note: This command is unaware of workspaces. @@ -39,20 +28,7 @@ npm ERR! 404 Not Found - GET http://www.foo.com/-/ping?write=true ### Configuration - - - -#### `registry` - -* Default: "https://registry.npmjs.org/" -* Type: URL - -The base URL of the npm registry. - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-pkg.md b/docs/lib/content/commands/npm-pkg.md index 32772ae080a8b..dbb2f27e5c9aa 100644 --- a/docs/lib/content/commands/npm-pkg.md +++ b/docs/lib/content/commands/npm-pkg.md @@ -6,22 +6,7 @@ description: Manages your package.json ### Synopsis - - - - -```bash -npm pkg set = [= ...] -npm pkg get [ [ ...]] -npm pkg delete [ ...] -npm pkg set [[].= ...] -npm pkg set [[].= ...] -``` - - - - - + ### Description @@ -184,100 +169,7 @@ npm pkg get name version --ws ### Configuration - - - -#### `force` - -* Default: false -* Type: Boolean - -Removes various protections against unfortunate side effects, common -mistakes, unnecessary performance degradation, and malicious input. - -* Allow clobbering non-npm files in global installs. -* Allow the `npm version` command to work on an unclean git repository. -* Allow deleting the cache folder with `npm cache clean`. -* Allow installing packages that have an `engines` declaration requiring a - different version of npm. -* Allow installing packages that have an `engines` declaration requiring a - different version of `node`, even if `--engine-strict` is enabled. -* Allow `npm audit fix` to install modules outside your stated dependency - range (including SemVer-major changes). -* Allow unpublishing all versions of a published package. -* Allow conflicting peerDependencies to be installed in the root project. -* Implicitly set `--yes` during `npm init`. -* Allow clobbering existing values in `npm pkg` -* Allow unpublishing of entire packages (not just a single version). - -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 -* Type: Boolean - -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. - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - - + ## See Also * [npm install](/commands/npm-install) diff --git a/docs/lib/content/commands/npm-prefix.md b/docs/lib/content/commands/npm-prefix.md index 39328bcc88a14..3da516f52a0dc 100644 --- a/docs/lib/content/commands/npm-prefix.md +++ b/docs/lib/content/commands/npm-prefix.md @@ -6,18 +6,7 @@ description: Display prefix ### Synopsis - - - - -```bash -npm prefix [-g] -``` - - - - - + Note: This command is unaware of workspaces. @@ -44,27 +33,7 @@ npm prefix -g ### 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 diff --git a/docs/lib/content/commands/npm-profile.md b/docs/lib/content/commands/npm-profile.md index af1f9d8aa1063..36eb3fb5f0ff9 100644 --- a/docs/lib/content/commands/npm-profile.md +++ b/docs/lib/content/commands/npm-profile.md @@ -6,21 +6,7 @@ description: Change settings on your registry profile ### Synopsis - - - - -```bash -npm profile enable-2fa [auth-only|auth-and-writes] -npm profile disable-2fa -npm profile get [] -npm profile set -``` - - - - - + Note: This command is unaware of workspaces. @@ -83,60 +69,7 @@ Some of these commands may not be available on non npmjs.com registries. ### Configuration - - - -#### `registry` - -* Default: "https://registry.npmjs.org/" -* Type: URL - -The base URL of the npm registry. - - - - -#### `json` - -* Default: false -* Type: Boolean - -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. - - - - -#### `parseable` - -* Default: false -* Type: Boolean - -Output parseable results from commands that write to standard output. For -`npm search`, this will be tab-separated table format. - - - - -#### `otp` - -* Default: null -* Type: null or String - -This is a one-time password from a two-factor authenticator. It's needed -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 diff --git a/docs/lib/content/commands/npm-prune.md b/docs/lib/content/commands/npm-prune.md index 6cbfc2ad438cd..d0871c55e8054 100644 --- a/docs/lib/content/commands/npm-prune.md +++ b/docs/lib/content/commands/npm-prune.md @@ -6,18 +6,7 @@ description: Remove extraneous packages ### Synopsis - - - - -```bash -npm prune [[<@scope>/]...] -``` - - - - - + ### Description @@ -44,166 +33,7 @@ this command can help clean up any resulting garbage. ### Configuration - - - -#### `omit` - -* Default: 'dev' if the `NODE_ENV` environment variable is set to - 'production', otherwise empty. -* Type: "dev", "optional", or "peer" (can be set multiple times) - -Dependency types to omit from the installation tree on disk. - -Note that these dependencies _are_ still resolved and added to the -`package-lock.json` or `npm-shrinkwrap.json` file. They are just not -physically installed on disk. - -If a package type appears in both the `--include` and `--omit` lists, then -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 -* Type: Boolean - -Indicates that you don't want npm to make any changes and that it should -only report what it would have done. This can be passed into any of the -commands that modify your local installation, eg, `install`, `update`, -`dedupe`, `uninstall`, as well as `pack` and `publish`. - -Note: This is NOT honored by other network related commands, eg `dist-tags`, -`owner`, etc. - - - - -#### `json` - -* Default: false -* Type: Boolean - -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. - - - - -#### `foreground-scripts` - -* Default: false -* Type: Boolean - -Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) -scripts for installed packages in the foreground process, sharing standard -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 -* Type: Boolean - -If true, npm does not run scripts specified in package.json files. - -Note that commands explicitly intended to run a particular script, such as -`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script` -will still run their intended script if `ignore-scripts` is set, but they -will *not* run any pre- or post-scripts. - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - -#### `install-links` - -* Default: true -* Type: Boolean - -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/docs/lib/content/commands/npm-publish.md b/docs/lib/content/commands/npm-publish.md index 0c1b777c881bb..f8481a99b4401 100644 --- a/docs/lib/content/commands/npm-publish.md +++ b/docs/lib/content/commands/npm-publish.md @@ -6,18 +6,7 @@ description: Publish a package ### Synopsis - - - - -```bash -npm publish -``` - - - - - + ### Description @@ -96,138 +85,7 @@ built. ### Configuration - - - -#### `tag` - -* Default: "latest" -* Type: String - -If you ask npm to install a package and don't tell it a specific version, -then it will install the specified tag. - -Also the tag that is added to the package@version specified by the `npm tag` -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 - current level -* Type: null, "restricted", or "public" - -If do not want your scoped package to be publicly viewable (and installable) -set `--access=restricted`. - -Unscoped packages can not be set to `restricted`. - -Note: This defaults to not changing the current access level for existing -packages. Specifying a value of `restricted` or `public` during publish will -change the access for an existing package the same way that `npm access set -status` would. - - - - -#### `dry-run` - -* Default: false -* Type: Boolean - -Indicates that you don't want npm to make any changes and that it should -only report what it would have done. This can be passed into any of the -commands that modify your local installation, eg, `install`, `update`, -`dedupe`, `uninstall`, as well as `pack` and `publish`. - -Note: This is NOT honored by other network related commands, eg `dist-tags`, -`owner`, etc. - - - - -#### `otp` - -* Default: null -* Type: null or String - -This is a one-time password from a two-factor authenticator. It's needed -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: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-query.md b/docs/lib/content/commands/npm-query.md index c6303c2eb963d..e6bf53f3de614 100644 --- a/docs/lib/content/commands/npm-query.md +++ b/docs/lib/content/commands/npm-query.md @@ -6,18 +6,7 @@ description: Dependency selector query ### Synopsis - - - - -```bash -npm query -``` - - - - - + ### Description @@ -147,89 +136,7 @@ npm query ":type(git)" | jq 'map(.name)' | xargs -I {} npm why {} ### 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` - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - - + ## See Also * [dependency selectors](/using-npm/dependency-selectors) diff --git a/docs/lib/content/commands/npm-rebuild.md b/docs/lib/content/commands/npm-rebuild.md index 6851b4ddff087..da3a088ac7689 100644 --- a/docs/lib/content/commands/npm-rebuild.md +++ b/docs/lib/content/commands/npm-rebuild.md @@ -6,20 +6,7 @@ description: Rebuild a package ### Synopsis - - - - -```bash -npm rebuild [] ...] - -alias: rb -``` - - - - - + ### Description @@ -34,146 +21,7 @@ name and version matching one of the specifiers will be rebuilt. ### 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` - - - - -#### `bin-links` - -* Default: true -* Type: Boolean - -Tells npm to create symlinks (or `.cmd` shims on Windows) for package -executables. - -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 -* Type: Boolean - -Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) -scripts for installed packages in the foreground process, sharing standard -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 -* Type: Boolean - -If true, npm does not run scripts specified in package.json files. - -Note that commands explicitly intended to run a particular script, such as -`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script` -will still run their intended script if `ignore-scripts` is set, but they -will *not* run any pre- or post-scripts. - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - -#### `install-links` - -* Default: true -* Type: Boolean - -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/docs/lib/content/commands/npm-repo.md b/docs/lib/content/commands/npm-repo.md index 4d69a922c63a9..e5968b3378fac 100644 --- a/docs/lib/content/commands/npm-repo.md +++ b/docs/lib/content/commands/npm-repo.md @@ -6,18 +6,7 @@ description: Open package repository page in the browser ### Synopsis - - - - -```bash -npm repo [ [ ...]] -``` - - - - - + ### Description @@ -29,97 +18,7 @@ provided, it will search for a `package.json` in the current folder and use the ### Configuration - - - -#### `browser` - -* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"` -* Type: null, Boolean, or String - -The browser that is called by npm commands to open websites. - -Set to `false` to suppress browser behavior and instead print urls to -terminal. - -Set to `true` to use default system URL opener. - - - - -#### `registry` - -* Default: "https://registry.npmjs.org/" -* Type: URL - -The base URL of the npm registry. - - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-restart.md b/docs/lib/content/commands/npm-restart.md index 048bebb1659bd..c337ed6456b95 100644 --- a/docs/lib/content/commands/npm-restart.md +++ b/docs/lib/content/commands/npm-restart.md @@ -6,18 +6,7 @@ description: Restart a package ### Synopsis - - - - -```bash -npm restart [-- ] -``` - - - - - + ### Description @@ -45,36 +34,7 @@ If it does _not_ have a `"restart"` script specified, but it does have ### Configuration - - - -#### `ignore-scripts` - -* Default: false -* Type: Boolean - -If true, npm does not run scripts specified in package.json files. - -Note that commands explicitly intended to run a particular script, such as -`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script` -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 -* Type: null or String - -The shell to use for scripts run with the `npm exec`, `npm run` and `npm -init ` commands. - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-root.md b/docs/lib/content/commands/npm-root.md index 40b58e4b33d0b..6bf6c3ee811ac 100644 --- a/docs/lib/content/commands/npm-root.md +++ b/docs/lib/content/commands/npm-root.md @@ -6,18 +6,7 @@ description: Display npm root ### Synopsis - - - - -```bash -npm root -``` - - - - - + ### Description @@ -34,27 +23,7 @@ echo "Global packages installed in: ${global_node_modules}" ### 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 diff --git a/docs/lib/content/commands/npm-run-script.md b/docs/lib/content/commands/npm-run-script.md index a68b9b65dcd4f..3c35a4778d687 100644 --- a/docs/lib/content/commands/npm-run-script.md +++ b/docs/lib/content/commands/npm-run-script.md @@ -6,20 +6,7 @@ description: Run arbitrary package scripts ### Synopsis - - - - -```bash -npm run-script [-- ] - -aliases: run, rum, urn -``` - - - - - + ### Description @@ -146,130 +133,7 @@ packages. ### Configuration - - - -#### `workspace` - -* Default: -* Type: String (can be set multiple times) - -Enable running a command in the context of the configured workspaces of the -current project while filtering by running only the workspaces defined by -this configuration option. - -Valid values for the `workspace` config are either: - -* Workspace names -* Path to a workspace directory -* Path to a parent workspace directory (will result in selecting all - workspaces within that folder) - -When set for the `npm init` command, this may be set to the folder of a -workspace which does not yet exist, to create the folder and set it up as a -brand new workspace within the project. - -This value is not exported to the environment for child processes. - - - - -#### `workspaces` - -* Default: null -* Type: null or Boolean - -Set to true to run the command in the context of **all** configured -workspaces. - -Explicitly setting this to false will cause commands like `install` to -ignore workspaces altogether. When not set explicitly: - -- Commands that operate on the `node_modules` tree (install, update, etc.) -will link workspaces into the `node_modules` folder. - Commands that do -other things (test, exec, publish, etc.) will operate on the root project, -_unless_ one or more workspaces are specified in the `workspace` config. - -This value is not exported to the environment for child processes. - - - - -#### `include-workspace-root` - -* Default: false -* Type: Boolean - -Include the workspace root when workspaces are enabled for a command. - -When false, specifying individual workspaces via the `workspace` config, or -all workspaces via the `workspaces` flag, will cause npm to operate only on -the specified workspaces, and not on the root project. - -This value is not exported to the environment for child processes. - - - - -#### `if-present` - -* Default: false -* Type: Boolean - -If true, npm will not exit with an error code when `run-script` is invoked -for a script that isn't defined in the `scripts` section of `package.json`. -This option can be used when it's desirable to optionally run a script when -it's present and fail if the script fails. This is useful, for example, when -running scripts that may only apply for some builds in an otherwise generic -CI setup. - -This value is not exported to the environment for child processes. - - - - -#### `ignore-scripts` - -* Default: false -* Type: Boolean - -If true, npm does not run scripts specified in package.json files. - -Note that commands explicitly intended to run a particular script, such as -`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script` -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 -* Type: Boolean - -Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) -scripts for installed packages in the foreground process, sharing standard -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 -* Type: null or String - -The shell to use for scripts run with the `npm exec`, `npm run` and `npm -init ` commands. - - - - - + ### See Also diff --git a/docs/lib/content/commands/npm-search.md b/docs/lib/content/commands/npm-search.md index 340dea9684d00..7cf2cf4ae2554 100644 --- a/docs/lib/content/commands/npm-search.md +++ b/docs/lib/content/commands/npm-search.md @@ -6,20 +6,7 @@ description: Search for packages ### Synopsis - - - - -```bash -npm search [search terms ...] - -aliases: find, s, se -``` - - - - - + Note: This command is unaware of workspaces. @@ -48,131 +35,7 @@ expression characters in most shells.) ### Configuration - - - -#### `long` - -* Default: false -* Type: Boolean - -Show extended information in `ls`, `search`, and `help-search`. - - - - -#### `json` - -* Default: false -* Type: Boolean - -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. - - - - -#### `color` - -* Default: true unless the NO_COLOR environ is set to something other than '0' -* Type: "always" or Boolean - -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 -* Type: Boolean - -Output parseable results from commands that write to standard output. For -`npm search`, this will be tab-separated table format. - - - - -#### `description` - -* Default: true -* Type: Boolean - -Show the description in `npm search` - - - - -#### `searchopts` - -* Default: "" -* Type: String - -Space-separated options that are always passed to search. - - - - -#### `searchexclude` - -* Default: "" -* Type: String - -Space-separated options that limit the results from search. - - - - -#### `registry` - -* Default: "https://registry.npmjs.org/" -* Type: URL - -The base URL of the npm registry. - - - - -#### `prefer-online` - -* Default: false -* Type: Boolean - -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 -* Type: Boolean - -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 -* Type: Boolean - -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 diff --git a/docs/lib/content/commands/npm-set-script.md b/docs/lib/content/commands/npm-set-script.md deleted file mode 100644 index 8695b43f14423..0000000000000 --- a/docs/lib/content/commands/npm-set-script.md +++ /dev/null @@ -1,114 +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 [