CLI documentation update from CI
CI User committed
May 21, 2021 at 02:40 UTC
c58fb8c0e68b5c22f7b28d86a0ca0d3e1b5ffc21
62 files changed
+3102
-475
cli/v7
+1
-1
@@ -1 +1 @@
1
-Subproject commit 3bd758387f0f4668ae1eb2bfe420051da2a74c8e
1
+Subproject commit a3f50fde82716088eeea796385563ab5bd3b3222
content/cli/v7/commands/npm-access.md
+24
@@ -92,6 +92,30 @@ fail with an HTTP 402 status code (logically enough), unless you use
92
93
Management of teams and team memberships is done with the `npm team` command.
94
95
+### Configuration
96
+
97
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
98
+<!-- automatically generated, do not edit manually -->
99
+#### `registry`
100
+
101
+* Default: "https://registry.npmjs.org/"
102
+* Type: URL
103
+
104
+The base URL of the npm registry.
105
+
106
+#### `otp`
107
+
108
+* Default: null
109
+* Type: null or String
110
+
111
+This is a one-time password from a two-factor authenticator. It's needed
112
+when publishing or changing package permissions with `npm access`.
113
+
114
+If not set, and a registry response fails with a challenge for a one-time
115
+password, npm will prompt on the command line for one.
116
+
117
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
118
+
119
### See Also
120
121
* [`libnpmaccess`](https://npm.im/libnpmaccess)
content/cli/v7/commands/npm-adduser.md
+31
-20
@@ -45,37 +45,46 @@ your existing record.
45
46
### Configuration
47
48
-#### registry
48
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
49
+<!-- automatically generated, do not edit manually -->
50
+#### `registry`
51
50
-Default: https://registry.npmjs.org/
52
+* Default: "https://registry.npmjs.org/"
53
+* Type: URL
54
52
-The base URL of the npm package registry. If `scope` is also specified,
53
-this registry will only be used for packages with that scope. `scope` defaults
54
-to the scope of the project directory you're currently in, if any. See [`scope`](/cli/v7/using-npm/scope).
55
+The base URL of the npm registry.
56
56
-#### scope
57
+#### `scope`
58
58
-Default: none
59
+* Default: the scope of the current project, if any, or ""
60
+* Type: String
61
60
-If specified, the user and login credentials given will be associated
61
-with the specified scope. See [`scope`](/cli/v7/using-npm/scope). You can use both at the same time,
62
-e.g.
62
+Associate an operation with a scope for a scoped registry.
63
64
-```bash
65
-npm adduser --registry=http://myregistry.example.com --scope=@myco
64
+Useful when logging in to or out of a private registry:
65
+
66
+```
67
+# log in, linking the scope to the custom registry
68
+npm login --scope=@mycorp --registry=https://registry.mycorp.com
69
+
70
+# log out, removing the link and the auth token
71
+npm logout --scope=@mycorp
72
```
73
68
-This will set a registry for the given scope and login or create a user for
69
-that registry at the same time.
74
+This will cause `@mycorp` to be mapped to the registry for future
75
+installation of packages specified according to the pattern
76
+`@mycorp/package`.
77
71
-#### auth-type
78
+This will also cause `npm init` to create a scoped package.
79
+
80
+```
81
+# accept all defaults, and create a package named "@foo/whatever",
82
+# instead of just named "whatever"
83
+npm init --scope=@foo --yes
84
+```
85
73
-* Default: `'legacy'`
74
-* Type: `'legacy'`, `'sso'`, `'saml'`, `'oauth'`
86
76
-What authentication strategy to use with `adduser`/`login`. Some npm registries
77
-(for example, npmE) might support alternative auth strategies besides classic
78
-username/password entry in legacy npm.
87
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
88
89
### See Also
90
@@ -84,3 +93,5 @@ username/password entry in legacy npm.
93
* [npmrc](/cli/v7/configuring-npm/npmrc)
94
* [npm owner](/cli/v7/commands/npm-owner)
95
* [npm whoami](/cli/v7/commands/npm-whoami)
96
+* [npm token](/cli/v7/commands/npm-token)
97
+* [npm profile](/cli/v7/commands/npm-profile)
content/cli/v7/commands/npm-audit.md
+118
@@ -197,6 +197,124 @@ Fail an audit only if the results include a vulnerability with a level of modera
197
$ npm audit --audit-level=moderate
198
```
199
200
+### Configuration
201
+
202
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
203
+<!-- automatically generated, do not edit manually -->
204
+#### `audit-level`
205
+
206
+* Default: null
207
+* Type: null, "info", "low", "moderate", "high", "critical", or "none"
208
+
209
+The minimum level of vulnerability for `npm audit` to exit with a non-zero
210
+exit code.
211
+
212
+#### `dry-run`
213
+
214
+* Default: false
215
+* Type: Boolean
216
+
217
+Indicates that you don't want npm to make any changes and that it should
218
+only report what it would have done. This can be passed into any of the
219
+commands that modify your local installation, eg, `install`, `update`,
220
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
221
+
222
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
223
+`owner`, etc.
224
+
225
+#### `force`
226
+
227
+* Default: false
228
+* Type: Boolean
229
+
230
+Removes various protections against unfortunate side effects, common
231
+mistakes, unnecessary performance degradation, and malicious input.
232
+
233
+* Allow clobbering non-npm files in global installs.
234
+* Allow the `npm version` command to work on an unclean git repository.
235
+* Allow deleting the cache folder with `npm cache clean`.
236
+* Allow installing packages that have an `engines` declaration requiring a
237
+ different version of npm.
238
+* Allow installing packages that have an `engines` declaration requiring a
239
+ different version of `node`, even if `--engine-strict` is enabled.
240
+* Allow `npm audit fix` to install modules outside your stated dependency
241
+ range (including SemVer-major changes).
242
+* Allow unpublishing all versions of a published package.
243
+* Allow conflicting peerDependencies to be installed in the root project.
244
+* Implicitly set `--yes` during `npm init`.
245
+
246
+If you don't have a clear idea of what you want to do, it is strongly
247
+recommended that you do not use this option!
248
+
249
+#### `json`
250
+
251
+* Default: false
252
+* Type: Boolean
253
+
254
+Whether or not to output JSON data, rather than the normal output.
255
+
256
+Not supported by all npm commands.
257
+
258
+#### `package-lock-only`
259
+
260
+* Default: false
261
+* Type: Boolean
262
+
263
+If set to true, it will update only the `package-lock.json`, instead of
264
+checking `node_modules` and downloading dependencies.
265
+
266
+#### `omit`
267
+
268
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
269
+ 'production', otherwise empty.
270
+* Type: "dev", "optional", or "peer" (can be set multiple times)
271
+
272
+Dependency types to omit from the installation tree on disk.
273
+
274
+Note that these dependencies _are_ still resolved and added to the
275
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
276
+physically installed on disk.
277
+
278
+If a package type appears in both the `--include` and `--omit` lists, then
279
+it will be included.
280
+
281
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
282
+variable will be set to `'production'` for all lifecycle scripts.
283
+
284
+#### `workspace`
285
+
286
+* Default:
287
+* Type: String (can be set multiple times)
288
+
289
+Enable running a command in the context of the configured workspaces of the
290
+current project while filtering by running only the workspaces defined by
291
+this configuration option.
292
+
293
+Valid values for the `workspace` config are either:
294
+
295
+* Workspace names
296
+* Path to a workspace directory
297
+* Path to a parent workspace directory (will result to selecting all of the
298
+ nested workspaces)
299
+
300
+When set for the `npm init` command, this may be set to the folder of a
301
+workspace which does not yet exist, to create the folder and set it up as a
302
+brand new workspace within the project.
303
+
304
+This value is not exported to the environment for child processes.
305
+
306
+#### `workspaces`
307
+
308
+* Default: false
309
+* Type: Boolean
310
+
311
+Enable running a command in the context of **all** the configured
312
+workspaces.
313
+
314
+This value is not exported to the environment for child processes.
315
+
316
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
317
+
318
### See Also
319
320
* [npm install](/cli/v7/commands/npm-install)
content/cli/v7/commands/npm-bin.md
+20
@@ -26,6 +26,26 @@ Note: This command is unaware of workspaces.
26
27
Print the folder where npm will install executables.
28
29
+### Configuration
30
+
31
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
32
+<!-- automatically generated, do not edit manually -->
33
+#### `global`
34
+
35
+* Default: false
36
+* Type: Boolean
37
+
38
+Operates in "global" mode, so that packages are installed into the `prefix`
39
+folder instead of the current working directory. See
40
+[folders](/cli/v7/configuring-npm/folders) for more on the differences in behavior.
41
+
42
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
43
+ of the current working directory.
44
+* bin files are linked to `{prefix}/bin`
45
+* man pages are linked to `{prefix}/share/man`
46
+
47
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
48
+
49
### See Also
50
51
* [npm prefix](/cli/v7/commands/npm-prefix)
content/cli/v7/commands/npm-bugs.md
+11
-7
@@ -31,24 +31,28 @@ will search for a `package.json` in the current folder and use the `name` proper
31
32
### Configuration
33
34
-#### browser
34
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
35
+<!-- automatically generated, do not edit manually -->
36
+#### `browser`
37
38
* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
37
-* Type: String or Boolean
39
+* Type: null, Boolean, or String
40
39
-The browser that is called by the `npm bugs` command to open websites.
41
+The browser that is called by npm commands to open websites.
42
43
Set to `false` to suppress browser behavior and instead print urls to
44
terminal.
45
46
Set to `true` to use default system URL opener.
47
46
-#### registry
48
+#### `registry`
49
48
-* Default: https://registry.npmjs.org/
49
-* Type: url
50
+* Default: "https://registry.npmjs.org/"
51
+* Type: URL
52
51
-The base URL of the npm package registry.
53
+The base URL of the npm registry.
54
+
55
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
56
57
### See Also
58
content/cli/v7/commands/npm-cache.md
+9
-3
@@ -85,11 +85,17 @@ verify`.
85
86
### Configuration
87
88
-#### cache
88
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
89
+<!-- automatically generated, do not edit manually -->
90
+#### `cache`
91
90
-Default: `~/.npm` on Posix, or `%AppData%/npm-cache` on Windows.
92
+* Default: Windows: `%LocalAppData%\npm-cache`, Posix: `~/.npm`
93
+* Type: Path
94
92
-The root cache folder.
95
+The location of npm's cache directory. See [`npm
96
+cache`](/cli/v7/commands/npm-cache)
97
+
98
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
99
100
### See Also
101
content/cli/v7/commands/npm-ci.md
+26
@@ -75,6 +75,32 @@ cache:
75
- "$HOME/.npm"
76
```
77
78
+### Configuration
79
+
80
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
81
+<!-- automatically generated, do not edit manually -->
82
+#### `ignore-scripts`
83
+
84
+* Default: false
85
+* Type: Boolean
86
+
87
+If true, npm does not run scripts specified in package.json files.
88
+
89
+Note that commands explicitly intended to run a particular script, such as
90
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
91
+will still run their intended script if `ignore-scripts` is set, but they
92
+will *not* run any pre- or post-scripts.
93
+
94
+#### `script-shell`
95
+
96
+* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
97
+* Type: null or String
98
+
99
+The shell to use for scripts run with the `npm exec`, `npm run` and `npm
100
+init <pkg>` commands.
101
+
102
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
103
+
104
### See Also
105
106
* [npm install](/cli/v7/commands/npm-install)
content/cli/v7/commands/npm-config.md
+44
@@ -103,6 +103,50 @@ npm config edit
103
Opens the config file in an editor. Use the `--global` flag to edit the
104
global config.
105
106
+### Configuration
107
+
108
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
109
+<!-- automatically generated, do not edit manually -->
110
+#### `json`
111
+
112
+* Default: false
113
+* Type: Boolean
114
+
115
+Whether or not to output JSON data, rather than the normal output.
116
+
117
+Not supported by all npm commands.
118
+
119
+#### `global`
120
+
121
+* Default: false
122
+* Type: Boolean
123
+
124
+Operates in "global" mode, so that packages are installed into the `prefix`
125
+folder instead of the current working directory. See
126
+[folders](/cli/v7/configuring-npm/folders) for more on the differences in behavior.
127
+
128
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
129
+ of the current working directory.
130
+* bin files are linked to `{prefix}/bin`
131
+* man pages are linked to `{prefix}/share/man`
132
+
133
+#### `editor`
134
+
135
+* Default: The EDITOR or VISUAL environment variables, or 'notepad.exe' on
136
+ Windows, or 'vim' on Unix systems
137
+* Type: String
138
+
139
+The command to run for `npm edit` and `npm config edit`.
140
+
141
+#### `long`
142
+
143
+* Default: false
144
+* Type: Boolean
145
+
146
+Show extended information in `ls`, `search`, and `help-search`.
147
+
148
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
149
+
150
### See Also
151
152
* [npm folders](/cli/v7/configuring-npm/folders)
content/cli/v7/commands/npm-dedupe.md
+164
@@ -82,6 +82,170 @@ result in new modules being installed.
82
83
Using `npm find-dupes` will run the command in `--dry-run` mode.
84
85
+### Configuration
86
+
87
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
88
+<!-- automatically generated, do not edit manually -->
89
+#### `global-style`
90
+
91
+* Default: false
92
+* Type: Boolean
93
+
94
+Causes npm to install the package into your local `node_modules` folder with
95
+the same layout it uses with the global `node_modules` folder. Only your
96
+direct dependencies will show in `node_modules` and everything they depend
97
+on will be flattened in their `node_modules` folders. This obviously will
98
+eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling`
99
+will be preferred.
100
+
101
+#### `legacy-bundling`
102
+
103
+* Default: false
104
+* Type: Boolean
105
+
106
+Causes npm to install the package such that versions of npm prior to 1.4,
107
+such as the one included with node 0.8, can install the package. This
108
+eliminates all automatic deduping. If used with `global-style` this option
109
+will be preferred.
110
+
111
+#### `strict-peer-deps`
112
+
113
+* Default: false
114
+* Type: Boolean
115
+
116
+If set to `true`, and `--legacy-peer-deps` is not set, then _any_
117
+conflicting `peerDependencies` will be treated as an install failure, even
118
+if npm could reasonably guess the appropriate resolution based on non-peer
119
+dependency relationships.
120
+
121
+By default, conflicting `peerDependencies` deep in the dependency graph will
122
+be resolved using the nearest non-peer dependency specification, even if
123
+doing so will result in some packages receiving a peer dependency outside
124
+the range set in their package's `peerDependencies` object.
125
+
126
+When such and override is performed, a warning is printed, explaining the
127
+conflict and the packages involved. If `--strict-peer-deps` is set, then
128
+this warning is treated as a failure.
129
+
130
+#### `package-lock`
131
+
132
+* Default: true
133
+* Type: Boolean
134
+
135
+If set to false, then ignore `package-lock.json` files when installing. This
136
+will also prevent _writing_ `package-lock.json` if `save` is true.
137
+
138
+When package package-locks are disabled, automatic pruning of extraneous
139
+modules will also be disabled. To remove extraneous modules with
140
+package-locks disabled use `npm prune`.
141
+
142
+#### `omit`
143
+
144
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
145
+ 'production', otherwise empty.
146
+* Type: "dev", "optional", or "peer" (can be set multiple times)
147
+
148
+Dependency types to omit from the installation tree on disk.
149
+
150
+Note that these dependencies _are_ still resolved and added to the
151
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
152
+physically installed on disk.
153
+
154
+If a package type appears in both the `--include` and `--omit` lists, then
155
+it will be included.
156
+
157
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
158
+variable will be set to `'production'` for all lifecycle scripts.
159
+
160
+#### `ignore-scripts`
161
+
162
+* Default: false
163
+* Type: Boolean
164
+
165
+If true, npm does not run scripts specified in package.json files.
166
+
167
+Note that commands explicitly intended to run a particular script, such as
168
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
169
+will still run their intended script if `ignore-scripts` is set, but they
170
+will *not* run any pre- or post-scripts.
171
+
172
+#### `audit`
173
+
174
+* Default: true
175
+* Type: Boolean
176
+
177
+When "true" submit audit reports alongside `npm install` runs to the default
178
+registry and all registries configured for scopes. See the documentation for
179
+[`npm audit`](/cli/v7/commands/npm-audit) for details on what is submitted.
180
+
181
+#### `bin-links`
182
+
183
+* Default: true
184
+* Type: Boolean
185
+
186
+Tells npm to create symlinks (or `.cmd` shims on Windows) for package
187
+executables.
188
+
189
+Set to false to have it not do this. This can be used to work around the
190
+fact that some file systems don't support symlinks, even on ostensibly Unix
191
+systems.
192
+
193
+#### `fund`
194
+
195
+* Default: true
196
+* Type: Boolean
197
+
198
+When "true" displays the message at the end of each `npm install`
199
+acknowledging the number of dependencies looking for funding. See [`npm
200
+fund`](/cli/v7/commands/npm-fund) for details.
201
+
202
+#### `dry-run`
203
+
204
+* Default: false
205
+* Type: Boolean
206
+
207
+Indicates that you don't want npm to make any changes and that it should
208
+only report what it would have done. This can be passed into any of the
209
+commands that modify your local installation, eg, `install`, `update`,
210
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
211
+
212
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
213
+`owner`, etc.
214
+
215
+#### `workspace`
216
+
217
+* Default:
218
+* Type: String (can be set multiple times)
219
+
220
+Enable running a command in the context of the configured workspaces of the
221
+current project while filtering by running only the workspaces defined by
222
+this configuration option.
223
+
224
+Valid values for the `workspace` config are either:
225
+
226
+* Workspace names
227
+* Path to a workspace directory
228
+* Path to a parent workspace directory (will result to selecting all of the
229
+ nested workspaces)
230
+
231
+When set for the `npm init` command, this may be set to the folder of a
232
+workspace which does not yet exist, to create the folder and set it up as a
233
+brand new workspace within the project.
234
+
235
+This value is not exported to the environment for child processes.
236
+
237
+#### `workspaces`
238
+
239
+* Default: false
240
+* Type: Boolean
241
+
242
+Enable running a command in the context of **all** the configured
243
+workspaces.
244
+
245
+This value is not exported to the environment for child processes.
246
+
247
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
248
+
249
### See Also
250
251
* [npm find-dupes](/cli/v7/commands/npm-find-dupes)
content/cli/v7/commands/npm-deprecate.md
+24
@@ -50,6 +50,30 @@ To un-deprecate a package, specify an empty string (`""`) for the `message`
50
argument. Note that you must use double quotes with no space between them to
51
format an empty string.
52
53
+### Configuration
54
+
55
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
56
+<!-- automatically generated, do not edit manually -->
57
+#### `registry`
58
+
59
+* Default: "https://registry.npmjs.org/"
60
+* Type: URL
61
+
62
+The base URL of the npm registry.
63
+
64
+#### `otp`
65
+
66
+* Default: null
67
+* Type: null or String
68
+
69
+This is a one-time password from a two-factor authenticator. It's needed
70
+when publishing or changing package permissions with `npm access`.
71
+
72
+If not set, and a registry response fails with a challenge for a one-time
73
+password, npm will prompt on the command line for one.
74
+
75
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
76
+
77
### See Also
78
79
* [npm publish](/cli/v7/commands/npm-publish)
content/cli/v7/commands/npm-diff.md
+49
-35
@@ -163,82 +163,96 @@ located within the folder `./lib/` and changed lines of code within the
163
164
### Configuration
165
166
-#### diff
166
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
167
+<!-- automatically generated, do not edit manually -->
168
+#### `diff`
169
168
-* Type: Array
169
-* Default: null
170
+* Default:
171
+* Type: String (can be set multiple times)
172
171
-Defines npm package specifiers to compare using the `npm diff` command.
173
+Define arguments to compare in `npm diff`.
174
173
-This can be specified up to 2 times.
175
+#### `diff-name-only`
176
175
-#### diff-name-only
176
-
177
-* Type: Boolean
177
* Default: false
178
+* Type: Boolean
179
180
-When set to `true` running `npm diff` only returns the names of the files that
181
-have any difference.
180
+Prints only filenames when using `npm diff`.
181
183
-#### diff-unified
182
+#### `diff-unified`
183
184
+* Default: 3
185
* Type: Number
186
-* Default: `3`
186
188
-The number of lines of context to print in the unified diff format output.
187
+The number of lines of context to print in `npm diff`.
188
190
-#### diff-ignore-all-space
189
+#### `diff-ignore-all-space`
190
192
-* Type: Boolean
191
* Default: false
192
+* Type: Boolean
193
195
-Ignore whitespace when comparing lines. This ignores differences even if one
196
-line has whitespace where the other line has none.
194
+Ignore whitespace when comparing lines in `npm diff`.
195
198
-#### diff-no-prefix
196
+#### `diff-no-prefix`
197
200
-* Type: Boolean
198
* Default: false
199
+* Type: Boolean
200
+
201
+Do not show any source or destination prefix in `npm diff` output.
202
203
-Do not show any source or destination prefix.
203
+Note: this causes `npm diff` to ignore the `--diff-src-prefix` and
204
+`--diff-dst-prefix` configs.
205
205
-#### diff-src-prefix
206
+#### `diff-src-prefix`
207
208
+* Default: "a/"
209
* Type: String
208
-* Default: `"a/"`
210
210
-Show the given source prefix in diff patches headers instead of using "a/".
211
+Source prefix to be used in `npm diff` output.
212
212
-#### diff-dst-prefix
213
+#### `diff-dst-prefix`
214
215
+* Default: "b/"
216
* Type: String
215
-* Default: `"b/"`
217
217
-Show the given source prefix in diff patches headers instead of using "b/".
218
+Destination prefix to be used in `npm diff` output.
219
219
-#### diff-text
220
+#### `diff-text`
221
221
-* Type: Boolean
222
* Default: false
223
+* Type: Boolean
224
224
-Treat all files as text.
225
+Treat all files as text in `npm diff`.
226
226
-#### global
227
+#### `global`
228
229
* Default: false
230
* Type: Boolean
231
231
-Uses packages from the global space as a source for comparison.
232
+Operates in "global" mode, so that packages are installed into the `prefix`
233
+folder instead of the current working directory. See
234
+[folders](/cli/v7/configuring-npm/folders) for more on the differences in behavior.
235
+
236
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
237
+ of the current working directory.
238
+* bin files are linked to `{prefix}/bin`
239
+* man pages are linked to `{prefix}/share/man`
240
233
-#### tag
241
+#### `tag`
242
243
+* Default: "latest"
244
* Type: String
236
-* Default: `"latest"`
245
238
-The tag used to fetch the tarball that will be compared with the local file
239
-system files when running npm diff with no arguments.
246
+If you ask npm to install a package and don't tell it a specific version,
247
+then it will install the specified tag.
248
+
249
+Also the tag that is added to the package@version specified by the `npm tag`
250
+command, if no explicit tag is given.
251
252
+When used by the `npm diff` command, this is the tag used to fetch the
253
+tarball that will be compared with the local files by default.
254
255
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
256
## See Also
257
258
* [npm outdated](/cli/v7/commands/npm-outdated)
content/cli/v7/commands/npm-dist-tag.md
+32
-6
@@ -100,15 +100,41 @@ not begin with a number or the letter `v`.
100
101
### Configuration
102
103
-#### workspaces
103
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
104
+<!-- automatically generated, do not edit manually -->
105
+#### `workspace`
106
105
-Only supported by `ls`. Enables listing dist-tags of all workspace
106
-contexts defined in the current `package.json`.
107
+* Default:
108
+* Type: String (can be set multiple times)
109
108
-#### workspace
110
+Enable running a command in the context of the configured workspaces of the
111
+current project while filtering by running only the workspaces defined by
112
+this configuration option.
113
110
-Only supported by `ls`. Enables listing dist-tags of workspace contexts
111
-limiting results to only those specified by this config item.
114
+Valid values for the `workspace` config are either:
115
+
116
+* Workspace names
117
+* Path to a workspace directory
118
+* Path to a parent workspace directory (will result to selecting all of the
119
+ nested workspaces)
120
+
121
+When set for the `npm init` command, this may be set to the folder of a
122
+workspace which does not yet exist, to create the folder and set it up as a
123
+brand new workspace within the project.
124
+
125
+This value is not exported to the environment for child processes.
126
+
127
+#### `workspaces`
128
+
129
+* Default: false
130
+* Type: Boolean
131
+
132
+Enable running a command in the context of **all** the configured
133
+workspaces.
134
+
135
+This value is not exported to the environment for child processes.
136
+
137
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
138
139
### See Also
140
content/cli/v7/commands/npm-docs.md
+38
-15
@@ -32,37 +32,60 @@ the `name` property.
32
33
### Configuration
34
35
-#### browser
35
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
36
+<!-- automatically generated, do not edit manually -->
37
+#### `browser`
38
39
* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
38
-* Type: String or Boolean
40
+* Type: null, Boolean, or String
41
40
-The browser that is called by the `npm docs` command to open websites.
42
+The browser that is called by npm commands to open websites.
43
44
Set to `false` to suppress browser behavior and instead print urls to
45
terminal.
46
47
Set to `true` to use default system URL opener.
48
47
-#### registry
49
+#### `registry`
50
49
-* Default: https://registry.npmjs.org/
50
-* Type: url
51
+* Default: "https://registry.npmjs.org/"
52
+* Type: URL
53
52
-The base URL of the npm package registry.
54
+The base URL of the npm registry.
55
54
-#### workspaces
56
+#### `workspace`
57
56
-Enables workspaces context while searching the `package.json` in the
57
-current folder. Documentation urls for the packages named in each
58
-workspace will be opened.
58
+* Default:
59
+* Type: String (can be set multiple times)
60
60
-#### workspace
61
+Enable running a command in the context of the configured workspaces of the
62
+current project while filtering by running only the workspaces defined by
63
+this configuration option.
64
62
-Enables workspaces context and limits results to only those specified by
63
-this config item. Only the documentation urls for the packages named in
64
-the workspaces given here will be opened.
65
+Valid values for the `workspace` config are either:
66
67
+* Workspace names
68
+* Path to a workspace directory
69
+* Path to a parent workspace directory (will result to selecting all of the
70
+ nested workspaces)
71
+
72
+When set for the `npm init` command, this may be set to the folder of a
73
+workspace which does not yet exist, to create the folder and set it up as a
74
+brand new workspace within the project.
75
+
76
+This value is not exported to the environment for child processes.
77
+
78
+#### `workspaces`
79
+
80
+* Default: false
81
+* Type: Boolean
82
+
83
+Enable running a command in the context of **all** the configured
84
+workspaces.
85
+
86
+This value is not exported to the environment for child processes.
87
+
88
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
89
90
### See Also
91
content/cli/v7/commands/npm-doctor.md
+13
@@ -112,6 +112,19 @@ located with `npm config get cache`). In the event that there are corrupt
112
packages in your cache, you should probably run `npm cache clean -f` and
113
reset the cache.
114
115
+### Configuration
116
+
117
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
118
+<!-- automatically generated, do not edit manually -->
119
+#### `registry`
120
+
121
+* Default: "https://registry.npmjs.org/"
122
+* Type: URL
123
+
124
+The base URL of the npm registry.
125
+
126
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
127
+
128
### See Also
129
130
* [npm bugs](/cli/v7/commands/npm-bugs)
content/cli/v7/commands/npm-edit.md
+9
-5
@@ -37,13 +37,17 @@ changes to your locally installed copy.
37
38
### Configuration
39
40
-#### editor
40
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
41
+<!-- automatically generated, do not edit manually -->
42
+#### `editor`
43
42
-* Default: `EDITOR` environment variable if set, or `"vi"` on Posix,
43
- or `"notepad"` on Windows.
44
-* Type: path
44
+* Default: The EDITOR or VISUAL environment variables, or 'notepad.exe' on
45
+ Windows, or 'vim' on Unix systems
46
+* Type: String
47
46
-The command to run for `npm edit` or `npm config edit`.
48
+The command to run for `npm edit` and `npm config edit`.
49
+
50
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
51
52
### See Also
53
content/cli/v7/commands/npm-exec.md
+70
-9
@@ -130,6 +130,64 @@ thus be equivalent to the `npx` command above:
130
$ npm exec -- foo@latest bar --package=@npmcli/foo
131
```
132
133
+### Configuration
134
+
135
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
136
+<!-- automatically generated, do not edit manually -->
137
+#### `package`
138
+
139
+* Default:
140
+* Type: String (can be set multiple times)
141
+
142
+The package to install for [`npm exec`](/cli/v7/commands/npm-exec)
143
+
144
+#### `call`
145
+
146
+* Default: ""
147
+* Type: String
148
+
149
+Optional companion option for `npm exec`, `npx` that allows for specifying a
150
+custom command to be run along with the installed packages.
151
+
152
+```bash
153
+npm exec --package yo --package generator-node --call "yo node"
154
+```
155
+
156
+
157
+#### `workspace`
158
+
159
+* Default:
160
+* Type: String (can be set multiple times)
161
+
162
+Enable running a command in the context of the configured workspaces of the
163
+current project while filtering by running only the workspaces defined by
164
+this configuration option.
165
+
166
+Valid values for the `workspace` config are either:
167
+
168
+* Workspace names
169
+* Path to a workspace directory
170
+* Path to a parent workspace directory (will result to selecting all of the
171
+ nested workspaces)
172
+
173
+When set for the `npm init` command, this may be set to the folder of a
174
+workspace which does not yet exist, to create the folder and set it up as a
175
+brand new workspace within the project.
176
+
177
+This value is not exported to the environment for child processes.
178
+
179
+#### `workspaces`
180
+
181
+* Default: false
182
+* Type: Boolean
183
+
184
+Enable running a command in the context of **all** the configured
185
+workspaces.
186
+
187
+This value is not exported to the environment for child processes.
188
+
189
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
190
+
191
### Examples
192
193
Run the version of `tap` in the local dependencies, with the provided
@@ -270,18 +328,21 @@ an error.
328
329
#### workspace
330
273
-* Alias: `-w`
274
-* Type: Array
275
-* Default: `[]`
331
+* Default:
332
+* Type: String (can be set multiple times)
333
277
-Enable running scripts in the context of workspaces while also filtering by
278
-the provided names or paths provided.
334
+Enable running a command in the context of the configured workspaces of the
335
+current project while filtering by running only the workspaces defined by
336
+this configuration option.
337
338
Valid values for the `workspace` config are either:
281
-- Workspace names
282
-- Path to a workspace directory
283
-- Path to a parent workspace directory (will result to selecting all of the
284
-children workspaces)
339
+
340
+* Workspace names
341
+* Path to a workspace directory
342
+* Path to a parent workspace directory (will result to selecting all of the
343
+ nested workspaces)
344
+
345
+This value is not exported to the environment for child processes.
346
347
#### workspaces
348
content/cli/v7/commands/npm-explain.md
+30
-3
@@ -64,13 +64,40 @@ node_modules/nyc/node_modules/find-up
64
```
65
66
### Configuration
67
-
68
-#### json
67
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
68
+<!-- automatically generated, do not edit manually -->
69
+#### `json`
70
71
* Default: false
72
* Type: Boolean
73
73
-Show information in JSON format.
74
+Whether or not to output JSON data, rather than the normal output.
75
+
76
+Not supported by all npm commands.
77
+
78
+#### `workspace`
79
+
80
+* Default:
81
+* Type: String (can be set multiple times)
82
+
83
+Enable running a command in the context of the configured workspaces of the
84
+current project while filtering by running only the workspaces defined by
85
+this configuration option.
86
+
87
+Valid values for the `workspace` config are either:
88
+
89
+* Workspace names
90
+* Path to a workspace directory
91
+* Path to a parent workspace directory (will result to selecting all of the
92
+ nested workspaces)
93
+
94
+When set for the `npm init` command, this may be set to the folder of a
95
+workspace which does not yet exist, to create the folder and set it up as a
96
+brand new workspace within the project.
97
+
98
+This value is not exported to the environment for child processes.
99
+
100
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
101
102
### See Also
103
content/cli/v7/commands/npm-explore.md
+7
-3
@@ -41,14 +41,18 @@ sure to use `npm rebuild <pkg>` if you make any changes.
41
42
### Configuration
43
44
-#### shell
44
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
45
+<!-- automatically generated, do not edit manually -->
46
+#### `shell`
47
46
-* Default: SHELL environment variable, or "bash" on Posix, or "cmd" on
48
+* Default: SHELL environment variable, or "bash" on Posix, or "cmd.exe" on
49
Windows
48
-* Type: path
50
+* Type: String
51
52
The shell to run for the `npm explore` command.
53
54
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
55
+
56
### See Also
57
58
* [npm folders](/cli/v7/configuring-npm/folders)
content/cli/v7/commands/npm-find-dupes.md
+151
@@ -25,6 +25,157 @@ npm find-dupes
25
Runs `npm dedupe` in `--dry-run` mode, making npm only output the
26
duplications, without actually changing the package tree.
27
28
+### Configuration
29
+
30
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
31
+<!-- automatically generated, do not edit manually -->
32
+#### `global-style`
33
+
34
+* Default: false
35
+* Type: Boolean
36
+
37
+Causes npm to install the package into your local `node_modules` folder with
38
+the same layout it uses with the global `node_modules` folder. Only your
39
+direct dependencies will show in `node_modules` and everything they depend
40
+on will be flattened in their `node_modules` folders. This obviously will
41
+eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling`
42
+will be preferred.
43
+
44
+#### `legacy-bundling`
45
+
46
+* Default: false
47
+* Type: Boolean
48
+
49
+Causes npm to install the package such that versions of npm prior to 1.4,
50
+such as the one included with node 0.8, can install the package. This
51
+eliminates all automatic deduping. If used with `global-style` this option
52
+will be preferred.
53
+
54
+#### `strict-peer-deps`
55
+
56
+* Default: false
57
+* Type: Boolean
58
+
59
+If set to `true`, and `--legacy-peer-deps` is not set, then _any_
60
+conflicting `peerDependencies` will be treated as an install failure, even
61
+if npm could reasonably guess the appropriate resolution based on non-peer
62
+dependency relationships.
63
+
64
+By default, conflicting `peerDependencies` deep in the dependency graph will
65
+be resolved using the nearest non-peer dependency specification, even if
66
+doing so will result in some packages receiving a peer dependency outside
67
+the range set in their package's `peerDependencies` object.
68
+
69
+When such and override is performed, a warning is printed, explaining the
70
+conflict and the packages involved. If `--strict-peer-deps` is set, then
71
+this warning is treated as a failure.
72
+
73
+#### `package-lock`
74
+
75
+* Default: true
76
+* Type: Boolean
77
+
78
+If set to false, then ignore `package-lock.json` files when installing. This
79
+will also prevent _writing_ `package-lock.json` if `save` is true.
80
+
81
+When package package-locks are disabled, automatic pruning of extraneous
82
+modules will also be disabled. To remove extraneous modules with
83
+package-locks disabled use `npm prune`.
84
+
85
+#### `omit`
86
+
87
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
88
+ 'production', otherwise empty.
89
+* Type: "dev", "optional", or "peer" (can be set multiple times)
90
+
91
+Dependency types to omit from the installation tree on disk.
92
+
93
+Note that these dependencies _are_ still resolved and added to the
94
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
95
+physically installed on disk.
96
+
97
+If a package type appears in both the `--include` and `--omit` lists, then
98
+it will be included.
99
+
100
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
101
+variable will be set to `'production'` for all lifecycle scripts.
102
+
103
+#### `ignore-scripts`
104
+
105
+* Default: false
106
+* Type: Boolean
107
+
108
+If true, npm does not run scripts specified in package.json files.
109
+
110
+Note that commands explicitly intended to run a particular script, such as
111
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
112
+will still run their intended script if `ignore-scripts` is set, but they
113
+will *not* run any pre- or post-scripts.
114
+
115
+#### `audit`
116
+
117
+* Default: true
118
+* Type: Boolean
119
+
120
+When "true" submit audit reports alongside `npm install` runs to the default
121
+registry and all registries configured for scopes. See the documentation for
122
+[`npm audit`](/cli/v7/commands/npm-audit) for details on what is submitted.
123
+
124
+#### `bin-links`
125
+
126
+* Default: true
127
+* Type: Boolean
128
+
129
+Tells npm to create symlinks (or `.cmd` shims on Windows) for package
130
+executables.
131
+
132
+Set to false to have it not do this. This can be used to work around the
133
+fact that some file systems don't support symlinks, even on ostensibly Unix
134
+systems.
135
+
136
+#### `fund`
137
+
138
+* Default: true
139
+* Type: Boolean
140
+
141
+When "true" displays the message at the end of each `npm install`
142
+acknowledging the number of dependencies looking for funding. See [`npm
143
+fund`](/cli/v7/commands/npm-fund) for details.
144
+
145
+#### `workspace`
146
+
147
+* Default:
148
+* Type: String (can be set multiple times)
149
+
150
+Enable running a command in the context of the configured workspaces of the
151
+current project while filtering by running only the workspaces defined by
152
+this configuration option.
153
+
154
+Valid values for the `workspace` config are either:
155
+
156
+* Workspace names
157
+* Path to a workspace directory
158
+* Path to a parent workspace directory (will result to selecting all of the
159
+ nested workspaces)
160
+
161
+When set for the `npm init` command, this may be set to the folder of a
162
+workspace which does not yet exist, to create the folder and set it up as a
163
+brand new workspace within the project.
164
+
165
+This value is not exported to the environment for child processes.
166
+
167
+#### `workspaces`
168
+
169
+* Default: false
170
+* Type: Boolean
171
+
172
+Enable running a command in the context of **all** the configured
173
+workspaces.
174
+
175
+This value is not exported to the environment for child processes.
176
+
177
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
178
+
179
### See Also
180
181
* [npm dedupe](/cli/v7/commands/npm-dedupe)
content/cli/v7/commands/npm-fund.md
+33
-16
@@ -74,27 +74,37 @@ test-workspaces-fund@1.0.0
74
75
### Configuration
76
77
-#### browser
77
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
78
+<!-- automatically generated, do not edit manually -->
79
+#### `json`
80
79
-* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
80
-* Type: String
81
+* Default: false
82
+* Type: Boolean
83
82
-The browser that is called by the `npm fund` command to open websites.
84
+Whether or not to output JSON data, rather than the normal output.
85
84
-#### json
86
+Not supported by all npm commands.
87
86
-* Type: Boolean
87
-* Default: false
88
+#### `browser`
89
+
90
+* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
91
+* Type: null, Boolean, or String
92
+
93
+The browser that is called by npm commands to open websites.
94
+
95
+Set to `false` to suppress browser behavior and instead print urls to
96
+terminal.
97
89
-Show information in JSON format.
98
+Set to `true` to use default system URL opener.
99
91
-#### unicode
100
+#### `unicode`
101
102
+* Default: false on windows, true on mac/unix systems with a unicode locale,
103
+ as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables.
104
* Type: Boolean
94
-* Default: true
105
96
-Whether to represent the tree structure using unicode characters.
97
-Set it to `false` in order to use all-ansi output.
106
+When set to true, npm uses unicode characters in the tree output. When
107
+false, it uses ascii characters instead of unicode glyphs.
108
109
#### `workspace`
110
@@ -106,20 +116,27 @@ current project while filtering by running only the workspaces defined by
116
this configuration option.
117
118
Valid values for the `workspace` config are either:
119
+
120
* Workspace names
121
* Path to a workspace directory
122
* Path to a parent workspace directory (will result to selecting all of the
112
-nested workspaces)
123
+ nested workspaces)
124
+
125
+When set for the `npm init` command, this may be set to the folder of a
126
+workspace which does not yet exist, to create the folder and set it up as a
127
+brand new workspace within the project.
128
129
This value is not exported to the environment for child processes.
130
116
-#### which
131
+#### `which`
132
118
-* Type: Number
119
-* Default: undefined
133
+* Default: null
134
+* Type: null or Number
135
136
If there are multiple funding sources, which 1-indexed source URL to open.
137
138
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
139
+
140
## See Also
141
142
* [npm install](/cli/v7/commands/npm-install)
content/cli/v7/commands/npm-help-search.md
+6
-5
@@ -35,15 +35,16 @@ directly.
35
36
### Configuration
37
38
-#### long
38
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
39
+<!-- automatically generated, do not edit manually -->
40
+#### `long`
41
40
-* Type: Boolean
42
* Default: false
43
+* Type: Boolean
44
43
-If true, the "long" flag will cause help-search to output context around
44
-where the terms were found in the documentation.
45
+Show extended information in `ls`, `search`, and `help-search`.
46
46
-If false, then help-search will just list out the help topics found.
47
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
48
49
### See Also
50
content/cli/v7/commands/npm-help.md
+6
-2
@@ -33,15 +33,19 @@ topic, so unique matches are equivalent to specifying a topic name.
33
34
### Configuration
35
36
-#### viewer
36
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
37
+<!-- automatically generated, do not edit manually -->
38
+#### `viewer`
39
40
* Default: "man" on Posix, "browser" on Windows
39
-* Type: path
41
+* Type: String
42
43
The program to use to view help content.
44
45
Set to `"browser"` to view html help content in the default web browser.
46
47
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
48
+
49
### See Also
50
51
* [npm](/cli/v7/commands/npm)
content/cli/v7/commands/npm-hook.md
+24
@@ -93,6 +93,30 @@ Remove a hook:
93
$ npm hook rm id-deadbeef
94
```
95
96
+### Configuration
97
+
98
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
99
+<!-- automatically generated, do not edit manually -->
100
+#### `registry`
101
+
102
+* Default: "https://registry.npmjs.org/"
103
+* Type: URL
104
+
105
+The base URL of the npm registry.
106
+
107
+#### `otp`
108
+
109
+* Default: null
110
+* Type: null or String
111
+
112
+This is a one-time password from a two-factor authenticator. It's needed
113
+when publishing or changing package permissions with `npm access`.
114
+
115
+If not set, and a registry response fails with a challenge for a one-time
116
+password, npm will prompt on the command line for one.
117
+
118
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
119
+
120
### See Also
121
122
* ["Introducing Hooks" blog post](https://blog.npmjs.org/post/145260155635/introducing-hooks-get-notifications-of-npm)
content/cli/v7/commands/npm-init.md
+53
-32
@@ -17,7 +17,7 @@ github_path: docs/content/commands/npm-init.md
17
### Synopsis
18
19
```bash
20
-npm init [--force|-f|--yes|-y|--scope]
20
+npm init [--yes|-y|--scope]
21
npm init <@scope> (same as `npm exec <@scope>/create`)
22
npm init [<@scope>/]<name> (same as `npm exec [<@scope>/]create-<name>`)
23
npm init [-w <dir>] [args...]
@@ -153,54 +153,75 @@ dot to represent the current directory in that context, e.g: `react-app .`:
153
`-- ...
154
```
155
156
-### A note on caching
156
+### Configuration
157
158
-The npm cli utilizes its internal package cache when using the package
159
-name specified. You can use the following to change how and when the
160
-cli uses this cache. See [`npm cache`](/cli/v7/commands/npm-cache) for more on
161
-how the cache works.
158
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
159
+<!-- automatically generated, do not edit manually -->
160
+#### `yes`
161
163
-#### prefer-online
162
+* Default: null
163
+* Type: null or Boolean
164
165
-Forces staleness checks for packages, making the cli look for updates
166
-immediately even if the package is already in the cache.
165
+Automatically answer "yes" to any prompts that npm might print on the
166
+command line.
167
168
-#### prefer-offline
168
+#### `force`
169
170
-Bypasses staleness checks for packages. Missing data will still be
171
-requested from the server. To force full offline mode, use `offline`.
170
+* Default: false
171
+* Type: Boolean
172
173
-#### offline
173
+Removes various protections against unfortunate side effects, common
174
+mistakes, unnecessary performance degradation, and malicious input.
175
175
-Forces full offline mode. Any packages not locally cached will result in
176
-an error.
176
+* Allow clobbering non-npm files in global installs.
177
+* Allow the `npm version` command to work on an unclean git repository.
178
+* Allow deleting the cache folder with `npm cache clean`.
179
+* Allow installing packages that have an `engines` declaration requiring a
180
+ different version of npm.
181
+* Allow installing packages that have an `engines` declaration requiring a
182
+ different version of `node`, even if `--engine-strict` is enabled.
183
+* Allow `npm audit fix` to install modules outside your stated dependency
184
+ range (including SemVer-major changes).
185
+* Allow unpublishing all versions of a published package.
186
+* Allow conflicting peerDependencies to be installed in the root project.
187
+* Implicitly set `--yes` during `npm init`.
188
178
-#### workspace
189
+If you don't have a clear idea of what you want to do, it is strongly
190
+recommended that you do not use this option!
191
180
-* Alias: `-w`
181
-* Type: Array
182
-* Default: `[]`
192
+#### `workspace`
193
184
-Enable running `npm init` in the context of workspaces, creating any missing
185
-folders, generating files and adding/updating the `"workspaces"` property of
186
-the project `package.json`.
194
+* Default:
195
+* Type: String (can be set multiple times)
196
188
-the provided names or paths provided.
197
+Enable running a command in the context of the configured workspaces of the
198
+current project while filtering by running only the workspaces defined by
199
+this configuration option.
200
201
Valid values for the `workspace` config are either:
191
-- Workspace names
192
-- Path to a workspace directory
193
-- Path to a parent workspace directory (will result to selecting all of the
194
-children workspaces)
202
196
-#### workspaces
203
+* Workspace names
204
+* Path to a workspace directory
205
+* Path to a parent workspace directory (will result to selecting all of the
206
+ nested workspaces)
207
+
208
+When set for the `npm init` command, this may be set to the folder of a
209
+workspace which does not yet exist, to create the folder and set it up as a
210
+brand new workspace within the project.
211
+
212
+This value is not exported to the environment for child processes.
213
198
-* Alias: `-ws`
214
+#### `workspaces`
215
+
216
+* Default: false
217
* Type: Boolean
200
-* Default: `false`
218
202
-Run `npm init` in the context of all configured workspaces for the
203
-current project.
219
+Enable running a command in the context of **all** the configured
220
+workspaces.
221
+
222
+This value is not exported to the environment for child processes.
223
+
224
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
225
226
### See Also
227
content/cli/v7/commands/npm-install-ci-test.md
+26
@@ -26,6 +26,32 @@ alias: npm cit
26
27
This command runs `npm ci` followed immediately by `npm test`.
28
29
+### Configuration
30
+
31
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
32
+<!-- automatically generated, do not edit manually -->
33
+#### `ignore-scripts`
34
+
35
+* Default: false
36
+* Type: Boolean
37
+
38
+If true, npm does not run scripts specified in package.json files.
39
+
40
+Note that commands explicitly intended to run a particular script, such as
41
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
42
+will still run their intended script if `ignore-scripts` is set, but they
43
+will *not* run any pre- or post-scripts.
44
+
45
+#### `script-shell`
46
+
47
+* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
48
+* Type: null or String
49
+
50
+The shell to use for scripts run with the `npm exec`, `npm run` and `npm
51
+init <pkg>` commands.
52
+
53
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
54
+
55
### See Also
56
57
* [npm install-test](/cli/v7/commands/npm-install-test)
content/cli/v7/commands/npm-install-test.md
+196
@@ -35,6 +35,202 @@ common options: [--save|--save-dev|--save-optional] [--save-exact] [--dry-run]
35
This command runs an `npm install` followed immediately by an `npm test`. It
36
takes exactly the same arguments as `npm install`.
37
38
+### Configuration
39
+
40
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
41
+<!-- automatically generated, do not edit manually -->
42
+#### `save`
43
+
44
+* Default: true
45
+* Type: Boolean
46
+
47
+Save installed packages to a package.json file as dependencies.
48
+
49
+When used with the `npm rm` command, removes the dependency from
50
+package.json.
51
+
52
+#### `save-exact`
53
+
54
+* Default: false
55
+* Type: Boolean
56
+
57
+Dependencies saved to package.json will be configured with an exact version
58
+rather than using npm's default semver range operator.
59
+
60
+#### `global`
61
+
62
+* Default: false
63
+* Type: Boolean
64
+
65
+Operates in "global" mode, so that packages are installed into the `prefix`
66
+folder instead of the current working directory. See
67
+[folders](/cli/v7/configuring-npm/folders) for more on the differences in behavior.
68
+
69
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
70
+ of the current working directory.
71
+* bin files are linked to `{prefix}/bin`
72
+* man pages are linked to `{prefix}/share/man`
73
+
74
+#### `global-style`
75
+
76
+* Default: false
77
+* Type: Boolean
78
+
79
+Causes npm to install the package into your local `node_modules` folder with
80
+the same layout it uses with the global `node_modules` folder. Only your
81
+direct dependencies will show in `node_modules` and everything they depend
82
+on will be flattened in their `node_modules` folders. This obviously will
83
+eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling`
84
+will be preferred.
85
+
86
+#### `legacy-bundling`
87
+
88
+* Default: false
89
+* Type: Boolean
90
+
91
+Causes npm to install the package such that versions of npm prior to 1.4,
92
+such as the one included with node 0.8, can install the package. This
93
+eliminates all automatic deduping. If used with `global-style` this option
94
+will be preferred.
95
+
96
+#### `strict-peer-deps`
97
+
98
+* Default: false
99
+* Type: Boolean
100
+
101
+If set to `true`, and `--legacy-peer-deps` is not set, then _any_
102
+conflicting `peerDependencies` will be treated as an install failure, even
103
+if npm could reasonably guess the appropriate resolution based on non-peer
104
+dependency relationships.
105
+
106
+By default, conflicting `peerDependencies` deep in the dependency graph will
107
+be resolved using the nearest non-peer dependency specification, even if
108
+doing so will result in some packages receiving a peer dependency outside
109
+the range set in their package's `peerDependencies` object.
110
+
111
+When such and override is performed, a warning is printed, explaining the
112
+conflict and the packages involved. If `--strict-peer-deps` is set, then
113
+this warning is treated as a failure.
114
+
115
+#### `package-lock`
116
+
117
+* Default: true
118
+* Type: Boolean
119
+
120
+If set to false, then ignore `package-lock.json` files when installing. This
121
+will also prevent _writing_ `package-lock.json` if `save` is true.
122
+
123
+When package package-locks are disabled, automatic pruning of extraneous
124
+modules will also be disabled. To remove extraneous modules with
125
+package-locks disabled use `npm prune`.
126
+
127
+#### `omit`
128
+
129
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
130
+ 'production', otherwise empty.
131
+* Type: "dev", "optional", or "peer" (can be set multiple times)
132
+
133
+Dependency types to omit from the installation tree on disk.
134
+
135
+Note that these dependencies _are_ still resolved and added to the
136
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
137
+physically installed on disk.
138
+
139
+If a package type appears in both the `--include` and `--omit` lists, then
140
+it will be included.
141
+
142
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
143
+variable will be set to `'production'` for all lifecycle scripts.
144
+
145
+#### `ignore-scripts`
146
+
147
+* Default: false
148
+* Type: Boolean
149
+
150
+If true, npm does not run scripts specified in package.json files.
151
+
152
+Note that commands explicitly intended to run a particular script, such as
153
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
154
+will still run their intended script if `ignore-scripts` is set, but they
155
+will *not* run any pre- or post-scripts.
156
+
157
+#### `audit`
158
+
159
+* Default: true
160
+* Type: Boolean
161
+
162
+When "true" submit audit reports alongside `npm install` runs to the default
163
+registry and all registries configured for scopes. See the documentation for
164
+[`npm audit`](/cli/v7/commands/npm-audit) for details on what is submitted.
165
+
166
+#### `bin-links`
167
+
168
+* Default: true
169
+* Type: Boolean
170
+
171
+Tells npm to create symlinks (or `.cmd` shims on Windows) for package
172
+executables.
173
+
174
+Set to false to have it not do this. This can be used to work around the
175
+fact that some file systems don't support symlinks, even on ostensibly Unix
176
+systems.
177
+
178
+#### `fund`
179
+
180
+* Default: true
181
+* Type: Boolean
182
+
183
+When "true" displays the message at the end of each `npm install`
184
+acknowledging the number of dependencies looking for funding. See [`npm
185
+fund`](/cli/v7/commands/npm-fund) for details.
186
+
187
+#### `dry-run`
188
+
189
+* Default: false
190
+* Type: Boolean
191
+
192
+Indicates that you don't want npm to make any changes and that it should
193
+only report what it would have done. This can be passed into any of the
194
+commands that modify your local installation, eg, `install`, `update`,
195
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
196
+
197
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
198
+`owner`, etc.
199
+
200
+#### `workspace`
201
+
202
+* Default:
203
+* Type: String (can be set multiple times)
204
+
205
+Enable running a command in the context of the configured workspaces of the
206
+current project while filtering by running only the workspaces defined by
207
+this configuration option.
208
+
209
+Valid values for the `workspace` config are either:
210
+
211
+* Workspace names
212
+* Path to a workspace directory
213
+* Path to a parent workspace directory (will result to selecting all of the
214
+ nested workspaces)
215
+
216
+When set for the `npm init` command, this may be set to the folder of a
217
+workspace which does not yet exist, to create the folder and set it up as a
218
+brand new workspace within the project.
219
+
220
+This value is not exported to the environment for child processes.
221
+
222
+#### `workspaces`
223
+
224
+* Default: false
225
+* Type: Boolean
226
+
227
+Enable running a command in the context of **all** the configured
228
+workspaces.
229
+
230
+This value is not exported to the environment for child processes.
231
+
232
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
233
+
234
### See Also
235
236
* [npm install](/cli/v7/commands/npm-install)
content/cli/v7/commands/npm-install.md
+169
-59
@@ -422,89 +422,199 @@ does.
422
423
These are some of the most common options related to installation.
424
425
-#### Configuration Options Affecting Dependency Resolution And Tree Design
425
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
426
+<!-- automatically generated, do not edit manually -->
427
+#### `save`
428
427
-* `-g` or `--global`: install the package globally rather than locally.
428
- See [folders](/cli/v7/configuring-npm/folders).
429
+* Default: true
430
+* Type: Boolean
431
430
-* `--global-style`: install the package into your local `node_modules`
431
- folder with the same layout it uses with the global `node_modules`
432
- folder. Only your direct dependencies will show in `node_modules` and
433
- everything they depend on will be flattened in their `node_modules`
434
- folders. This obviously will eliminate some deduping.
432
+Save installed packages to a package.json file as dependencies.
433
436
-* `--legacy-bundling`: install the package in the style of versions of npm
437
- prior to 1.4, where dependencies are not automatically deduped up to the
438
- shallowest level in the tree possible. This is extremely
439
- disk-inefficient.
434
+When used with the `npm rm` command, removes the dependency from
435
+package.json.
436
441
-* `--legacy-peer-deps`: ignore all `peerDependencies` when installing, in
442
- the style of npm version 4 through version 6.
437
+#### `save-exact`
438
444
-* `--strict-peer-deps`: fail and abort the install process for any
445
- conflicting peerDependencies when encountered. By default, npm will only
446
- crash for peerDependencies conflicts caused by the direct dependencies of
447
- the root project.
439
+* Default: false
440
+* Type: Boolean
441
449
-* `--no-package-lock` (alias: `--no-shrinkwrap`): do not read the
450
- lockfile (`package-lock.json` or `npm-shrinkwrap.json`) for the intended
451
- package tree, and do not save the resulting package tree back to a
452
- lockfile.
442
+Dependencies saved to package.json will be configured with an exact version
443
+rather than using npm's default semver range operator.
444
454
-#### Omitting Dependency Types
445
+#### `global`
446
456
-You may omit certain types of dependencies by using the `--omit=<type>`
457
-config option. This may be specified multiple types on the command line.
458
-To enter `omit` options in `.npmrc` files, use the following syntax:
447
+* Default: false
448
+* Type: Boolean
449
460
-```ini
461
-omit[] = dev
462
-omit[] = optional
463
-; etc...
464
-```
450
+Operates in "global" mode, so that packages are installed into the `prefix`
451
+folder instead of the current working directory. See
452
+[folders](/cli/v7/configuring-npm/folders) for more on the differences in behavior.
453
+
454
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
455
+ of the current working directory.
456
+* bin files are linked to `{prefix}/bin`
457
+* man pages are linked to `{prefix}/share/man`
458
+
459
+#### `global-style`
460
+
461
+* Default: false
462
+* Type: Boolean
463
+
464
+Causes npm to install the package into your local `node_modules` folder with
465
+the same layout it uses with the global `node_modules` folder. Only your
466
+direct dependencies will show in `node_modules` and everything they depend
467
+on will be flattened in their `node_modules` folders. This obviously will
468
+eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling`
469
+will be preferred.
470
+
471
+#### `legacy-bundling`
472
+
473
+* Default: false
474
+* Type: Boolean
475
+
476
+Causes npm to install the package such that versions of npm prior to 1.4,
477
+such as the one included with node 0.8, can install the package. This
478
+eliminates all automatic deduping. If used with `global-style` this option
479
+will be preferred.
480
+
481
+#### `strict-peer-deps`
482
+
483
+* Default: false
484
+* Type: Boolean
485
+
486
+If set to `true`, and `--legacy-peer-deps` is not set, then _any_
487
+conflicting `peerDependencies` will be treated as an install failure, even
488
+if npm could reasonably guess the appropriate resolution based on non-peer
489
+dependency relationships.
490
+
491
+By default, conflicting `peerDependencies` deep in the dependency graph will
492
+be resolved using the nearest non-peer dependency specification, even if
493
+doing so will result in some packages receiving a peer dependency outside
494
+the range set in their package's `peerDependencies` object.
495
+
496
+When such and override is performed, a warning is printed, explaining the
497
+conflict and the packages involved. If `--strict-peer-deps` is set, then
498
+this warning is treated as a failure.
499
+
500
+#### `package-lock`
501
+
502
+* Default: true
503
+* Type: Boolean
504
+
505
+If set to false, then ignore `package-lock.json` files when installing. This
506
+will also prevent _writing_ `package-lock.json` if `save` is true.
507
+
508
+When package package-locks are disabled, automatic pruning of extraneous
509
+modules will also be disabled. To remove extraneous modules with
510
+package-locks disabled use `npm prune`.
511
+
512
+#### `omit`
513
+
514
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
515
+ 'production', otherwise empty.
516
+* Type: "dev", "optional", or "peer" (can be set multiple times)
517
+
518
+Dependency types to omit from the installation tree on disk.
519
+
520
+Note that these dependencies _are_ still resolved and added to the
521
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
522
+physically installed on disk.
523
+
524
+If a package type appears in both the `--include` and `--omit` lists, then
525
+it will be included.
526
+
527
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
528
+variable will be set to `'production'` for all lifecycle scripts.
529
+
530
+#### `ignore-scripts`
531
+
532
+* Default: false
533
+* Type: Boolean
534
+
535
+If true, npm does not run scripts specified in package.json files.
536
+
537
+Note that commands explicitly intended to run a particular script, such as
538
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
539
+will still run their intended script if `ignore-scripts` is set, but they
540
+will *not* run any pre- or post-scripts.
541
+
542
+#### `audit`
543
+
544
+* Default: true
545
+* Type: Boolean
546
+
547
+When "true" submit audit reports alongside `npm install` runs to the default
548
+registry and all registries configured for scopes. See the documentation for
549
+[`npm audit`](/cli/v7/commands/npm-audit) for details on what is submitted.
550
+
551
+#### `bin-links`
552
+
553
+* Default: true
554
+* Type: Boolean
555
+
556
+Tells npm to create symlinks (or `.cmd` shims on Windows) for package
557
+executables.
558
+
559
+Set to false to have it not do this. This can be used to work around the
560
+fact that some file systems don't support symlinks, even on ostensibly Unix
561
+systems.
562
+
563
+#### `fund`
564
+
565
+* Default: true
566
+* Type: Boolean
567
+
568
+When "true" displays the message at the end of each `npm install`
569
+acknowledging the number of dependencies looking for funding. See [`npm
570
+fund`](/cli/v7/commands/npm-fund) for details.
571
+
572
+#### `dry-run`
573
466
-The dependency types that may be omitted or included are:
574
+* Default: false
575
+* Type: Boolean
576
468
-* `peer`: any `peerDependencies`, including those with a
469
- `peerDependenciesMeta` entry specifying `optional: true`
470
-* `optional`: dependencies listed in `optionalDependencies`
471
-* `dev`: dependencies listed in `devDependencies`
577
+Indicates that you don't want npm to make any changes and that it should
578
+only report what it would have done. This can be passed into any of the
579
+commands that modify your local installation, eg, `install`, `update`,
580
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
581
473
-To re-include dependency, use the `--include` option, which may also be
474
-specified multiple times.
582
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
583
+`owner`, etc.
584
476
-Legacy shorthands for `omit` settings are:
585
+#### `workspace`
586
478
-* `--no-optional`: prevent optionalDependencies from being installed. Note
479
- that their presence is still entered in the `package-lock.json` file, and
480
- the tree is designed such that they _can_ be installed in the future.
587
+* Default:
588
+* Type: String (can be set multiple times)
589
482
-* `--prod`: prevent devDependencies from being installed.
590
+Enable running a command in the context of the configured workspaces of the
591
+current project while filtering by running only the workspaces defined by
592
+this configuration option.
593
484
-* `--only=prod`: omit `devDependencies`
594
+Valid values for the `workspace` config are either:
595
486
-* `--also=dev`: include `devDependencies`
596
+* Workspace names
597
+* Path to a workspace directory
598
+* Path to a parent workspace directory (will result to selecting all of the
599
+ nested workspaces)
600
488
-#### Configuration Options Affecting Build Process
601
+When set for the `npm init` command, this may be set to the folder of a
602
+workspace which does not yet exist, to create the folder and set it up as a
603
+brand new workspace within the project.
604
490
-* `--ignore-scripts`: do not execute any scripts defined in the
491
- package.json. See [`scripts`](/cli/v7/using-npm/scripts).
605
+This value is not exported to the environment for child processes.
606
493
-* `--no-audit`: disable sending audit reports to the configured registries.
494
- See [`npm-audit`](npm-audit) for details on what is sent.
607
+#### `workspaces`
608
496
-* `--no-bin-links`: prevent npm from creating symlinks for any binaries the
497
- package might contain.
609
+* Default: false
610
+* Type: Boolean
611
499
-* `--no-fund`: suppress the message displayed at the end of each install
500
- that acknowledges the number of dependencies looking for funding. See
501
- [`npm-fund`](/cli/v7/commands/npm-fund)
612
+Enable running a command in the context of **all** the configured
613
+workspaces.
614
503
-* `--dry-run`: Do not actually install anything into the `node_modules`
504
- folder. Just build the intended tree in memory, and report on it.
615
+This value is not exported to the environment for child processes.
616
506
-* `--no-save`: Do not save installed dependencies to `package.json` or
507
- `package-lock.json`.
617
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
618
619
### Algorithm
620
content/cli/v7/commands/npm-link.md
+164
@@ -109,6 +109,170 @@ relevant metadata by running `npm install <dep> --package-lock-only`.
109
If you _want_ to save the `file:` reference in your `package.json` and
110
`package-lock.json` files, you can use `npm link <dep> --save` to do so.
111
112
+### Configuration
113
+
114
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
115
+<!-- automatically generated, do not edit manually -->
116
+#### `save`
117
+
118
+* Default: true
119
+* Type: Boolean
120
+
121
+Save installed packages to a package.json file as dependencies.
122
+
123
+When used with the `npm rm` command, removes the dependency from
124
+package.json.
125
+
126
+#### `save-exact`
127
+
128
+* Default: false
129
+* Type: Boolean
130
+
131
+Dependencies saved to package.json will be configured with an exact version
132
+rather than using npm's default semver range operator.
133
+
134
+#### `global`
135
+
136
+* Default: false
137
+* Type: Boolean
138
+
139
+Operates in "global" mode, so that packages are installed into the `prefix`
140
+folder instead of the current working directory. See
141
+[folders](/cli/v7/configuring-npm/folders) for more on the differences in behavior.
142
+
143
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
144
+ of the current working directory.
145
+* bin files are linked to `{prefix}/bin`
146
+* man pages are linked to `{prefix}/share/man`
147
+
148
+#### `global-style`
149
+
150
+* Default: false
151
+* Type: Boolean
152
+
153
+Causes npm to install the package into your local `node_modules` folder with
154
+the same layout it uses with the global `node_modules` folder. Only your
155
+direct dependencies will show in `node_modules` and everything they depend
156
+on will be flattened in their `node_modules` folders. This obviously will
157
+eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling`
158
+will be preferred.
159
+
160
+#### `legacy-bundling`
161
+
162
+* Default: false
163
+* Type: Boolean
164
+
165
+Causes npm to install the package such that versions of npm prior to 1.4,
166
+such as the one included with node 0.8, can install the package. This
167
+eliminates all automatic deduping. If used with `global-style` this option
168
+will be preferred.
169
+
170
+#### `strict-peer-deps`
171
+
172
+* Default: false
173
+* Type: Boolean
174
+
175
+If set to `true`, and `--legacy-peer-deps` is not set, then _any_
176
+conflicting `peerDependencies` will be treated as an install failure, even
177
+if npm could reasonably guess the appropriate resolution based on non-peer
178
+dependency relationships.
179
+
180
+By default, conflicting `peerDependencies` deep in the dependency graph will
181
+be resolved using the nearest non-peer dependency specification, even if
182
+doing so will result in some packages receiving a peer dependency outside
183
+the range set in their package's `peerDependencies` object.
184
+
185
+When such and override is performed, a warning is printed, explaining the
186
+conflict and the packages involved. If `--strict-peer-deps` is set, then
187
+this warning is treated as a failure.
188
+
189
+#### `package-lock`
190
+
191
+* Default: true
192
+* Type: Boolean
193
+
194
+If set to false, then ignore `package-lock.json` files when installing. This
195
+will also prevent _writing_ `package-lock.json` if `save` is true.
196
+
197
+When package package-locks are disabled, automatic pruning of extraneous
198
+modules will also be disabled. To remove extraneous modules with
199
+package-locks disabled use `npm prune`.
200
+
201
+#### `omit`
202
+
203
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
204
+ 'production', otherwise empty.
205
+* Type: "dev", "optional", or "peer" (can be set multiple times)
206
+
207
+Dependency types to omit from the installation tree on disk.
208
+
209
+Note that these dependencies _are_ still resolved and added to the
210
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
211
+physically installed on disk.
212
+
213
+If a package type appears in both the `--include` and `--omit` lists, then
214
+it will be included.
215
+
216
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
217
+variable will be set to `'production'` for all lifecycle scripts.
218
+
219
+#### `ignore-scripts`
220
+
221
+* Default: false
222
+* Type: Boolean
223
+
224
+If true, npm does not run scripts specified in package.json files.
225
+
226
+Note that commands explicitly intended to run a particular script, such as
227
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
228
+will still run their intended script if `ignore-scripts` is set, but they
229
+will *not* run any pre- or post-scripts.
230
+
231
+#### `audit`
232
+
233
+* Default: true
234
+* Type: Boolean
235
+
236
+When "true" submit audit reports alongside `npm install` runs to the default
237
+registry and all registries configured for scopes. See the documentation for
238
+[`npm audit`](/cli/v7/commands/npm-audit) for details on what is submitted.
239
+
240
+#### `bin-links`
241
+
242
+* Default: true
243
+* Type: Boolean
244
+
245
+Tells npm to create symlinks (or `.cmd` shims on Windows) for package
246
+executables.
247
+
248
+Set to false to have it not do this. This can be used to work around the
249
+fact that some file systems don't support symlinks, even on ostensibly Unix
250
+systems.
251
+
252
+#### `fund`
253
+
254
+* Default: true
255
+* Type: Boolean
256
+
257
+When "true" displays the message at the end of each `npm install`
258
+acknowledging the number of dependencies looking for funding. See [`npm
259
+fund`](/cli/v7/commands/npm-fund) for details.
260
+
261
+#### `dry-run`
262
+
263
+* Default: false
264
+* Type: Boolean
265
+
266
+Indicates that you don't want npm to make any changes and that it should
267
+only report what it would have done. This can be passed into any of the
268
+commands that modify your local installation, eg, `install`, `update`,
269
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
270
+
271
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
272
+`owner`, etc.
273
+
274
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
275
+
276
### See Also
277
278
* [npm developers](/cli/v7/using-npm/developers)
content/cli/v7/commands/npm-logout.md
+33
-9
@@ -37,23 +37,47 @@ connected to that scope, if set.
37
38
### Configuration
39
40
-#### registry
40
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
41
+<!-- automatically generated, do not edit manually -->
42
+#### `registry`
43
42
-Default: https://registry.npmjs.org/
44
+* Default: "https://registry.npmjs.org/"
45
+* Type: URL
46
44
-The base URL of the npm package registry. If `scope` is also specified,
45
-it takes precedence.
47
+The base URL of the npm registry.
48
47
-#### scope
49
+#### `scope`
50
49
-Default: The scope of your current project, if any, otherwise none.
51
+* Default: the scope of the current project, if any, or ""
52
+* Type: String
53
51
-If specified, you will be logged out of the specified scope. See [`scope`](/cli/v7/using-npm/scope).
54
+Associate an operation with a scope for a scoped registry.
55
53
-```bash
54
-npm logout --scope=@myco
56
+Useful when logging in to or out of a private registry:
57
+
58
+```
59
+# log in, linking the scope to the custom registry
60
+npm login --scope=@mycorp --registry=https://registry.mycorp.com
61
+
62
+# log out, removing the link and the auth token
63
+npm logout --scope=@mycorp
64
```
65
66
+This will cause `@mycorp` to be mapped to the registry for future
67
+installation of packages specified according to the pattern
68
+`@mycorp/package`.
69
+
70
+This will also cause `npm init` to create a scoped package.
71
+
72
+```
73
+# accept all defaults, and create a package named "@foo/whatever",
74
+# instead of just named "whatever"
75
+npm init --scope=@foo --yes
76
+```
77
+
78
+
79
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
80
+
81
### See Also
82
83
* [npm adduser](/cli/v7/commands/npm-adduser)
content/cli/v7/commands/npm-ls.md
+89
-32
@@ -83,86 +83,143 @@ least the default human-readable `npm ls` output in npm v8.
83
84
### Configuration
85
86
-#### all
86
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
87
+<!-- automatically generated, do not edit manually -->
88
+#### `all`
89
88
-* Default: `false`
90
+* Default: false
91
* Type: Boolean
92
93
When running `npm outdated` and `npm ls`, setting `--all` will show all
94
outdated or installed packages, rather than only those directly depended
95
upon by the current project.
96
95
-#### json
97
+#### `json`
98
99
* Default: false
100
* Type: Boolean
101
100
-Show information in JSON format.
102
+Whether or not to output JSON data, rather than the normal output.
103
+
104
+Not supported by all npm commands.
105
102
-#### long
106
+#### `long`
107
108
* Default: false
109
* Type: Boolean
110
107
-Show extended information.
111
+Show extended information in `ls`, `search`, and `help-search`.
112
109
-#### parseable
113
+#### `parseable`
114
115
* Default: false
116
* Type: Boolean
117
114
-Show parseable output instead of tree view.
118
+Output parseable results from commands that write to standard output. For
119
+`npm search`, this will be tab-separated table format.
120
116
-#### global
121
+#### `global`
122
123
* Default: false
124
* Type: Boolean
125
121
-List packages in the global install prefix instead of in the current
122
-project.
126
+Operates in "global" mode, so that packages are installed into the `prefix`
127
+folder instead of the current working directory. See
128
+[folders](/cli/v7/configuring-npm/folders) for more on the differences in behavior.
129
124
-#### depth
130
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
131
+ of the current working directory.
132
+* bin files are linked to `{prefix}/bin`
133
+* man pages are linked to `{prefix}/share/man`
134
126
-* Type: Int
135
+#### `depth`
136
128
-Max display depth of the dependency tree.
137
+* Default: `Infinity` if `--all` is set, otherwise `1`
138
+* Type: null or Number
139
130
-#### prod / production
140
+The depth to go when recursing packages for `npm ls`.
141
+
142
+If not set, `npm ls` will show only the immediate dependencies of the root
143
+project. If `--all` is set, then npm will show all dependencies by default.
144
+
145
+#### `omit`
146
+
147
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
148
+ 'production', otherwise empty.
149
+* Type: "dev", "optional", or "peer" (can be set multiple times)
150
+
151
+Dependency types to omit from the installation tree on disk.
152
+
153
+Note that these dependencies _are_ still resolved and added to the
154
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
155
+physically installed on disk.
156
+
157
+If a package type appears in both the `--include` and `--omit` lists, then
158
+it will be included.
159
+
160
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
161
+variable will be set to `'production'` for all lifecycle scripts.
162
+
163
+#### `link`
164
132
-* Type: Boolean
165
* Default: false
166
+* Type: Boolean
167
+
168
+If true, then local installs will link if there is a suitable globally
169
+installed package.
170
+
171
+Note that this means that local installs can cause things to be installed
172
+into the global space at the same time. The link is only done if one of the
173
+two conditions are met:
174
135
-Display only the dependency tree for packages in `dependencies`.
175
+* The package is not already installed globally, or
176
+* the globally installed version is identical to the version that is being
177
+ installed locally.
178
137
-#### dev / development
179
+When used with `npm ls`, only show packages that are linked.
180
181
+#### `unicode`
182
+
183
+* Default: false on windows, true on mac/unix systems with a unicode locale,
184
+ as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables.
185
* Type: Boolean
140
-* Default: false
186
142
-Display only the dependency tree for packages in `devDependencies`.
187
+When set to true, npm uses unicode characters in the tree output. When
188
+false, it uses ascii characters instead of unicode glyphs.
189
144
-#### only
190
+#### `workspace`
191
146
-* Type: String
192
+* Default:
193
+* Type: String (can be set multiple times)
194
148
-When "dev" or "development", is an alias to `dev`.
195
+Enable running a command in the context of the configured workspaces of the
196
+current project while filtering by running only the workspaces defined by
197
+this configuration option.
198
150
-When "prod" or "production", is an alias to `production`.
199
+Valid values for the `workspace` config are either:
200
152
-#### link
201
+* Workspace names
202
+* Path to a workspace directory
203
+* Path to a parent workspace directory (will result to selecting all of the
204
+ nested workspaces)
205
154
-* Type: Boolean
155
-* Default: false
206
+When set for the `npm init` command, this may be set to the folder of a
207
+workspace which does not yet exist, to create the folder and set it up as a
208
+brand new workspace within the project.
209
157
-Display only dependencies which are linked
210
+This value is not exported to the environment for child processes.
211
159
-#### unicode
212
+#### `workspaces`
213
214
+* Default: false
215
* Type: Boolean
162
-* Default: true
216
164
-Whether to represent the tree structure using unicode characters.
165
-Set it to false in order to use all-ansi output.
217
+Enable running a command in the context of **all** the configured
218
+workspaces.
219
+
220
+This value is not exported to the environment for child processes.
221
+
222
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
223
224
### See Also
225
content/cli/v7/commands/npm-org.md
+41
@@ -68,6 +68,47 @@ You can use the `npm org` commands to manage and view users of an
68
organization. It supports adding and removing users, changing their roles,
69
listing them, and finding specific ones and their roles.
70
71
+### Configuration
72
+
73
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
74
+<!-- automatically generated, do not edit manually -->
75
+#### `registry`
76
+
77
+* Default: "https://registry.npmjs.org/"
78
+* Type: URL
79
+
80
+The base URL of the npm registry.
81
+
82
+#### `otp`
83
+
84
+* Default: null
85
+* Type: null or String
86
+
87
+This is a one-time password from a two-factor authenticator. It's needed
88
+when publishing or changing package permissions with `npm access`.
89
+
90
+If not set, and a registry response fails with a challenge for a one-time
91
+password, npm will prompt on the command line for one.
92
+
93
+#### `json`
94
+
95
+* Default: false
96
+* Type: Boolean
97
+
98
+Whether or not to output JSON data, rather than the normal output.
99
+
100
+Not supported by all npm commands.
101
+
102
+#### `parseable`
103
+
104
+* Default: false
105
+* Type: Boolean
106
+
107
+Output parseable results from commands that write to standard output. For
108
+`npm search`, this will be tab-separated table format.
109
+
110
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
111
+
112
### See Also
113
114
* [using orgs](/cli/v7/using-npm/orgs)
content/cli/v7/commands/npm-outdated.md
+51
-12
@@ -25,7 +25,8 @@ npm outdated [[<@scope>/]<pkg> ...]
25
This command will check the registry to see if any (or, specific) installed
26
packages are currently outdated.
27
28
-By default, only the direct dependencies of the root project are shown.
28
+By default, only the direct dependencies of the root project and direct
29
+dependencies of your configured *workspaces* are shown.
30
Use `--all` to find all outdated meta-dependencies as well.
31
32
In the output:
@@ -95,41 +96,78 @@ A few things to note:
96
97
### Configuration
98
98
-#### json
99
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
100
+<!-- automatically generated, do not edit manually -->
101
+#### `all`
102
103
* Default: false
104
* Type: Boolean
105
103
-Show information in JSON format.
106
+When running `npm outdated` and `npm ls`, setting `--all` will show all
107
+outdated or installed packages, rather than only those directly depended
108
+upon by the current project.
109
105
-#### long
110
+#### `json`
111
112
* Default: false
113
* Type: Boolean
114
110
-Show extended information.
115
+Whether or not to output JSON data, rather than the normal output.
116
112
-#### parseable
117
+Not supported by all npm commands.
118
+
119
+#### `long`
120
121
* Default: false
122
* Type: Boolean
123
117
-Show parseable output instead of tree view.
124
+Show extended information in `ls`, `search`, and `help-search`.
125
119
-#### global
126
+#### `parseable`
127
128
* Default: false
129
* Type: Boolean
130
124
-Check packages in the global install prefix instead of in the current
125
-project.
131
+Output parseable results from commands that write to standard output. For
132
+`npm search`, this will be tab-separated table format.
133
127
-#### all
134
+#### `global`
135
136
* Default: false
137
* Type: Boolean
138
132
-Display all outdated dependencies on the tree.
139
+Operates in "global" mode, so that packages are installed into the `prefix`
140
+folder instead of the current working directory. See
141
+[folders](/cli/v7/configuring-npm/folders) for more on the differences in behavior.
142
+
143
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
144
+ of the current working directory.
145
+* bin files are linked to `{prefix}/bin`
146
+* man pages are linked to `{prefix}/share/man`
147
+
148
+#### `workspace`
149
+
150
+* Default:
151
+* Type: String (can be set multiple times)
152
+
153
+Enable running a command in the context of the configured workspaces of the
154
+current project while filtering by running only the workspaces defined by
155
+this configuration option.
156
+
157
+Valid values for the `workspace` config are either:
158
+
159
+* Workspace names
160
+* Path to a workspace directory
161
+* Path to a parent workspace directory (will result to selecting all of the
162
+ nested workspaces)
163
+
164
+When set for the `npm init` command, this may be set to the folder of a
165
+workspace which does not yet exist, to create the folder and set it up as a
166
+brand new workspace within the project.
167
+
168
+This value is not exported to the environment for child processes.
169
+
170
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
171
172
### See Also
173
@@ -137,3 +175,4 @@ Display all outdated dependencies on the tree.
175
* [npm dist-tag](/cli/v7/commands/npm-dist-tag)
176
* [npm registry](/cli/v7/using-npm/registry)
177
* [npm folders](/cli/v7/configuring-npm/folders)
178
+* [npm workspaces](/cli/v7/using-npm/workspaces)
content/cli/v7/commands/npm-owner.md
+24
@@ -45,6 +45,30 @@ If you have two-factor authentication enabled with `auth-and-writes` (see
45
[`npm-profile`](/cli/v7/commands/npm-profile)) then you'll need to include an otp
46
on the command line when changing ownership with `--otp`.
47
48
+### Configuration
49
+
50
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
51
+<!-- automatically generated, do not edit manually -->
52
+#### `registry`
53
+
54
+* Default: "https://registry.npmjs.org/"
55
+* Type: URL
56
+
57
+The base URL of the npm registry.
58
+
59
+#### `otp`
60
+
61
+* Default: null
62
+* Type: null or String
63
+
64
+This is a one-time password from a two-factor authenticator. It's needed
65
+when publishing or changing package permissions with `npm access`.
66
+
67
+If not set, and a registry response fails with a challenge for a one-time
68
+password, npm will prompt on the command line for one.
69
+
70
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
71
+
72
### See Also
73
74
* [npm profile](/cli/v7/commands/npm-profile)
content/cli/v7/commands/npm-pack.md
+44
-12
@@ -17,27 +17,59 @@ github_path: docs/content/commands/npm-pack.md
17
### Synopsis
18
19
```bash
20
-npm pack [[<@scope>/]<pkg>...] [--dry-run]
20
+npm pack [[<@scope>/]<pkg>...] [--dry-run] [--json]
21
```
22
23
### Configuration
24
25
-#### dry-run
25
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
26
+<!-- automatically generated, do not edit manually -->
27
+#### `dry-run`
28
27
-Do everything that pack usually does without actually packing anything.
28
-That is, report on what would have gone into the tarball, but nothing
29
-else.
29
+* Default: false
30
+* Type: Boolean
31
31
-#### workspaces
32
+Indicates that you don't want npm to make any changes and that it should
33
+only report what it would have done. This can be passed into any of the
34
+commands that modify your local installation, eg, `install`, `update`,
35
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
36
33
-Enables workspaces context while creating tarballs. Tarballs for each
34
-workspaces will be generated.
37
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
38
+`owner`, etc.
39
36
-#### workspace
40
+#### `workspace`
41
38
-Enables workspaces context and limits results to only those specified by
39
-this config item. Tarballs will only be generated for the packages
40
-named in the workspaces given here.
42
+* Default:
43
+* Type: String (can be set multiple times)
44
+
45
+Enable running a command in the context of the configured workspaces of the
46
+current project while filtering by running only the workspaces defined by
47
+this configuration option.
48
+
49
+Valid values for the `workspace` config are either:
50
+
51
+* Workspace names
52
+* Path to a workspace directory
53
+* Path to a parent workspace directory (will result to selecting all of the
54
+ nested workspaces)
55
+
56
+When set for the `npm init` command, this may be set to the folder of a
57
+workspace which does not yet exist, to create the folder and set it up as a
58
+brand new workspace within the project.
59
+
60
+This value is not exported to the environment for child processes.
61
+
62
+#### `workspaces`
63
+
64
+* Default: false
65
+* Type: Boolean
66
+
67
+Enable running a command in the context of **all** the configured
68
+workspaces.
69
+
70
+This value is not exported to the environment for child processes.
71
+
72
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
73
74
### Description
75
content/cli/v7/commands/npm-ping.md
+13
@@ -35,6 +35,19 @@ otherwise you will get:
35
Ping error: {*Detail about error}
36
```
37
38
+### Configuration
39
+
40
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
41
+<!-- automatically generated, do not edit manually -->
42
+#### `registry`
43
+
44
+* Default: "https://registry.npmjs.org/"
45
+* Type: URL
46
+
47
+The base URL of the npm registry.
48
+
49
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
50
+
51
### See Also
52
53
* [npm doctor](/cli/v7/commands/npm-doctor)
content/cli/v7/commands/npm-prefix.md
+20
@@ -43,6 +43,26 @@ npm prefix -g
43
/usr/local
44
```
45
46
+### Configuration
47
+
48
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
49
+<!-- automatically generated, do not edit manually -->
50
+#### `global`
51
+
52
+* Default: false
53
+* Type: Boolean
54
+
55
+Operates in "global" mode, so that packages are installed into the `prefix`
56
+folder instead of the current working directory. See
57
+[folders](/cli/v7/configuring-npm/folders) for more on the differences in behavior.
58
+
59
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
60
+ of the current working directory.
61
+* bin files are linked to `{prefix}/bin`
62
+* man pages are linked to `{prefix}/share/man`
63
+
64
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
65
+
66
### See Also
67
68
* [npm root](/cli/v7/commands/npm-root)
content/cli/v7/commands/npm-profile.md
+47
-4
@@ -81,12 +81,55 @@ support this interface.
81
82
### Details
83
84
-All of the `npm profile` subcommands accept `--json` and `--parseable` and
85
-will tailor their output based on those. Some of these commands may not be
86
-available on non npmjs.com registries.
84
+Some of these commands may not be available on non npmjs.com registries.
85
+
86
+### Configuration
87
+
88
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
89
+<!-- automatically generated, do not edit manually -->
90
+#### `registry`
91
+
92
+* Default: "https://registry.npmjs.org/"
93
+* Type: URL
94
+
95
+The base URL of the npm registry.
96
+
97
+#### `json`
98
+
99
+* Default: false
100
+* Type: Boolean
101
+
102
+Whether or not to output JSON data, rather than the normal output.
103
+
104
+Not supported by all npm commands.
105
+
106
+#### `parseable`
107
+
108
+* Default: false
109
+* Type: Boolean
110
+
111
+Output parseable results from commands that write to standard output. For
112
+`npm search`, this will be tab-separated table format.
113
+
114
+#### `otp`
115
+
116
+* Default: null
117
+* Type: null or String
118
+
119
+This is a one-time password from a two-factor authenticator. It's needed
120
+when publishing or changing package permissions with `npm access`.
121
+
122
+If not set, and a registry response fails with a challenge for a one-time
123
+password, npm will prompt on the command line for one.
124
+
125
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
126
127
### See Also
128
129
* [npm adduser](/cli/v7/commands/npm-adduser)
91
-* [npm logout](/cli/v7/commands/npm-logout)
130
+* [npm registry](/cli/v7/using-npm/registry)
131
* [npm config](/cli/v7/commands/npm-config)
132
+* [npmrc](/cli/v7/configuring-npm/npmrc)
133
+* [npm owner](/cli/v7/commands/npm-owner)
134
+* [npm whoami](/cli/v7/commands/npm-whoami)
135
+* [npm token](/cli/v7/commands/npm-token)
content/cli/v7/commands/npm-prune.md
+78
@@ -43,6 +43,84 @@ only need this command with the `--production` flag. However, in the real
43
world, operation is not always "normal". When crashes or mistakes happen,
44
this command can help clean up any resulting garbage.
45
46
+### Configuration
47
+
48
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
49
+<!-- automatically generated, do not edit manually -->
50
+#### `omit`
51
+
52
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
53
+ 'production', otherwise empty.
54
+* Type: "dev", "optional", or "peer" (can be set multiple times)
55
+
56
+Dependency types to omit from the installation tree on disk.
57
+
58
+Note that these dependencies _are_ still resolved and added to the
59
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
60
+physically installed on disk.
61
+
62
+If a package type appears in both the `--include` and `--omit` lists, then
63
+it will be included.
64
+
65
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
66
+variable will be set to `'production'` for all lifecycle scripts.
67
+
68
+#### `dry-run`
69
+
70
+* Default: false
71
+* Type: Boolean
72
+
73
+Indicates that you don't want npm to make any changes and that it should
74
+only report what it would have done. This can be passed into any of the
75
+commands that modify your local installation, eg, `install`, `update`,
76
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
77
+
78
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
79
+`owner`, etc.
80
+
81
+#### `json`
82
+
83
+* Default: false
84
+* Type: Boolean
85
+
86
+Whether or not to output JSON data, rather than the normal output.
87
+
88
+Not supported by all npm commands.
89
+
90
+#### `workspace`
91
+
92
+* Default:
93
+* Type: String (can be set multiple times)
94
+
95
+Enable running a command in the context of the configured workspaces of the
96
+current project while filtering by running only the workspaces defined by
97
+this configuration option.
98
+
99
+Valid values for the `workspace` config are either:
100
+
101
+* Workspace names
102
+* Path to a workspace directory
103
+* Path to a parent workspace directory (will result to selecting all of the
104
+ nested workspaces)
105
+
106
+When set for the `npm init` command, this may be set to the folder of a
107
+workspace which does not yet exist, to create the folder and set it up as a
108
+brand new workspace within the project.
109
+
110
+This value is not exported to the environment for child processes.
111
+
112
+#### `workspaces`
113
+
114
+* Default: false
115
+* Type: Boolean
116
+
117
+Enable running a command in the context of **all** the configured
118
+workspaces.
119
+
120
+This value is not exported to the environment for child processes.
121
+
122
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
123
+
124
### See Also
125
126
* [npm uninstall](/cli/v7/commands/npm-uninstall)
content/cli/v7/commands/npm-publish.md
+86
@@ -114,6 +114,92 @@ See [`developers`](/cli/v7/using-npm/developers) for full details on what's
114
included in the published package, as well as details on how the package is
115
built.
116
117
+### Configuration
118
+
119
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
120
+<!-- automatically generated, do not edit manually -->
121
+#### `tag`
122
+
123
+* Default: "latest"
124
+* Type: String
125
+
126
+If you ask npm to install a package and don't tell it a specific version,
127
+then it will install the specified tag.
128
+
129
+Also the tag that is added to the package@version specified by the `npm tag`
130
+command, if no explicit tag is given.
131
+
132
+When used by the `npm diff` command, this is the tag used to fetch the
133
+tarball that will be compared with the local files by default.
134
+
135
+#### `access`
136
+
137
+* Default: 'restricted' for scoped packages, 'public' for unscoped packages
138
+* Type: null, "restricted", or "public"
139
+
140
+When publishing scoped packages, the access level defaults to `restricted`.
141
+If you want your scoped package to be publicly viewable (and installable)
142
+set `--access=public`. The only valid values for `access` are `public` and
143
+`restricted`. Unscoped packages _always_ have an access level of `public`.
144
+
145
+#### `dry-run`
146
+
147
+* Default: false
148
+* Type: Boolean
149
+
150
+Indicates that you don't want npm to make any changes and that it should
151
+only report what it would have done. This can be passed into any of the
152
+commands that modify your local installation, eg, `install`, `update`,
153
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
154
+
155
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
156
+`owner`, etc.
157
+
158
+#### `otp`
159
+
160
+* Default: null
161
+* Type: null or String
162
+
163
+This is a one-time password from a two-factor authenticator. It's needed
164
+when publishing or changing package permissions with `npm access`.
165
+
166
+If not set, and a registry response fails with a challenge for a one-time
167
+password, npm will prompt on the command line for one.
168
+
169
+#### `workspace`
170
+
171
+* Default:
172
+* Type: String (can be set multiple times)
173
+
174
+Enable running a command in the context of the configured workspaces of the
175
+current project while filtering by running only the workspaces defined by
176
+this configuration option.
177
+
178
+Valid values for the `workspace` config are either:
179
+
180
+* Workspace names
181
+* Path to a workspace directory
182
+* Path to a parent workspace directory (will result to selecting all of the
183
+ nested workspaces)
184
+
185
+When set for the `npm init` command, this may be set to the folder of a
186
+workspace which does not yet exist, to create the folder and set it up as a
187
+brand new workspace within the project.
188
+
189
+This value is not exported to the environment for child processes.
190
+
191
+#### `workspaces`
192
+
193
+* Default: false
194
+* Type: Boolean
195
+
196
+Enable running a command in the context of **all** the configured
197
+workspaces.
198
+
199
+This value is not exported to the environment for child processes.
200
+
201
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
202
+
203
### See Also
204
205
* [npm-packlist package](http://npm.im/npm-packlist)
content/cli/v7/commands/npm-rebuild.md
+76
@@ -34,6 +34,82 @@ If one or more package names (and optionally version ranges) are provided,
34
then only packages with a name and version matching one of the specifiers
35
will be rebuilt.
36
37
+### Configuration
38
+
39
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
40
+<!-- automatically generated, do not edit manually -->
41
+#### `global`
42
+
43
+* Default: false
44
+* Type: Boolean
45
+
46
+Operates in "global" mode, so that packages are installed into the `prefix`
47
+folder instead of the current working directory. See
48
+[folders](/cli/v7/configuring-npm/folders) for more on the differences in behavior.
49
+
50
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
51
+ of the current working directory.
52
+* bin files are linked to `{prefix}/bin`
53
+* man pages are linked to `{prefix}/share/man`
54
+
55
+#### `bin-links`
56
+
57
+* Default: true
58
+* Type: Boolean
59
+
60
+Tells npm to create symlinks (or `.cmd` shims on Windows) for package
61
+executables.
62
+
63
+Set to false to have it not do this. This can be used to work around the
64
+fact that some file systems don't support symlinks, even on ostensibly Unix
65
+systems.
66
+
67
+#### `ignore-scripts`
68
+
69
+* Default: false
70
+* Type: Boolean
71
+
72
+If true, npm does not run scripts specified in package.json files.
73
+
74
+Note that commands explicitly intended to run a particular script, such as
75
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
76
+will still run their intended script if `ignore-scripts` is set, but they
77
+will *not* run any pre- or post-scripts.
78
+
79
+#### `workspace`
80
+
81
+* Default:
82
+* Type: String (can be set multiple times)
83
+
84
+Enable running a command in the context of the configured workspaces of the
85
+current project while filtering by running only the workspaces defined by
86
+this configuration option.
87
+
88
+Valid values for the `workspace` config are either:
89
+
90
+* Workspace names
91
+* Path to a workspace directory
92
+* Path to a parent workspace directory (will result to selecting all of the
93
+ nested workspaces)
94
+
95
+When set for the `npm init` command, this may be set to the folder of a
96
+workspace which does not yet exist, to create the folder and set it up as a
97
+brand new workspace within the project.
98
+
99
+This value is not exported to the environment for child processes.
100
+
101
+#### `workspaces`
102
+
103
+* Default: false
104
+* Type: Boolean
105
+
106
+Enable running a command in the context of **all** the configured
107
+workspaces.
108
+
109
+This value is not exported to the environment for child processes.
110
+
111
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
112
+
113
### See Also
114
115
* [npm install](/cli/v7/commands/npm-install)
content/cli/v7/commands/npm-repo.md
+34
-11
@@ -29,30 +29,53 @@ in the current folder and use the `repository` property.
29
30
### Configuration
31
32
-#### browser
32
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
33
+<!-- automatically generated, do not edit manually -->
34
+#### `browser`
35
36
* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
35
-* Type: String or Boolean
37
+* Type: null, Boolean, or String
38
37
-The browser that is called by the `npm repo` command to open websites.
39
+The browser that is called by npm commands to open websites.
40
41
Set to `false` to suppress browser behavior and instead print urls to
42
terminal.
43
44
Set to `true` to use default system URL opener.
45
44
-#### workspaces
46
+#### `workspace`
47
46
-Enables workspaces context while searching the `package.json` in the
47
-current folder. Repo urls for the packages named in each workspace will
48
-be opened.
48
+* Default:
49
+* Type: String (can be set multiple times)
50
50
-#### workspace
51
+Enable running a command in the context of the configured workspaces of the
52
+current project while filtering by running only the workspaces defined by
53
+this configuration option.
54
52
-Enables workspaces context and limits results to only those specified by
53
-this config item. Only the repo urls for the packages named in the
54
-workspaces given here will be opened.
55
+Valid values for the `workspace` config are either:
56
57
+* Workspace names
58
+* Path to a workspace directory
59
+* Path to a parent workspace directory (will result to selecting all of the
60
+ nested workspaces)
61
+
62
+When set for the `npm init` command, this may be set to the folder of a
63
+workspace which does not yet exist, to create the folder and set it up as a
64
+brand new workspace within the project.
65
+
66
+This value is not exported to the environment for child processes.
67
+
68
+#### `workspaces`
69
+
70
+* Default: false
71
+* Type: Boolean
72
+
73
+Enable running a command in the context of **all** the configured
74
+workspaces.
75
+
76
+This value is not exported to the environment for child processes.
77
+
78
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
79
80
### See Also
81
content/cli/v7/commands/npm-restart.md
+26
@@ -44,6 +44,32 @@ If it does _not_ have a `"restart"` script specified, but it does have
44
8. poststart
45
9. postrestart
46
47
+### Configuration
48
+
49
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
50
+<!-- automatically generated, do not edit manually -->
51
+#### `ignore-scripts`
52
+
53
+* Default: false
54
+* Type: Boolean
55
+
56
+If true, npm does not run scripts specified in package.json files.
57
+
58
+Note that commands explicitly intended to run a particular script, such as
59
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
60
+will still run their intended script if `ignore-scripts` is set, but they
61
+will *not* run any pre- or post-scripts.
62
+
63
+#### `script-shell`
64
+
65
+* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
66
+* Type: null or String
67
+
68
+The shell to use for scripts run with the `npm exec`, `npm run` and `npm
69
+init <pkg>` commands.
70
+
71
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
72
+
73
### See Also
74
75
* [npm run-script](/cli/v7/commands/npm-run-script)
content/cli/v7/commands/npm-root.md
+20
@@ -33,6 +33,26 @@ global_node_modules="$(npm root --global)"
33
echo "Global packages installed in: ${global_node_modules}"
34
```
35
36
+### Configuration
37
+
38
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
39
+<!-- automatically generated, do not edit manually -->
40
+#### `global`
41
+
42
+* Default: false
43
+* Type: Boolean
44
+
45
+Operates in "global" mode, so that packages are installed into the `prefix`
46
+folder instead of the current working directory. See
47
+[folders](/cli/v7/configuring-npm/folders) for more on the differences in behavior.
48
+
49
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
50
+ of the current working directory.
51
+* bin files are linked to `{prefix}/bin`
52
+* man pages are linked to `{prefix}/share/man`
53
+
54
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
55
+
56
### See Also
57
58
* [npm prefix](/cli/v7/commands/npm-prefix)
content/cli/v7/commands/npm-run-script.md
+49
-36
@@ -43,7 +43,7 @@ For example:
43
npm run test -- --grep="pattern"
44
```
45
46
-The arguments will only be passed to the script specified after ```npm run```
46
+The arguments will only be passed to the script specified after `npm run`
47
and not to any `pre` or `post` script.
48
49
The `env` script is a special built-in command that can be used to list
@@ -151,60 +151,73 @@ packages.
151
152
### Configuration
153
154
-#### if-present
154
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
155
+<!-- automatically generated, do not edit manually -->
156
+#### `workspace`
157
156
-* Type: Boolean
157
-* Default: false
158
+* Default:
159
+* Type: String (can be set multiple times)
160
159
-You can use the `--if-present` flag to avoid exiting with a non-zero exit code
160
-when the script is undefined. This lets you run potentially undefined scripts
161
-without breaking the execution chain.
161
+Enable running a command in the context of the configured workspaces of the
162
+current project while filtering by running only the workspaces defined by
163
+this configuration option.
164
163
-#### ignore-scripts
165
+Valid values for the `workspace` config are either:
166
165
-* Type: Boolean
166
-* Default: false
167
+* Workspace names
168
+* Path to a workspace directory
169
+* Path to a parent workspace directory (will result to selecting all of the
170
+ nested workspaces)
171
168
-Skips running `pre` and `post` scripts.
172
+When set for the `npm init` command, this may be set to the folder of a
173
+workspace which does not yet exist, to create the folder and set it up as a
174
+brand new workspace within the project.
175
170
-#### script-shell
176
+This value is not exported to the environment for child processes.
177
172
-* Type: String
173
-* Default: `null`
178
+#### `workspaces`
179
175
-Optional custom script to use to execute the command. If not defined defaults
176
-to `/bin/sh` on Unix, defaults to `env.comspec` or `cmd.exe` on Windows.
180
+* Default: false
181
+* Type: Boolean
182
178
-#### silent
183
+Enable running a command in the context of **all** the configured
184
+workspaces.
185
+
186
+This value is not exported to the environment for child processes.
187
+
188
+#### `if-present`
189
180
-* Type: Boolean
190
* Default: false
191
+* Type: Boolean
192
+
193
+If true, npm will not exit with an error code when `run-script` is invoked
194
+for a script that isn't defined in the `scripts` section of `package.json`.
195
+This option can be used when it's desirable to optionally run a script when
196
+it's present and fail if the script fails. This is useful, for example, when
197
+running scripts that may only apply for some builds in an otherwise generic
198
+CI setup.
199
183
-You can use the `--silent` flag to prevent showing `npm ERR!` output on error.
200
+#### `ignore-scripts`
201
185
-#### workspace
202
+* Default: false
203
+* Type: Boolean
204
187
-* Alias: `-w`
188
-* Type: Array
189
-* Default: `[]`
205
+If true, npm does not run scripts specified in package.json files.
206
191
-Enable running scripts in the context of workspaces while also filtering by
192
-the provided names or paths provided.
207
+Note that commands explicitly intended to run a particular script, such as
208
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
209
+will still run their intended script if `ignore-scripts` is set, but they
210
+will *not* run any pre- or post-scripts.
211
194
-Valid values for the `workspace` config are either:
195
-- Workspace names
196
-- Path to a workspace directory
197
-- Path to a parent workspace directory (will result to selecting all of the
198
-children workspaces)
212
+#### `script-shell`
213
200
-#### workspaces
214
+* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
215
+* Type: null or String
216
202
-* Alias: `--ws`
203
-* Type: Boolean
204
-* Default: `false`
217
+The shell to use for scripts run with the `npm exec`, `npm run` and `npm
218
+init <pkg>` commands.
219
206
-Run scripts in the context of all configured workspaces for the current
207
-project.
220
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
221
222
### See Also
223
content/cli/v7/commands/npm-search.md
+48
-45
@@ -49,91 +49,94 @@ expression characters in most shells.)
49
50
### Configuration
51
52
-All of the following can be defined in a `.npmrc` file, or passed as
53
-parameters to the cli prefixed with `--` (e.g. `--json`)
52
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
53
+<!-- automatically generated, do not edit manually -->
54
+#### `long`
55
55
-#### description
56
-
57
-* Default: true
56
+* Default: false
57
* Type: Boolean
58
60
-#### color
61
-
62
- * Default: true
63
- * Type: Boolean
64
-
65
-Used as `--no-color`, disables color highlighting of matches in the
66
-results.
59
+Show extended information in `ls`, `search`, and `help-search`.
60
68
-#### json
61
+#### `json`
62
63
* Default: false
64
* Type: Boolean
65
73
-Output search results as a JSON array.
66
+Whether or not to output JSON data, rather than the normal output.
67
75
-#### parseable
68
+Not supported by all npm commands.
69
+
70
+#### `color`
71
+
72
+* Default: true unless the NO_COLOR environ is set to something other than '0'
73
+* Type: "always" or Boolean
74
+
75
+If false, never shows colors. If `"always"` then always shows colors. If
76
+true, then only prints color codes for tty file descriptors.
77
+
78
+#### `parseable`
79
80
* Default: false
81
* Type: Boolean
82
80
-Output search results as lines with tab-separated columns.
83
+Output parseable results from commands that write to standard output. For
84
+`npm search`, this will be tab-separated table format.
85
82
-#### long
86
+#### `description`
87
84
-* Default: false
88
+* Default: true
89
* Type: Boolean
90
87
-Display full package descriptions and other long text across multiple
88
-lines. When disabled (which is the default) the output will
89
-truncate search results to fit neatly on a single line. Modules with
90
-extremely long names will fall on multiple lines.
91
+Show the description in `npm search`
92
92
-#### searchopts
93
+#### `searchopts`
94
95
* Default: ""
96
* Type: String
97
98
Space-separated options that are always passed to search.
99
99
-#### searchexclude
100
+#### `searchexclude`
101
102
* Default: ""
103
* Type: String
104
105
Space-separated options that limit the results from search.
106
106
-#### registry
107
+#### `registry`
108
108
- * Default: https://registry.npmjs.org/
109
- * Type: url
109
+* Default: "https://registry.npmjs.org/"
110
+* Type: URL
111
111
-Search the specified registry for modules. If you have configured npm to
112
-point to a different default registry (such as your internal private
113
-module repository), `npm search` will also default to that registry when
114
-searching.
112
+The base URL of the npm registry.
113
116
-### A note on caching
114
+#### `prefer-online`
115
118
-The npm cli caches search results with the same terms and options
119
-locally in its cache. You can use the following to change how and when
120
-the cli uses this cache. See [`npm cache`](/cli/v7/commands/npm-cache) for more
121
-on how the cache works.
116
+* Default: false
117
+* Type: Boolean
118
123
-#### prefer-online
119
+If true, staleness checks for cached data will be forced, making the CLI
120
+look for updates immediately even for fresh package data.
121
125
-Forces staleness checks for cached searches, making the cli look for
126
-updates immediately even for fresh search results.
122
+#### `prefer-offline`
123
128
-#### prefer-offline
124
+* Default: false
125
+* Type: Boolean
126
130
-Bypasses staleness checks for cached searches. Missing data will still
131
-be requested from the server. To force full offline mode, use `offline`.
127
+If true, staleness checks for cached data will be bypassed, but missing data
128
+will be requested from the server. To force full offline mode, use
129
+`--offline`.
130
+
131
+#### `offline`
132
+
133
+* Default: false
134
+* Type: Boolean
135
133
-#### offline
136
+Force offline mode: no network requests will be done during install. To
137
+allow the CLI to fill in missing cache data, see `--prefer-offline`.
138
135
-Forces full offline mode. Any searches not locally cached will result in
136
-an error.
139
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
140
141
### See Also
142
content/cli/v7/commands/npm-set-script.md
+31
-6
@@ -38,16 +38,41 @@ npm set-script [<script>] [<command>]
38
39
### Configuration
40
41
-#### workspaces
41
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
42
+<!-- automatically generated, do not edit manually -->
43
+#### `workspace`
44
43
-Enables workspaces context. Tasks will be created in the `scripts` section
44
-of the `package.json` of each workspace.
45
+* Default:
46
+* Type: String (can be set multiple times)
47
46
-#### workspace
48
+Enable running a command in the context of the configured workspaces of the
49
+current project while filtering by running only the workspaces defined by
50
+this configuration option.
51
48
-Enables workspaces context and limits creating a task to the
49
-`package.json` files of the workspaces given.
52
+Valid values for the `workspace` config are either:
53
54
+* Workspace names
55
+* Path to a workspace directory
56
+* Path to a parent workspace directory (will result to selecting all of the
57
+ nested workspaces)
58
+
59
+When set for the `npm init` command, this may be set to the folder of a
60
+workspace which does not yet exist, to create the folder and set it up as a
61
+brand new workspace within the project.
62
+
63
+This value is not exported to the environment for child processes.
64
+
65
+#### `workspaces`
66
+
67
+* Default: false
68
+* Type: Boolean
69
+
70
+Enable running a command in the context of **all** the configured
71
+workspaces.
72
+
73
+This value is not exported to the environment for child processes.
74
+
75
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
76
77
### See Also
78
content/cli/v7/commands/npm-star.md
+22
@@ -43,6 +43,28 @@ You can also "unstar" a package using [`npm unstar`](/cli/v7/commands/npm-unstar
43
44
You can see all your starred packages using [`npm stars`](/cli/v7/commands/npm-stars)
45
46
+### Configuration
47
+
48
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
49
+<!-- automatically generated, do not edit manually -->
50
+#### `registry`
51
+
52
+* Default: "https://registry.npmjs.org/"
53
+* Type: URL
54
+
55
+The base URL of the npm registry.
56
+
57
+#### `unicode`
58
+
59
+* Default: false on windows, true on mac/unix systems with a unicode locale,
60
+ as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables.
61
+* Type: Boolean
62
+
63
+When set to true, npm uses unicode characters in the tree output. When
64
+false, it uses ascii characters instead of unicode glyphs.
65
+
66
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
67
+
68
### See Also
69
70
* [npm unstar](/cli/v7/commands/npm-unstar)
content/cli/v7/commands/npm-stars.md
+13
@@ -29,6 +29,19 @@ quickly this command lets you do just that.
29
You may also want to see your friend's favorite packages, in this case
30
you will most certainly enjoy this command.
31
32
+### Configuration
33
+
34
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
35
+<!-- automatically generated, do not edit manually -->
36
+#### `registry`
37
+
38
+* Default: "https://registry.npmjs.org/"
39
+* Type: URL
40
+
41
+The base URL of the npm registry.
42
+
43
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
44
+
45
### See Also
46
47
* [npm star](/cli/v7/commands/npm-star)
content/cli/v7/commands/npm-start.md
+26
@@ -55,6 +55,32 @@ npm start
55
56
```
57
58
+### Configuration
59
+
60
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
61
+<!-- automatically generated, do not edit manually -->
62
+#### `ignore-scripts`
63
+
64
+* Default: false
65
+* Type: Boolean
66
+
67
+If true, npm does not run scripts specified in package.json files.
68
+
69
+Note that commands explicitly intended to run a particular script, such as
70
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
71
+will still run their intended script if `ignore-scripts` is set, but they
72
+will *not* run any pre- or post-scripts.
73
+
74
+#### `script-shell`
75
+
76
+* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
77
+* Type: null or String
78
+
79
+The shell to use for scripts run with the `npm exec`, `npm run` and `npm
80
+init <pkg>` commands.
81
+
82
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
83
+
84
### See Also
85
86
* [npm run-script](/cli/v7/commands/npm-run-script)
content/cli/v7/commands/npm-stop.md
+26
@@ -48,6 +48,32 @@ npm stop
48
49
```
50
51
+### Configuration
52
+
53
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
54
+<!-- automatically generated, do not edit manually -->
55
+#### `ignore-scripts`
56
+
57
+* Default: false
58
+* Type: Boolean
59
+
60
+If true, npm does not run scripts specified in package.json files.
61
+
62
+Note that commands explicitly intended to run a particular script, such as
63
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
64
+will still run their intended script if `ignore-scripts` is set, but they
65
+will *not* run any pre- or post-scripts.
66
+
67
+#### `script-shell`
68
+
69
+* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
70
+* Type: null or String
71
+
72
+The shell to use for scripts run with the `npm exec`, `npm run` and `npm
73
+init <pkg>` commands.
74
+
75
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
76
+
77
### See Also
78
79
* [npm run-script](/cli/v7/commands/npm-run-script)
content/cli/v7/commands/npm-team.md
+41
@@ -111,6 +111,47 @@ is done through the website, not the npm CLI.
111
To use teams to manage permissions on packages belonging to your organization,
112
use the `npm access` command to grant or revoke the appropriate permissions.
113
114
+### Configuration
115
+
116
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
117
+<!-- automatically generated, do not edit manually -->
118
+#### `registry`
119
+
120
+* Default: "https://registry.npmjs.org/"
121
+* Type: URL
122
+
123
+The base URL of the npm registry.
124
+
125
+#### `otp`
126
+
127
+* Default: null
128
+* Type: null or String
129
+
130
+This is a one-time password from a two-factor authenticator. It's needed
131
+when publishing or changing package permissions with `npm access`.
132
+
133
+If not set, and a registry response fails with a challenge for a one-time
134
+password, npm will prompt on the command line for one.
135
+
136
+#### `parseable`
137
+
138
+* Default: false
139
+* Type: Boolean
140
+
141
+Output parseable results from commands that write to standard output. For
142
+`npm search`, this will be tab-separated table format.
143
+
144
+#### `json`
145
+
146
+* Default: false
147
+* Type: Boolean
148
+
149
+Whether or not to output JSON data, rather than the normal output.
150
+
151
+Not supported by all npm commands.
152
+
153
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
154
+
155
### See Also
156
157
* [npm access](/cli/v7/commands/npm-access)
content/cli/v7/commands/npm-test.md
+24
@@ -45,7 +45,31 @@ npm test
45
(test.js output would be here)
46
```
47
48
+### Configuration
49
50
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
51
+<!-- automatically generated, do not edit manually -->
52
+#### `ignore-scripts`
53
+
54
+* Default: false
55
+* Type: Boolean
56
+
57
+If true, npm does not run scripts specified in package.json files.
58
+
59
+Note that commands explicitly intended to run a particular script, such as
60
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
61
+will still run their intended script if `ignore-scripts` is set, but they
62
+will *not* run any pre- or post-scripts.
63
+
64
+#### `script-shell`
65
+
66
+* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
67
+* Type: null or String
68
+
69
+The shell to use for scripts run with the `npm exec`, `npm run` and `npm
70
+init <pkg>` commands.
71
+
72
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
73
74
### See Also
75
content/cli/v7/commands/npm-token.md
+50
@@ -83,3 +83,53 @@ This lets you list, create and revoke authentication tokens.
83
found in your `.npmrc`), and ids as seen in the parseable or json
84
output of `npm token list`. This will NOT accept the truncated token
85
found in the normal `npm token list` output.
86
+
87
+### Configuration
88
+
89
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
90
+<!-- automatically generated, do not edit manually -->
91
+#### `read-only`
92
+
93
+* Default: false
94
+* Type: Boolean
95
+
96
+This is used to mark a token as unable to publish when configuring limited
97
+access tokens with the `npm token create` command.
98
+
99
+#### `cidr`
100
+
101
+* Default: null
102
+* Type: null or String (can be set multiple times)
103
+
104
+This is a list of CIDR address to be used when configuring limited access
105
+tokens with the `npm token create` command.
106
+
107
+#### `registry`
108
+
109
+* Default: "https://registry.npmjs.org/"
110
+* Type: URL
111
+
112
+The base URL of the npm registry.
113
+
114
+#### `otp`
115
+
116
+* Default: null
117
+* Type: null or String
118
+
119
+This is a one-time password from a two-factor authenticator. It's needed
120
+when publishing or changing package permissions with `npm access`.
121
+
122
+If not set, and a registry response fails with a challenge for a one-time
123
+password, npm will prompt on the command line for one.
124
+
125
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
126
+
127
+### See Also
128
+
129
+* [npm adduser](/cli/v7/commands/npm-adduser)
130
+* [npm registry](/cli/v7/using-npm/registry)
131
+* [npm config](/cli/v7/commands/npm-config)
132
+* [npmrc](/cli/v7/configuring-npm/npmrc)
133
+* [npm owner](/cli/v7/commands/npm-owner)
134
+* [npm whoami](/cli/v7/commands/npm-whoami)
135
+* [npm profile](/cli/v7/commands/npm-profile)
content/cli/v7/commands/npm-uninstall.md
+48
@@ -64,6 +64,54 @@ npm uninstall lodash --no-save
64
`lodash` will not be removed from your `package.json`,
65
`npm-shrinkwrap.json`, or `package-lock.json` files.
66
67
+### Configuration
68
+
69
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
70
+<!-- automatically generated, do not edit manually -->
71
+#### `save`
72
+
73
+* Default: true
74
+* Type: Boolean
75
+
76
+Save installed packages to a package.json file as dependencies.
77
+
78
+When used with the `npm rm` command, removes the dependency from
79
+package.json.
80
+
81
+#### `workspace`
82
+
83
+* Default:
84
+* Type: String (can be set multiple times)
85
+
86
+Enable running a command in the context of the configured workspaces of the
87
+current project while filtering by running only the workspaces defined by
88
+this configuration option.
89
+
90
+Valid values for the `workspace` config are either:
91
+
92
+* Workspace names
93
+* Path to a workspace directory
94
+* Path to a parent workspace directory (will result to selecting all of the
95
+ nested workspaces)
96
+
97
+When set for the `npm init` command, this may be set to the folder of a
98
+workspace which does not yet exist, to create the folder and set it up as a
99
+brand new workspace within the project.
100
+
101
+This value is not exported to the environment for child processes.
102
+
103
+#### `workspaces`
104
+
105
+* Default: false
106
+* Type: Boolean
107
+
108
+Enable running a command in the context of **all** the configured
109
+workspaces.
110
+
111
+This value is not exported to the environment for child processes.
112
+
113
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
114
+
115
### See Also
116
117
* [npm prune](/cli/v7/commands/npm-prune)
content/cli/v7/commands/npm-unpublish.md
+75
@@ -55,6 +55,81 @@ you must use a new version number. If you unpublish the entire package,
55
you may not publish any new versions of that package until 24 hours have
56
passed.
57
58
+### Configuration
59
+
60
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
61
+<!-- automatically generated, do not edit manually -->
62
+#### `dry-run`
63
+
64
+* Default: false
65
+* Type: Boolean
66
+
67
+Indicates that you don't want npm to make any changes and that it should
68
+only report what it would have done. This can be passed into any of the
69
+commands that modify your local installation, eg, `install`, `update`,
70
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
71
+
72
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
73
+`owner`, etc.
74
+
75
+#### `force`
76
+
77
+* Default: false
78
+* Type: Boolean
79
+
80
+Removes various protections against unfortunate side effects, common
81
+mistakes, unnecessary performance degradation, and malicious input.
82
+
83
+* Allow clobbering non-npm files in global installs.
84
+* Allow the `npm version` command to work on an unclean git repository.
85
+* Allow deleting the cache folder with `npm cache clean`.
86
+* Allow installing packages that have an `engines` declaration requiring a
87
+ different version of npm.
88
+* Allow installing packages that have an `engines` declaration requiring a
89
+ different version of `node`, even if `--engine-strict` is enabled.
90
+* Allow `npm audit fix` to install modules outside your stated dependency
91
+ range (including SemVer-major changes).
92
+* Allow unpublishing all versions of a published package.
93
+* Allow conflicting peerDependencies to be installed in the root project.
94
+* Implicitly set `--yes` during `npm init`.
95
+
96
+If you don't have a clear idea of what you want to do, it is strongly
97
+recommended that you do not use this option!
98
+
99
+#### `workspace`
100
+
101
+* Default:
102
+* Type: String (can be set multiple times)
103
+
104
+Enable running a command in the context of the configured workspaces of the
105
+current project while filtering by running only the workspaces defined by
106
+this configuration option.
107
+
108
+Valid values for the `workspace` config are either:
109
+
110
+* Workspace names
111
+* Path to a workspace directory
112
+* Path to a parent workspace directory (will result to selecting all of the
113
+ nested workspaces)
114
+
115
+When set for the `npm init` command, this may be set to the folder of a
116
+workspace which does not yet exist, to create the folder and set it up as a
117
+brand new workspace within the project.
118
+
119
+This value is not exported to the environment for child processes.
120
+
121
+#### `workspaces`
122
+
123
+* Default: false
124
+* Type: Boolean
125
+
126
+Enable running a command in the context of **all** the configured
127
+workspaces.
128
+
129
+This value is not exported to the environment for child processes.
130
+
131
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
132
+
133
### See Also
134
135
* [npm deprecate](/cli/v7/commands/npm-deprecate)
content/cli/v7/commands/npm-unstar.md
+33
@@ -39,6 +39,39 @@ You can "star" a package using [`npm star`](/cli/v7/commands/npm-star)
39
40
You can see all your starred packages using [`npm stars`](/cli/v7/commands/npm-stars)
41
42
+### Configuration
43
+
44
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
45
+<!-- automatically generated, do not edit manually -->
46
+#### `registry`
47
+
48
+* Default: "https://registry.npmjs.org/"
49
+* Type: URL
50
+
51
+The base URL of the npm registry.
52
+
53
+#### `unicode`
54
+
55
+* Default: false on windows, true on mac/unix systems with a unicode locale,
56
+ as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables.
57
+* Type: Boolean
58
+
59
+When set to true, npm uses unicode characters in the tree output. When
60
+false, it uses ascii characters instead of unicode glyphs.
61
+
62
+#### `otp`
63
+
64
+* Default: null
65
+* Type: null or String
66
+
67
+This is a one-time password from a two-factor authenticator. It's needed
68
+when publishing or changing package permissions with `npm access`.
69
+
70
+If not set, and a registry response fails with a challenge for a one-time
71
+password, npm will prompt on the command line for one.
72
+
73
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
74
+
75
### See Also
76
77
* [npm star](/cli/v7/commands/npm-star)
content/cli/v7/commands/npm-update.md
+178
-3
@@ -27,9 +27,7 @@ aliases: up, upgrade
27
This command will update all the packages listed to the latest version
28
(specified by the `tag` config), respecting semver.
29
30
-It will also install missing packages. As with all commands that install
31
-packages, the `--dev` flag will cause `devDependencies` to be processed
32
-as well.
30
+It will also install missing packages.
31
32
If the `-g` flag is specified, this command will update globally installed
33
packages.
@@ -126,6 +124,183 @@ need to run `npm install -g [<pkg>...]`
124
NOTE: If a package has been upgraded to a version newer than `latest`, it will
125
be _downgraded_.
126
127
+### Configuration
128
+
129
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
130
+<!-- automatically generated, do not edit manually -->
131
+#### `global`
132
+
133
+* Default: false
134
+* Type: Boolean
135
+
136
+Operates in "global" mode, so that packages are installed into the `prefix`
137
+folder instead of the current working directory. See
138
+[folders](/cli/v7/configuring-npm/folders) for more on the differences in behavior.
139
+
140
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
141
+ of the current working directory.
142
+* bin files are linked to `{prefix}/bin`
143
+* man pages are linked to `{prefix}/share/man`
144
+
145
+#### `global-style`
146
+
147
+* Default: false
148
+* Type: Boolean
149
+
150
+Causes npm to install the package into your local `node_modules` folder with
151
+the same layout it uses with the global `node_modules` folder. Only your
152
+direct dependencies will show in `node_modules` and everything they depend
153
+on will be flattened in their `node_modules` folders. This obviously will
154
+eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling`
155
+will be preferred.
156
+
157
+#### `legacy-bundling`
158
+
159
+* Default: false
160
+* Type: Boolean
161
+
162
+Causes npm to install the package such that versions of npm prior to 1.4,
163
+such as the one included with node 0.8, can install the package. This
164
+eliminates all automatic deduping. If used with `global-style` this option
165
+will be preferred.
166
+
167
+#### `strict-peer-deps`
168
+
169
+* Default: false
170
+* Type: Boolean
171
+
172
+If set to `true`, and `--legacy-peer-deps` is not set, then _any_
173
+conflicting `peerDependencies` will be treated as an install failure, even
174
+if npm could reasonably guess the appropriate resolution based on non-peer
175
+dependency relationships.
176
+
177
+By default, conflicting `peerDependencies` deep in the dependency graph will
178
+be resolved using the nearest non-peer dependency specification, even if
179
+doing so will result in some packages receiving a peer dependency outside
180
+the range set in their package's `peerDependencies` object.
181
+
182
+When such and override is performed, a warning is printed, explaining the
183
+conflict and the packages involved. If `--strict-peer-deps` is set, then
184
+this warning is treated as a failure.
185
+
186
+#### `package-lock`
187
+
188
+* Default: true
189
+* Type: Boolean
190
+
191
+If set to false, then ignore `package-lock.json` files when installing. This
192
+will also prevent _writing_ `package-lock.json` if `save` is true.
193
+
194
+When package package-locks are disabled, automatic pruning of extraneous
195
+modules will also be disabled. To remove extraneous modules with
196
+package-locks disabled use `npm prune`.
197
+
198
+#### `omit`
199
+
200
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
201
+ 'production', otherwise empty.
202
+* Type: "dev", "optional", or "peer" (can be set multiple times)
203
+
204
+Dependency types to omit from the installation tree on disk.
205
+
206
+Note that these dependencies _are_ still resolved and added to the
207
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
208
+physically installed on disk.
209
+
210
+If a package type appears in both the `--include` and `--omit` lists, then
211
+it will be included.
212
+
213
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
214
+variable will be set to `'production'` for all lifecycle scripts.
215
+
216
+#### `ignore-scripts`
217
+
218
+* Default: false
219
+* Type: Boolean
220
+
221
+If true, npm does not run scripts specified in package.json files.
222
+
223
+Note that commands explicitly intended to run a particular script, such as
224
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
225
+will still run their intended script if `ignore-scripts` is set, but they
226
+will *not* run any pre- or post-scripts.
227
+
228
+#### `audit`
229
+
230
+* Default: true
231
+* Type: Boolean
232
+
233
+When "true" submit audit reports alongside `npm install` runs to the default
234
+registry and all registries configured for scopes. See the documentation for
235
+[`npm audit`](/cli/v7/commands/npm-audit) for details on what is submitted.
236
+
237
+#### `bin-links`
238
+
239
+* Default: true
240
+* Type: Boolean
241
+
242
+Tells npm to create symlinks (or `.cmd` shims on Windows) for package
243
+executables.
244
+
245
+Set to false to have it not do this. This can be used to work around the
246
+fact that some file systems don't support symlinks, even on ostensibly Unix
247
+systems.
248
+
249
+#### `fund`
250
+
251
+* Default: true
252
+* Type: Boolean
253
+
254
+When "true" displays the message at the end of each `npm install`
255
+acknowledging the number of dependencies looking for funding. See [`npm
256
+fund`](/cli/v7/commands/npm-fund) for details.
257
+
258
+#### `dry-run`
259
+
260
+* Default: false
261
+* Type: Boolean
262
+
263
+Indicates that you don't want npm to make any changes and that it should
264
+only report what it would have done. This can be passed into any of the
265
+commands that modify your local installation, eg, `install`, `update`,
266
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
267
+
268
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
269
+`owner`, etc.
270
+
271
+#### `workspace`
272
+
273
+* Default:
274
+* Type: String (can be set multiple times)
275
+
276
+Enable running a command in the context of the configured workspaces of the
277
+current project while filtering by running only the workspaces defined by
278
+this configuration option.
279
+
280
+Valid values for the `workspace` config are either:
281
+
282
+* Workspace names
283
+* Path to a workspace directory
284
+* Path to a parent workspace directory (will result to selecting all of the
285
+ nested workspaces)
286
+
287
+When set for the `npm init` command, this may be set to the folder of a
288
+workspace which does not yet exist, to create the folder and set it up as a
289
+brand new workspace within the project.
290
+
291
+This value is not exported to the environment for child processes.
292
+
293
+#### `workspaces`
294
+
295
+* Default: false
296
+* Type: Boolean
297
+
298
+Enable running a command in the context of **all** the configured
299
+workspaces.
300
+
301
+This value is not exported to the environment for child processes.
302
+
303
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
304
305
### See Also
306
content/cli/v7/commands/npm-version.md
+108
-60
@@ -26,83 +26,123 @@ npm version [<newversion> | major | minor | patch | premajor | preminor | prepat
26
27
### Configuration
28
29
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
30
+<!-- automatically generated, do not edit manually -->
31
#### `allow-same-version`
32
31
-* Default: `false`
33
+* Default: false
34
* Type: Boolean
35
36
Prevents throwing an error when `npm version` is used to set the new version
37
to the same value as the current version.
38
39
+#### `commit-hooks`
40
+
41
+* Default: true
42
+* Type: Boolean
43
+
44
+Run git commit hooks when using the `npm version` command.
45
+
46
#### `git-tag-version`
47
39
-* Default: `true`
48
+* Default: true
49
* Type: Boolean
50
42
-Commit and tag the version change.
51
+Tag the commit when using the `npm version` command.
52
44
-#### `commit-hooks`
53
+#### `json`
54
46
-* Default: `true`
55
+* Default: false
56
* Type: Boolean
57
49
-Run git commit hooks when committing the version change.
58
+Whether or not to output JSON data, rather than the normal output.
59
+
60
+Not supported by all npm commands.
61
+
62
+#### `preid`
63
+
64
+* Default: ""
65
+* Type: String
66
+
67
+The "prerelease identifier" to use as a prefix for the "prerelease" part of
68
+a semver. Like the `rc` in `1.2.0-rc.8`.
69
70
#### `sign-git-tag`
71
53
-* Default: `false`
72
+* Default: false
73
* Type: Boolean
74
56
-Pass the `-s` flag to git to sign the tag.
75
+If set to true, then the `npm version` command will tag the version using
76
+`-s` to add a signature.
77
58
-Note that you must have a default GPG key set up in your git config for this to work properly.
78
+Note that git requires you to have set up GPG keys in your git configs for
79
+this to work properly.
80
60
-#### workspaces
81
+#### `workspace`
82
62
-* Default: `false`
63
-* Type: Boolean
83
+* Default:
84
+* Type: String (can be set multiple times)
85
+
86
+Enable running a command in the context of the configured workspaces of the
87
+current project while filtering by running only the workspaces defined by
88
+this configuration option.
89
+
90
+Valid values for the `workspace` config are either:
91
65
-Enables workspaces context and includes workspaces in reported output
66
-when getting versions. When setting a new version *only the workspaces
67
-will be changed*.
92
+* Workspace names
93
+* Path to a workspace directory
94
+* Path to a parent workspace directory (will result to selecting all of the
95
+ nested workspaces)
96
69
-#### workspace
97
+When set for the `npm init` command, this may be set to the folder of a
98
+workspace which does not yet exist, to create the folder and set it up as a
99
+brand new workspace within the project.
100
71
-* Default: []
72
-* Type: Array
101
+This value is not exported to the environment for child processes.
102
74
-Enables workspaces context and limits results to only those specified by
75
-this config item.
103
+#### `workspaces`
104
+
105
+* Default: false
106
+* Type: Boolean
107
+
108
+Enable running a command in the context of **all** the configured
109
+workspaces.
110
+
111
+This value is not exported to the environment for child processes.
112
+
113
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
114
115
### Description
116
79
-Run this in a package directory to bump the version and write the new
80
-data back to `package.json`, `package-lock.json`, and, if present, `npm-shrinkwrap.json`.
117
+Run this in a package directory to bump the version and write the new data
118
+back to `package.json`, `package-lock.json`, and, if present,
119
+`npm-shrinkwrap.json`.
120
82
-The `newversion` argument should be a valid semver string, a
83
-valid second argument to [semver.inc](https://github.com/npm/node-semver#functions) (one of `patch`, `minor`, `major`,
84
-`prepatch`, `preminor`, `premajor`, `prerelease`), or `from-git`. In the second case,
85
-the existing version will be incremented by 1 in the specified field.
86
-`from-git` will try to read the latest git tag, and use that as the new npm version.
121
+The `newversion` argument should be a valid semver string, a valid second
122
+argument to [semver.inc](https://github.com/npm/node-semver#functions) (one
123
+of `patch`, `minor`, `major`, `prepatch`, `preminor`, `premajor`,
124
+`prerelease`), or `from-git`. In the second case, the existing version will
125
+be incremented by 1 in the specified field. `from-git` will try to read
126
+the latest git tag, and use that as the new npm version.
127
88
-If run in a git repo, it will also create a version commit and tag.
89
-This behavior is controlled by `git-tag-version` (see below), and can
90
-be disabled on the command line by running `npm --no-git-tag-version version`.
128
+If run in a git repo, it will also create a version commit and tag. This
129
+behavior is controlled by `git-tag-version` (see below), and can be
130
+disabled on the command line by running `npm --no-git-tag-version version`.
131
It will fail if the working directory is not clean, unless the `-f` or
132
`--force` flag is set.
133
94
-If supplied with `-m` or `--message` config option, npm will
95
-use it as a commit message when creating a version commit. If the
96
-`message` config contains `%s` then that will be replaced with the
97
-resulting version number. For example:
134
+If supplied with `-m` or `--message` config option, npm will use it as a
135
+commit message when creating a version commit. If the `message` config
136
+contains `%s` then that will be replaced with the resulting version number.
137
+For example:
138
139
```bash
140
npm version patch -m "Upgrade to %s for reasons"
141
```
142
103
-If the `sign-git-tag` config is set, then the tag will be signed using
104
-the `-s` flag to git. Note that you must have a default GPG key set up
105
-in your git config for this to work properly. For example:
143
+If the `sign-git-tag` config is set, then the tag will be signed using the
144
+`-s` flag to git. Note that you must have a default GPG key set up in your
145
+git config for this to work properly. For example:
146
147
```bash
148
$ npm config set sign-git-tag true
@@ -115,37 +155,45 @@ user: "isaacs (http://blog.izs.me/) <i@izs.me>"
155
Enter passphrase:
156
```
157
118
-If `preversion`, `version`, or `postversion` are in the `scripts` property of
119
-the package.json, they will be executed as part of running `npm version`.
158
+If `preversion`, `version`, or `postversion` are in the `scripts` property
159
+of the package.json, they will be executed as part of running `npm
160
+version`.
161
162
The exact order of execution is as follows:
122
- 1. Check to make sure the git working directory is clean before we get started.
123
- Your scripts may add files to the commit in future steps.
124
- This step is skipped if the `--force` flag is set.
125
- 2. Run the `preversion` script. These scripts have access to the old `version` in package.json.
126
- A typical use would be running your full test suite before deploying.
127
- Any files you want added to the commit should be explicitly added using `git add`.
128
- 3. Bump `version` in `package.json` as requested (`patch`, `minor`, `major`, etc).
129
- 4. Run the `version` script. These scripts have access to the new `version` in package.json
130
- (so they can incorporate it into file headers in generated files for example).
131
- Again, scripts should explicitly add generated files to the commit using `git add`.
132
- 5. Commit and tag.
133
- 6. Run the `postversion` script. Use it to clean up the file system or automatically push
134
- the commit and/or tag.
163
+
164
+1. Check to make sure the git working directory is clean before we get
165
+ started. Your scripts may add files to the commit in future steps.
166
+ This step is skipped if the `--force` flag is set.
167
+2. Run the `preversion` script. These scripts have access to the old
168
+ `version` in package.json. A typical use would be running your full
169
+ test suite before deploying. Any files you want added to the commit
170
+ should be explicitly added using `git add`.
171
+3. Bump `version` in `package.json` as requested (`patch`, `minor`,
172
+ `major`, etc).
173
+4. Run the `version` script. These scripts have access to the new `version`
174
+ in package.json (so they can incorporate it into file headers in
175
+ generated files for example). Again, scripts should explicitly add
176
+ generated files to the commit using `git add`.
177
+5. Commit and tag.
178
+6. Run the `postversion` script. Use it to clean up the file system or
179
+ automatically push the commit and/or tag.
180
181
Take the following example:
182
183
```json
139
- "scripts": {
140
- "preversion": "npm test",
141
- "version": "npm run build && git add -A dist",
142
- "postversion": "git push && git push --tags && rm -rf build/temp"
143
- }
184
+{
185
+ "scripts": {
186
+ "preversion": "npm test",
187
+ "version": "npm run build && git add -A dist",
188
+ "postversion": "git push && git push --tags && rm -rf build/temp"
189
+ }
190
+}
191
```
192
146
-This runs all your tests and proceeds only if they pass. Then runs your `build` script, and
147
-adds everything in the `dist` directory to the commit. After the commit, it pushes the new commit
148
-and tag up to the server, and deletes the `build/temp` directory.
193
+This runs all your tests and proceeds only if they pass. Then runs your
194
+`build` script, and adds everything in the `dist` directory to the commit.
195
+After the commit, it pushes the new commit and tag up to the server, and
196
+deletes the `build/temp` directory.
197
198
### See Also
199
content/cli/v7/commands/npm-view.md
+38
-10
@@ -106,22 +106,50 @@ npm view connect versions
106
107
### Configuration
108
109
-#### json
109
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
110
+<!-- automatically generated, do not edit manually -->
111
+#### `json`
112
111
-Show information in JSON format. See [`Output`](#output) below.
113
+* Default: false
114
+* Type: Boolean
115
113
-#### workspaces
116
+Whether or not to output JSON data, rather than the normal output.
117
115
-Enables workspaces context while searching the `package.json` in the
116
-current folder. Information about packages named in each workspace will
117
-be viewed.
118
+Not supported by all npm commands.
119
119
-#### workspace
120
+#### `workspace`
121
121
-Enables workspaces context and limits results to only those specified by
122
-this config item. Only the information about packages named in the
123
-workspaces given here will be viewed.
122
+* Default:
123
+* Type: String (can be set multiple times)
124
125
+Enable running a command in the context of the configured workspaces of the
126
+current project while filtering by running only the workspaces defined by
127
+this configuration option.
128
+
129
+Valid values for the `workspace` config are either:
130
+
131
+* Workspace names
132
+* Path to a workspace directory
133
+* Path to a parent workspace directory (will result to selecting all of the
134
+ nested workspaces)
135
+
136
+When set for the `npm init` command, this may be set to the folder of a
137
+workspace which does not yet exist, to create the folder and set it up as a
138
+brand new workspace within the project.
139
+
140
+This value is not exported to the environment for child processes.
141
+
142
+#### `workspaces`
143
+
144
+* Default: false
145
+* Type: Boolean
146
+
147
+Enable running a command in the context of **all** the configured
148
+workspaces.
149
+
150
+This value is not exported to the environment for child processes.
151
+
152
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
153
154
### Output
155
content/cli/v7/commands/npm-whoami.md
+21
-1
@@ -24,7 +24,27 @@ Note: This command is unaware of workspaces.
24
25
### Description
26
27
-Print the `username` config to standard output.
27
+Display the npm username of the currently logged-in user.
28
+
29
+If logged into a registry that provides token-based authentication, then
30
+connect to the `/-/whoami` registry endpoint to find the username
31
+associated with the token, and print to standard output.
32
+
33
+If logged into a registry that uses Basic Auth, then simply print the
34
+`username` portion of the authentication string.
35
+
36
+### Configuration
37
+
38
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
39
+<!-- automatically generated, do not edit manually -->
40
+#### `registry`
41
+
42
+* Default: "https://registry.npmjs.org/"
43
+* Type: URL
44
+
45
+The base URL of the npm registry.
46
+
47
+<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
48
49
### See Also
50
content/cli/v7/using-npm/config.md
+41
-13
@@ -502,6 +502,7 @@ mistakes, unnecessary performance degradation, and malicious input.
502
range (including SemVer-major changes).
503
* Allow unpublishing all versions of a published package.
504
* Allow conflicting peerDependencies to be installed in the root project.
505
+* Implicitly set `--yes` during `npm init`.
506
507
If you don't have a clear idea of what you want to do, it is strongly
508
recommended that you do not use this option!
@@ -620,6 +621,11 @@ CI setup.
621
622
If true, npm does not run scripts specified in package.json files.
623
624
+Note that commands explicitly intended to run a particular script, such as
625
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
626
+will still run their intended script if `ignore-scripts` is set, but they
627
+will *not* run any pre- or post-scripts.
628
+
629
#### `include`
630
631
* Default:
@@ -696,10 +702,7 @@ number, if not already set in package.json.
702
703
Whether or not to output JSON data, rather than the normal output.
704
699
-This feature is currently experimental, and the output data structures for
700
-many commands is either not implemented in JSON yet, or subject to change.
701
-Only the output from `npm ls --json` and `npm search --json` are currently
702
-valid.
705
+Not supported by all npm commands.
706
707
#### `key`
708
@@ -759,6 +762,8 @@ two conditions are met:
762
* the globally installed version is identical to the version that is being
763
installed locally.
764
765
+When used with `npm ls`, only show packages that are linked.
766
+
767
#### `local-address`
768
769
* Default: null
@@ -791,7 +796,7 @@ The maximum number of log files to store.
796
* Default: false
797
* Type: Boolean
798
794
-Show extended information in `npm ls` and `npm search`.
799
+Show extended information in `ls`, `search`, and `help-search`.
800
801
#### `maxsockets`
802
@@ -852,8 +857,8 @@ allow the CLI to fill in missing cache data, see `--prefer-offline`.
857
858
#### `omit`
859
855
-* Default: 'dev' if the NODE_ENV environment variable is set to 'production',
856
- otherwise empty.
860
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
861
+ 'production', otherwise empty.
862
* Type: "dev", "optional", or "peer" (can be set multiple times)
863
864
Dependency types to omit from the installation tree on disk.
@@ -1072,16 +1077,29 @@ or `--save-optional` are true.
1077
1078
Associate an operation with a scope for a scoped registry.
1079
1075
-Useful when logging in to a private registry for the first time:
1080
+Useful when logging in to or out of a private registry:
1081
1077
-```bash
1082
+```
1083
+# log in, linking the scope to the custom registry
1084
npm login --scope=@mycorp --registry=https://registry.mycorp.com
1085
+
1086
+# log out, removing the link and the auth token
1087
+npm logout --scope=@mycorp
1088
```
1089
1090
This will cause `@mycorp` to be mapped to the registry for future
1091
installation of packages specified according to the pattern
1092
`@mycorp/package`.
1093
1094
+This will also cause `npm init` to create a scoped package.
1095
+
1096
+```
1097
+# accept all defaults, and create a package named "@foo/whatever",
1098
+# instead of just named "whatever"
1099
+npm init --scope=@foo --yes
1100
+```
1101
+
1102
+
1103
#### `script-shell`
1104
1105
* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
@@ -1190,6 +1208,9 @@ then it will install the specified tag.
1208
Also the tag that is added to the package@version specified by the `npm tag`
1209
command, if no explicit tag is given.
1210
1211
+When used by the `npm diff` command, this is the tag used to fetch the
1212
+tarball that will be compared with the local files by default.
1213
+
1214
#### `tag-version-prefix`
1215
1216
* Default: "v"
@@ -1238,7 +1259,7 @@ other files are created with a mode of 0o644.
1259
#### `unicode`
1260
1261
* Default: false on windows, true on mac/unix systems with a unicode locale,
1241
- as defined by the LC_ALL, LC_CTYPE, or LANG environment variables.
1262
+ as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables.
1263
* Type: Boolean
1264
1265
When set to true, npm uses unicode characters in the tree output. When
@@ -1333,9 +1354,16 @@ Enable running a command in the context of the configured workspaces of the
1354
current project while filtering by running only the workspaces defined by
1355
this configuration option.
1356
1336
-Valid values for the `workspace` config are either: - Workspace names - Path
1337
-to a workspace directory - Path to a parent workspace directory (will result
1338
-to selecting all of the nested workspaces)
1357
+Valid values for the `workspace` config are either:
1358
+
1359
+* Workspace names
1360
+* Path to a workspace directory
1361
+* Path to a parent workspace directory (will result to selecting all of the
1362
+ nested workspaces)
1363
+
1364
+When set for the `npm init` command, this may be set to the folder of a
1365
+workspace which does not yet exist, to create the folder and set it up as a
1366
+brand new workspace within the project.
1367
1368
This value is not exported to the environment for child processes.
1369