CLI documentation update from CI
npm CLI robot committed
Aug 31, 2023 at 20:49 UTC
f719537a67b9b06bfc6df49631a8c2b263abae16
88 files changed
+18757
content/cli/v10/commands/index.mdx
new
+17
@@ -0,0 +1,17 @@
1
+---
2
+title: CLI Commands
3
+shortName: Commands
4
+github_repo: npm/cli
5
+github_branch: latest
6
+github_path: docs/lib/content/nav.yml
7
+redirect_from:
8
+ - /cli-documentation/v10/cli-commands
9
+ - /cli-documentation/v10/cli-commands/index
10
+ - /cli-documentation/v10/commands
11
+ - /cli-documentation/v10/commands/index
12
+ - /cli/v10/cli-commands
13
+ - /cli/v10/cli-commands/index
14
+ - /cli/v10/commands/index
15
+---
16
+
17
+<Index depth="1" />
content/cli/v10/commands/npm-access.md
new
+138
@@ -0,0 +1,138 @@
1
+---
2
+title: npm-access
3
+section: 1
4
+description: Set access level on published packages
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-access.md
8
+redirect_from:
9
+ - /cli-documentation/v10/access
10
+ - /cli-documentation/v10/cli-commands/access
11
+ - /cli-documentation/v10/cli-commands/npm-access
12
+ - /cli-documentation/v10/commands/access
13
+ - /cli-documentation/v10/commands/npm-access
14
+ - /cli-documentation/v10/npm-access
15
+ - /cli/v10/access
16
+ - /cli/v10/cli-commands/access
17
+ - /cli/v10/cli-commands/npm-access
18
+ - /cli/v10/commands/access
19
+ - /cli/v10/npm-access
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm access list packages [<user>|<scope>|<scope:team> [<package>]
26
+npm access list collaborators [<package> [<user>]]
27
+npm access get status [<package>]
28
+npm access set status=public|private [<package>]
29
+npm access set mfa=none|publish|automation [<package>]
30
+npm access grant <read-only|read-write> <scope:team> [<package>]
31
+npm access revoke <scope:team> [<package>]
32
+```
33
+
34
+Note: This command is unaware of workspaces.
35
+
36
+### Description
37
+
38
+Used to set access controls on private packages.
39
+
40
+For all of the subcommands, `npm access` will perform actions on the packages
41
+in the current working directory if no package name is passed to the
42
+subcommand.
43
+
44
+* public / restricted (deprecated):
45
+ Set a package to be either publicly accessible or restricted.
46
+
47
+* grant / revoke (deprecated):
48
+ Add or remove the ability of users and teams to have read-only or read-write
49
+ access to a package.
50
+
51
+* 2fa-required / 2fa-not-required (deprecated):
52
+ Configure whether a package requires that anyone publishing it have two-factor
53
+ authentication enabled on their account.
54
+
55
+* ls-packages (deprecated):
56
+ Show all of the packages a user or a team is able to access, along with the
57
+ access level, except for read-only public packages (it won't print the whole
58
+ registry listing)
59
+
60
+* ls-collaborators (deprecated):
61
+ Show all of the access privileges for a package. Will only show permissions
62
+ for packages to which you have at least read access. If `<user>` is passed in,
63
+ the list is filtered only to teams _that_ user happens to belong to.
64
+
65
+* edit (not implemented)
66
+
67
+### Details
68
+
69
+`npm access` always operates directly on the current registry, configurable
70
+from the command line using `--registry=<registry url>`.
71
+
72
+Unscoped packages are *always public*.
73
+
74
+Scoped packages *default to restricted*, but you can either publish them as
75
+public using `npm publish --access=public`, or set their access as public using
76
+`npm access public` after the initial publish.
77
+
78
+You must have privileges to set the access of a package:
79
+
80
+* You are an owner of an unscoped or scoped package.
81
+* You are a member of the team that owns a scope.
82
+* You have been given read-write privileges for a package, either as a member
83
+ of a team or directly as an owner.
84
+
85
+If you have two-factor authentication enabled then you'll be prompted to provide a second factor, or may use the `--otp=...` option to specify it on
86
+the command line.
87
+
88
+If your account is not paid, then attempts to publish scoped packages will
89
+fail with an HTTP 402 status code (logically enough), unless you use
90
+`--access=public`.
91
+
92
+Management of teams and team memberships is done with the `npm team` command.
93
+
94
+### Configuration
95
+
96
+#### `json`
97
+
98
+* Default: false
99
+* Type: Boolean
100
+
101
+Whether or not to output JSON data, rather than the normal output.
102
+
103
+* In `npm pkg set` it enables parsing set values with JSON.parse() before
104
+ saving them to your `package.json`.
105
+
106
+Not supported by all npm commands.
107
+
108
+
109
+
110
+#### `otp`
111
+
112
+* Default: null
113
+* Type: null or String
114
+
115
+This is a one-time password from a two-factor authenticator. It's needed
116
+when publishing or changing package permissions with `npm access`.
117
+
118
+If not set, and a registry response fails with a challenge for a one-time
119
+password, npm will prompt on the command line for one.
120
+
121
+
122
+
123
+#### `registry`
124
+
125
+* Default: "https://registry.npmjs.org/"
126
+* Type: URL
127
+
128
+The base URL of the npm registry.
129
+
130
+
131
+
132
+### See Also
133
+
134
+* [`libnpmaccess`](https://npm.im/libnpmaccess)
135
+* [npm team](/cli/v10/commands/npm-team)
136
+* [npm publish](/cli/v10/commands/npm-publish)
137
+* [npm config](/cli/v10/commands/npm-config)
138
+* [npm registry](/cli/v10/using-npm/registry)
content/cli/v10/commands/npm-adduser.md
new
+101
@@ -0,0 +1,101 @@
1
+---
2
+title: npm-adduser
3
+section: 1
4
+description: Add a registry user account
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-adduser.md
8
+redirect_from:
9
+ - /cli-documentation/v10/adduser
10
+ - /cli-documentation/v10/cli-commands/adduser
11
+ - /cli-documentation/v10/cli-commands/npm-adduser
12
+ - /cli-documentation/v10/commands/adduser
13
+ - /cli-documentation/v10/commands/npm-adduser
14
+ - /cli-documentation/v10/npm-adduser
15
+ - /cli/v10/adduser
16
+ - /cli/v10/cli-commands/adduser
17
+ - /cli/v10/cli-commands/npm-adduser
18
+ - /cli/v10/commands/adduser
19
+ - /cli/v10/npm-adduser
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm adduser
26
+
27
+alias: add-user
28
+```
29
+
30
+Note: This command is unaware of workspaces.
31
+
32
+### Description
33
+
34
+Create a new user in the specified registry, and save the credentials to
35
+the `.npmrc` file. If no registry is specified, the default registry
36
+will be used (see [`registry`](/cli/v10/using-npm/registry)).
37
+
38
+When using `legacy` for your `auth-type`, the username, password, and
39
+email are read in from prompts.
40
+
41
+### Configuration
42
+
43
+#### `registry`
44
+
45
+* Default: "https://registry.npmjs.org/"
46
+* Type: URL
47
+
48
+The base URL of the npm registry.
49
+
50
+
51
+
52
+#### `scope`
53
+
54
+* Default: the scope of the current project, if any, or ""
55
+* Type: String
56
+
57
+Associate an operation with a scope for a scoped registry.
58
+
59
+Useful when logging in to or out of a private registry:
60
+
61
+```
62
+# log in, linking the scope to the custom registry
63
+npm login --scope=@mycorp --registry=https://registry.mycorp.com
64
+
65
+# log out, removing the link and the auth token
66
+npm logout --scope=@mycorp
67
+```
68
+
69
+This will cause `@mycorp` to be mapped to the registry for future
70
+installation of packages specified according to the pattern
71
+`@mycorp/package`.
72
+
73
+This will also cause `npm init` to create a scoped package.
74
+
75
+```
76
+# accept all defaults, and create a package named "@foo/whatever",
77
+# instead of just named "whatever"
78
+npm init --scope=@foo --yes
79
+```
80
+
81
+
82
+
83
+#### `auth-type`
84
+
85
+* Default: "web"
86
+* Type: "legacy" or "web"
87
+
88
+What authentication strategy to use with `login`. Note that if an `otp`
89
+config is given, this value will always be set to `legacy`.
90
+
91
+
92
+
93
+### See Also
94
+
95
+* [npm registry](/cli/v10/using-npm/registry)
96
+* [npm config](/cli/v10/commands/npm-config)
97
+* [npmrc](/cli/v10/configuring-npm/npmrc)
98
+* [npm owner](/cli/v10/commands/npm-owner)
99
+* [npm whoami](/cli/v10/commands/npm-whoami)
100
+* [npm token](/cli/v10/commands/npm-token)
101
+* [npm profile](/cli/v10/commands/npm-profile)
content/cli/v10/commands/npm-audit.md
new
+454
@@ -0,0 +1,454 @@
1
+---
2
+title: npm-audit
3
+section: 1
4
+description: Run a security audit
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-audit.md
8
+redirect_from:
9
+ - /cli-documentation/v10/audit
10
+ - /cli-documentation/v10/cli-commands/audit
11
+ - /cli-documentation/v10/cli-commands/npm-audit
12
+ - /cli-documentation/v10/commands/audit
13
+ - /cli-documentation/v10/commands/npm-audit
14
+ - /cli-documentation/v10/npm-audit
15
+ - /cli/v10/audit
16
+ - /cli/v10/cli-commands/audit
17
+ - /cli/v10/cli-commands/npm-audit
18
+ - /cli/v10/commands/audit
19
+ - /cli/v10/npm-audit
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm audit [fix|signatures]
26
+```
27
+
28
+### Description
29
+
30
+The audit command submits a description of the dependencies configured in
31
+your project to your default registry and asks for a report of known
32
+vulnerabilities. If any vulnerabilities are found, then the impact and
33
+appropriate remediation will be calculated. If the `fix` argument is
34
+provided, then remediations will be applied to the package tree.
35
+
36
+The command will exit with a 0 exit code if no vulnerabilities were found.
37
+
38
+Note that some vulnerabilities cannot be fixed automatically and will
39
+require manual intervention or review. Also note that since `npm audit
40
+fix` runs a full-fledged `npm install` under the hood, all configs that
41
+apply to the installer will also apply to `npm install` -- so things like
42
+`npm audit fix --package-lock-only` will work as expected.
43
+
44
+By default, the audit command will exit with a non-zero code if any
45
+vulnerability is found. It may be useful in CI environments to include the
46
+`--audit-level` parameter to specify the minimum vulnerability level that
47
+will cause the command to fail. This option does not filter the report
48
+output, it simply changes the command's failure threshold.
49
+
50
+### Audit Signatures
51
+
52
+To ensure the integrity of packages you download from the public npm registry, or any registry that supports signatures, you can verify the registry signatures of downloaded packages using the npm CLI.
53
+
54
+Registry signatures can be verified using the following `audit` command:
55
+
56
+```bash
57
+$ npm audit signatures
58
+```
59
+
60
+The npm CLI supports registry signatures and signing keys provided by any registry if the following conventions are followed:
61
+
62
+1. Signatures are provided in the package's `packument` in each published version within the `dist` object:
63
+
64
+```json
65
+"dist":{
66
+ "..omitted..": "..omitted..",
67
+ "signatures": [{
68
+ "keyid": "SHA256:{{SHA256_PUBLIC_KEY}}",
69
+ "sig": "a312b9c3cb4a1b693e8ebac5ee1ca9cc01f2661c14391917dcb111517f72370809..."
70
+ }]
71
+}
72
+```
73
+
74
+See this [example](https://registry.npmjs.org/light-cycle/1.4.3) of a signed package from the public npm registry.
75
+
76
+The `sig` is generated using the following template: `${package.name}@${package.version}:${package.dist.integrity}` and the `keyid` has to match one of the public signing keys below.
77
+
78
+2. Public signing keys are provided at `registry-host.tld/-/npm/v1/keys` in the following format:
79
+
80
+```
81
+{
82
+ "keys": [{
83
+ "expires": null,
84
+ "keyid": "SHA256:{{SHA256_PUBLIC_KEY}}",
85
+ "keytype": "ecdsa-sha2-nistp256",
86
+ "scheme": "ecdsa-sha2-nistp256",
87
+ "key": "{{B64_PUBLIC_KEY}}"
88
+ }]
89
+}
90
+```
91
+
92
+Keys response:
93
+
94
+- `expires`: null or a simplified extended <a href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 format</a>: `YYYY-MM-DDTHH:mm:ss.sssZ`
95
+- `keydid`: sha256 fingerprint of the public key
96
+- `keytype`: only `ecdsa-sha2-nistp256` is currently supported by the npm CLI
97
+- `scheme`: only `ecdsa-sha2-nistp256` is currently supported by the npm CLI
98
+- `key`: base64 encoded public key
99
+
100
+See this <a href="https://registry.npmjs.org/-/npm/v1/keys" target="_blank">example key's response from the public npm registry</a>.
101
+
102
+### Audit Endpoints
103
+
104
+There are two audit endpoints that npm may use to fetch vulnerability
105
+information: the `Bulk Advisory` endpoint and the `Quick Audit` endpoint.
106
+
107
+#### Bulk Advisory Endpoint
108
+
109
+As of version 7, npm uses the much faster `Bulk Advisory` endpoint to
110
+optimize the speed of calculating audit results.
111
+
112
+npm will generate a JSON payload with the name and list of versions of each
113
+package in the tree, and POST it to the default configured registry at
114
+the path `/-/npm/v1/security/advisories/bulk`.
115
+
116
+Any packages in the tree that do not have a `version` field in their
117
+package.json file will be ignored. If any `--omit` options are specified
118
+(either via the [`--omit` config](/cli/v10/using-npm/config#omit), or one of the
119
+shorthands such as `--production`, `--only=dev`, and so on), then packages will
120
+be omitted from the submitted payload as appropriate.
121
+
122
+If the registry responds with an error, or with an invalid response, then
123
+npm will attempt to load advisory data from the `Quick Audit` endpoint.
124
+
125
+The expected result will contain a set of advisory objects for each
126
+dependency that matches the advisory range. Each advisory object contains
127
+a `name`, `url`, `id`, `severity`, `vulnerable_versions`, and `title`.
128
+
129
+npm then uses these advisory objects to calculate vulnerabilities and
130
+meta-vulnerabilities of the dependencies within the tree.
131
+
132
+#### Quick Audit Endpoint
133
+
134
+If the `Bulk Advisory` endpoint returns an error, or invalid data, npm will
135
+attempt to load advisory data from the `Quick Audit` endpoint, which is
136
+considerably slower in most cases.
137
+
138
+The full package tree as found in `package-lock.json` is submitted, along
139
+with the following pieces of additional metadata:
140
+
141
+* `npm_version`
142
+* `node_version`
143
+* `platform`
144
+* `arch`
145
+* `node_env`
146
+
147
+All packages in the tree are submitted to the Quick Audit endpoint.
148
+Omitted dependency types are skipped when generating the report.
149
+
150
+#### Scrubbing
151
+
152
+Out of an abundance of caution, npm versions 5 and 6 would "scrub" any
153
+packages from the submitted report if their name contained a `/` character,
154
+so as to avoid leaking the names of potentially private packages or git
155
+URLs.
156
+
157
+However, in practice, this resulted in audits often failing to properly
158
+detect meta-vulnerabilities, because the tree would appear to be invalid
159
+due to missing dependencies, and prevented the detection of vulnerabilities
160
+in package trees that used git dependencies or private modules.
161
+
162
+This scrubbing has been removed from npm as of version 7.
163
+
164
+#### Calculating Meta-Vulnerabilities and Remediations
165
+
166
+npm uses the
167
+[`@npmcli/metavuln-calculator`](http://npm.im/@npmcli/metavuln-calculator)
168
+module to turn a set of security advisories into a set of "vulnerability"
169
+objects. A "meta-vulnerability" is a dependency that is vulnerable by
170
+virtue of dependence on vulnerable versions of a vulnerable package.
171
+
172
+For example, if the package `foo` is vulnerable in the range `>=1.0.2
173
+<2.0.0`, and the package `bar` depends on `foo@^1.1.0`, then that version
174
+of `bar` can only be installed by installing a vulnerable version of `foo`.
175
+In this case, `bar` is a "metavulnerability".
176
+
177
+Once metavulnerabilities for a given package are calculated, they are
178
+cached in the `~/.npm` folder and only re-evaluated if the advisory range
179
+changes, or a new version of the package is published (in which case, the
180
+new version is checked for metavulnerable status as well).
181
+
182
+If the chain of metavulnerabilities extends all the way to the root
183
+project, and it cannot be updated without changing its dependency ranges,
184
+then `npm audit fix` will require the `--force` option to apply the
185
+remediation. If remediations do not require changes to the dependency
186
+ranges, then all vulnerable packages will be updated to a version that does
187
+not have an advisory or metavulnerability posted against it.
188
+
189
+### Exit Code
190
+
191
+The `npm audit` command will exit with a 0 exit code if no vulnerabilities
192
+were found. The `npm audit fix` command will exit with 0 exit code if no
193
+vulnerabilities are found _or_ if the remediation is able to successfully
194
+fix all vulnerabilities.
195
+
196
+If vulnerabilities were found the exit code will depend on the
197
+[`audit-level` config](/cli/v10/using-npm/config#audit-level).
198
+
199
+### Examples
200
+
201
+Scan your project for vulnerabilities and automatically install any compatible
202
+updates to vulnerable dependencies:
203
+
204
+```bash
205
+$ npm audit fix
206
+```
207
+
208
+Run `audit fix` without modifying `node_modules`, but still updating the
209
+pkglock:
210
+
211
+```bash
212
+$ npm audit fix --package-lock-only
213
+```
214
+
215
+Skip updating `devDependencies`:
216
+
217
+```bash
218
+$ npm audit fix --only=prod
219
+```
220
+
221
+Have `audit fix` install SemVer-major updates to toplevel dependencies, not
222
+just SemVer-compatible ones:
223
+
224
+```bash
225
+$ npm audit fix --force
226
+```
227
+
228
+Do a dry run to get an idea of what `audit fix` will do, and _also_ output
229
+install information in JSON format:
230
+
231
+```bash
232
+$ npm audit fix --dry-run --json
233
+```
234
+
235
+Scan your project for vulnerabilities and just show the details, without
236
+fixing anything:
237
+
238
+```bash
239
+$ npm audit
240
+```
241
+
242
+Get the detailed audit report in JSON format:
243
+
244
+```bash
245
+$ npm audit --json
246
+```
247
+
248
+Fail an audit only if the results include a vulnerability with a level of moderate or higher:
249
+
250
+```bash
251
+$ npm audit --audit-level=moderate
252
+```
253
+
254
+### Configuration
255
+
256
+#### `audit-level`
257
+
258
+* Default: null
259
+* Type: null, "info", "low", "moderate", "high", "critical", or "none"
260
+
261
+The minimum level of vulnerability for `npm audit` to exit with a non-zero
262
+exit code.
263
+
264
+
265
+
266
+#### `dry-run`
267
+
268
+* Default: false
269
+* Type: Boolean
270
+
271
+Indicates that you don't want npm to make any changes and that it should
272
+only report what it would have done. This can be passed into any of the
273
+commands that modify your local installation, eg, `install`, `update`,
274
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
275
+
276
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
277
+`owner`, etc.
278
+
279
+
280
+
281
+#### `force`
282
+
283
+* Default: false
284
+* Type: Boolean
285
+
286
+Removes various protections against unfortunate side effects, common
287
+mistakes, unnecessary performance degradation, and malicious input.
288
+
289
+* Allow clobbering non-npm files in global installs.
290
+* Allow the `npm version` command to work on an unclean git repository.
291
+* Allow deleting the cache folder with `npm cache clean`.
292
+* Allow installing packages that have an `engines` declaration requiring a
293
+ different version of npm.
294
+* Allow installing packages that have an `engines` declaration requiring a
295
+ different version of `node`, even if `--engine-strict` is enabled.
296
+* Allow `npm audit fix` to install modules outside your stated dependency
297
+ range (including SemVer-major changes).
298
+* Allow unpublishing all versions of a published package.
299
+* Allow conflicting peerDependencies to be installed in the root project.
300
+* Implicitly set `--yes` during `npm init`.
301
+* Allow clobbering existing values in `npm pkg`
302
+* Allow unpublishing of entire packages (not just a single version).
303
+
304
+If you don't have a clear idea of what you want to do, it is strongly
305
+recommended that you do not use this option!
306
+
307
+
308
+
309
+#### `json`
310
+
311
+* Default: false
312
+* Type: Boolean
313
+
314
+Whether or not to output JSON data, rather than the normal output.
315
+
316
+* In `npm pkg set` it enables parsing set values with JSON.parse() before
317
+ saving them to your `package.json`.
318
+
319
+Not supported by all npm commands.
320
+
321
+
322
+
323
+#### `package-lock-only`
324
+
325
+* Default: false
326
+* Type: Boolean
327
+
328
+If set to true, the current operation will only use the `package-lock.json`,
329
+ignoring `node_modules`.
330
+
331
+For `update` this means only the `package-lock.json` will be updated,
332
+instead of checking `node_modules` and downloading dependencies.
333
+
334
+For `list` this means the output will be based on the tree described by the
335
+`package-lock.json`, rather than the contents of `node_modules`.
336
+
337
+
338
+
339
+#### `omit`
340
+
341
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
342
+ 'production', otherwise empty.
343
+* Type: "dev", "optional", or "peer" (can be set multiple times)
344
+
345
+Dependency types to omit from the installation tree on disk.
346
+
347
+Note that these dependencies _are_ still resolved and added to the
348
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
349
+physically installed on disk.
350
+
351
+If a package type appears in both the `--include` and `--omit` lists, then
352
+it will be included.
353
+
354
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
355
+variable will be set to `'production'` for all lifecycle scripts.
356
+
357
+
358
+
359
+#### `foreground-scripts`
360
+
361
+* Default: false
362
+* Type: Boolean
363
+
364
+Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)
365
+scripts for installed packages in the foreground process, sharing standard
366
+input, output, and error with the main npm process.
367
+
368
+Note that this will generally make installs run slower, and be much noisier,
369
+but can be useful for debugging.
370
+
371
+
372
+
373
+#### `ignore-scripts`
374
+
375
+* Default: false
376
+* Type: Boolean
377
+
378
+If true, npm does not run scripts specified in package.json files.
379
+
380
+Note that commands explicitly intended to run a particular script, such as
381
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
382
+will still run their intended script if `ignore-scripts` is set, but they
383
+will *not* run any pre- or post-scripts.
384
+
385
+
386
+
387
+#### `workspace`
388
+
389
+* Default:
390
+* Type: String (can be set multiple times)
391
+
392
+Enable running a command in the context of the configured workspaces of the
393
+current project while filtering by running only the workspaces defined by
394
+this configuration option.
395
+
396
+Valid values for the `workspace` config are either:
397
+
398
+* Workspace names
399
+* Path to a workspace directory
400
+* Path to a parent workspace directory (will result in selecting all
401
+ workspaces within that folder)
402
+
403
+When set for the `npm init` command, this may be set to the folder of a
404
+workspace which does not yet exist, to create the folder and set it up as a
405
+brand new workspace within the project.
406
+
407
+This value is not exported to the environment for child processes.
408
+
409
+#### `workspaces`
410
+
411
+* Default: null
412
+* Type: null or Boolean
413
+
414
+Set to true to run the command in the context of **all** configured
415
+workspaces.
416
+
417
+Explicitly setting this to false will cause commands like `install` to
418
+ignore workspaces altogether. When not set explicitly:
419
+
420
+- Commands that operate on the `node_modules` tree (install, update, etc.)
421
+will link workspaces into the `node_modules` folder. - Commands that do
422
+other things (test, exec, publish, etc.) will operate on the root project,
423
+_unless_ one or more workspaces are specified in the `workspace` config.
424
+
425
+This value is not exported to the environment for child processes.
426
+
427
+#### `include-workspace-root`
428
+
429
+* Default: false
430
+* Type: Boolean
431
+
432
+Include the workspace root when workspaces are enabled for a command.
433
+
434
+When false, specifying individual workspaces via the `workspace` config, or
435
+all workspaces via the `workspaces` flag, will cause npm to operate only on
436
+the specified workspaces, and not on the root project.
437
+
438
+This value is not exported to the environment for child processes.
439
+
440
+#### `install-links`
441
+
442
+* Default: false
443
+* Type: Boolean
444
+
445
+When set file: protocol dependencies will be packed and installed as regular
446
+dependencies instead of creating a symlink. This option has no effect on
447
+workspaces.
448
+
449
+
450
+
451
+### See Also
452
+
453
+* [npm install](/cli/v10/commands/npm-install)
454
+* [config](/cli/v10/using-npm/config)
content/cli/v10/commands/npm-bugs.md
new
+124
@@ -0,0 +1,124 @@
1
+---
2
+title: npm-bugs
3
+section: 1
4
+description: Report bugs for a package in a web browser
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-bugs.md
8
+redirect_from:
9
+ - /cli-documentation/v10/bugs
10
+ - /cli-documentation/v10/cli-commands/bugs
11
+ - /cli-documentation/v10/cli-commands/npm-bugs
12
+ - /cli-documentation/v10/commands/bugs
13
+ - /cli-documentation/v10/commands/npm-bugs
14
+ - /cli-documentation/v10/npm-bugs
15
+ - /cli/v10/bugs
16
+ - /cli/v10/cli-commands/bugs
17
+ - /cli/v10/cli-commands/npm-bugs
18
+ - /cli/v10/commands/bugs
19
+ - /cli/v10/npm-bugs
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm bugs [<pkgname> [<pkgname> ...]]
26
+
27
+alias: issues
28
+```
29
+
30
+### Description
31
+
32
+This command tries to guess at the likely location of a package's bug
33
+tracker URL or the `mailto` URL of the support email, and then tries to
34
+open it using the [`--browser` config](/cli/v10/using-npm/config#browser) param. If no
35
+package name is provided, it will search for a `package.json` in the current
36
+folder and use the `name` property.
37
+
38
+### Configuration
39
+
40
+#### `browser`
41
+
42
+* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
43
+* Type: null, Boolean, or String
44
+
45
+The browser that is called by npm commands to open websites.
46
+
47
+Set to `false` to suppress browser behavior and instead print urls to
48
+terminal.
49
+
50
+Set to `true` to use default system URL opener.
51
+
52
+
53
+
54
+#### `registry`
55
+
56
+* Default: "https://registry.npmjs.org/"
57
+* Type: URL
58
+
59
+The base URL of the npm registry.
60
+
61
+
62
+
63
+#### `workspace`
64
+
65
+* Default:
66
+* Type: String (can be set multiple times)
67
+
68
+Enable running a command in the context of the configured workspaces of the
69
+current project while filtering by running only the workspaces defined by
70
+this configuration option.
71
+
72
+Valid values for the `workspace` config are either:
73
+
74
+* Workspace names
75
+* Path to a workspace directory
76
+* Path to a parent workspace directory (will result in selecting all
77
+ workspaces within that folder)
78
+
79
+When set for the `npm init` command, this may be set to the folder of a
80
+workspace which does not yet exist, to create the folder and set it up as a
81
+brand new workspace within the project.
82
+
83
+This value is not exported to the environment for child processes.
84
+
85
+#### `workspaces`
86
+
87
+* Default: null
88
+* Type: null or Boolean
89
+
90
+Set to true to run the command in the context of **all** configured
91
+workspaces.
92
+
93
+Explicitly setting this to false will cause commands like `install` to
94
+ignore workspaces altogether. When not set explicitly:
95
+
96
+- Commands that operate on the `node_modules` tree (install, update, etc.)
97
+will link workspaces into the `node_modules` folder. - Commands that do
98
+other things (test, exec, publish, etc.) will operate on the root project,
99
+_unless_ one or more workspaces are specified in the `workspace` config.
100
+
101
+This value is not exported to the environment for child processes.
102
+
103
+#### `include-workspace-root`
104
+
105
+* Default: false
106
+* Type: Boolean
107
+
108
+Include the workspace root when workspaces are enabled for a command.
109
+
110
+When false, specifying individual workspaces via the `workspace` config, or
111
+all workspaces via the `workspaces` flag, will cause npm to operate only on
112
+the specified workspaces, and not on the root project.
113
+
114
+This value is not exported to the environment for child processes.
115
+
116
+### See Also
117
+
118
+* [npm docs](/cli/v10/commands/npm-docs)
119
+* [npm view](/cli/v10/commands/npm-view)
120
+* [npm publish](/cli/v10/commands/npm-publish)
121
+* [npm registry](/cli/v10/using-npm/registry)
122
+* [npm config](/cli/v10/commands/npm-config)
123
+* [npmrc](/cli/v10/configuring-npm/npmrc)
124
+* [package.json](/cli/v10/configuring-npm/package-json)
content/cli/v10/commands/npm-cache.md
new
+109
@@ -0,0 +1,109 @@
1
+---
2
+title: npm-cache
3
+section: 1
4
+description: Manipulates packages cache
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-cache.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cache
10
+ - /cli-documentation/v10/cli-commands/cache
11
+ - /cli-documentation/v10/cli-commands/npm-cache
12
+ - /cli-documentation/v10/commands/cache
13
+ - /cli-documentation/v10/commands/npm-cache
14
+ - /cli-documentation/v10/npm-cache
15
+ - /cli/v10/cache
16
+ - /cli/v10/cli-commands/cache
17
+ - /cli/v10/cli-commands/npm-cache
18
+ - /cli/v10/commands/cache
19
+ - /cli/v10/npm-cache
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm cache add <package-spec>
26
+npm cache clean [<key>]
27
+npm cache ls [<name>@<version>]
28
+npm cache verify
29
+```
30
+
31
+Note: This command is unaware of workspaces.
32
+
33
+### Description
34
+
35
+Used to add, list, or clean the npm cache folder.
36
+
37
+* add:
38
+ Add the specified packages to the local cache. This command is primarily
39
+ intended to be used internally by npm, but it can provide a way to
40
+ add data to the local installation cache explicitly.
41
+
42
+* clean:
43
+ Delete all data out of the cache folder. Note that this is typically
44
+ unnecessary, as npm's cache is self-healing and resistant to data
45
+ corruption issues.
46
+
47
+* verify:
48
+ Verify the contents of the cache folder, garbage collecting any unneeded
49
+ data, and verifying the integrity of the cache index and all cached data.
50
+
51
+### Details
52
+
53
+npm stores cache data in an opaque directory within the configured `cache`,
54
+named `_cacache`. This directory is a
55
+[`cacache`](http://npm.im/cacache)-based content-addressable cache that
56
+stores all http request data as well as other package-related data. This
57
+directory is primarily accessed through `pacote`, the library responsible
58
+for all package fetching as of npm@5.
59
+
60
+All data that passes through the cache is fully verified for integrity on
61
+both insertion and extraction. Cache corruption will either trigger an
62
+error, or signal to `pacote` that the data must be refetched, which it will
63
+do automatically. For this reason, it should never be necessary to clear
64
+the cache for any reason other than reclaiming disk space, thus why `clean`
65
+now requires `--force` to run.
66
+
67
+There is currently no method exposed through npm to inspect or directly
68
+manage the contents of this cache. In order to access it, `cacache` must be
69
+used directly.
70
+
71
+npm will not remove data by itself: the cache will grow as new packages are
72
+installed.
73
+
74
+### A note about the cache's design
75
+
76
+The npm cache is strictly a cache: it should not be relied upon as a
77
+persistent and reliable data store for package data. npm makes no guarantee
78
+that a previously-cached piece of data will be available later, and will
79
+automatically delete corrupted contents. The primary guarantee that the
80
+cache makes is that, if it does return data, that data will be exactly the
81
+data that was inserted.
82
+
83
+To run an offline verification of existing cache contents, use `npm cache
84
+verify`.
85
+
86
+### Configuration
87
+
88
+#### `cache`
89
+
90
+* Default: Windows: `%LocalAppData%\npm-cache`, Posix: `~/.npm`
91
+* Type: Path
92
+
93
+The location of npm's cache directory.
94
+
95
+
96
+
97
+### See Also
98
+
99
+* [package spec](/cli/v10/using-npm/package-spec)
100
+* [npm folders](/cli/v10/configuring-npm/folders)
101
+* [npm config](/cli/v10/commands/npm-config)
102
+* [npmrc](/cli/v10/configuring-npm/npmrc)
103
+* [npm install](/cli/v10/commands/npm-install)
104
+* [npm publish](/cli/v10/commands/npm-publish)
105
+* [npm pack](/cli/v10/commands/npm-pack)
106
+* https://npm.im/cacache
107
+* https://npm.im/pacote
108
+* https://npm.im/@npmcli/arborist
109
+* https://npm.im/make-fetch-happen
content/cli/v10/commands/npm-ci.md
new
+318
@@ -0,0 +1,318 @@
1
+---
2
+title: npm-ci
3
+section: 1
4
+description: Clean install a project
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-ci.md
8
+redirect_from:
9
+ - /cli-documentation/v10/ci
10
+ - /cli-documentation/v10/cli-commands/ci
11
+ - /cli-documentation/v10/cli-commands/npm-ci
12
+ - /cli-documentation/v10/commands/ci
13
+ - /cli-documentation/v10/commands/npm-ci
14
+ - /cli-documentation/v10/npm-ci
15
+ - /cli/v10/ci
16
+ - /cli/v10/cli-commands/ci
17
+ - /cli/v10/cli-commands/npm-ci
18
+ - /cli/v10/commands/ci
19
+ - /cli/v10/npm-ci
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm ci
26
+
27
+aliases: clean-install, ic, install-clean, isntall-clean
28
+```
29
+
30
+### Description
31
+
32
+This command is similar to [`npm install`](/cli/v10/commands/npm-install), except
33
+it's meant to be used in automated environments such as test platforms,
34
+continuous integration, and deployment -- or any situation where you want
35
+to make sure you're doing a clean install of your dependencies.
36
+
37
+The main differences between using `npm install` and `npm ci` are:
38
+
39
+* The project **must** have an existing `package-lock.json` or
40
+ `npm-shrinkwrap.json`.
41
+* If dependencies in the package lock do not match those in `package.json`,
42
+ `npm ci` will exit with an error, instead of updating the package lock.
43
+* `npm ci` can only install entire projects at a time: individual
44
+ dependencies cannot be added with this command.
45
+* If a `node_modules` is already present, it will be automatically removed
46
+ before `npm ci` begins its install.
47
+* It will never write to `package.json` or any of the package-locks:
48
+ installs are essentially frozen.
49
+
50
+NOTE: If you create your `package-lock.json` file by running `npm install`
51
+with flags that can affect the shape of your dependency tree, such as
52
+`--legacy-peer-deps` or `--install-links`, you _must_ provide the same
53
+flags to `npm ci` or you are likely to encounter errors. An easy way to do
54
+this is to run, for example,
55
+`npm config set legacy-peer-deps=true --location=project` and commit the
56
+`.npmrc` file to your repo.
57
+
58
+### Example
59
+
60
+Make sure you have a package-lock and an up-to-date install:
61
+
62
+```bash
63
+$ cd ./my/npm/project
64
+$ npm install
65
+added 154 packages in 10s
66
+$ ls | grep package-lock
67
+```
68
+
69
+Run `npm ci` in that project
70
+
71
+```bash
72
+$ npm ci
73
+added 154 packages in 5s
74
+```
75
+
76
+Configure Travis CI to build using `npm ci` instead of `npm install`:
77
+
78
+```bash
79
+# .travis.yml
80
+install:
81
+- npm ci
82
+# keep the npm cache around to speed up installs
83
+cache:
84
+ directories:
85
+ - "$HOME/.npm"
86
+```
87
+
88
+### Configuration
89
+
90
+#### `install-strategy`
91
+
92
+* Default: "hoisted"
93
+* Type: "hoisted", "nested", "shallow", or "linked"
94
+
95
+Sets the strategy for installing packages in node_modules. hoisted
96
+(default): Install non-duplicated in top-level, and duplicated as necessary
97
+within directory structure. nested: (formerly --legacy-bundling) install in
98
+place, no hoisting. shallow (formerly --global-style) only install direct
99
+deps at top-level. linked: (experimental) install in node_modules/.store,
100
+link in place, unhoisted.
101
+
102
+
103
+
104
+#### `legacy-bundling`
105
+
106
+* Default: false
107
+* Type: Boolean
108
+* DEPRECATED: This option has been deprecated in favor of
109
+ `--install-strategy=nested`
110
+
111
+Instead of hoisting package installs in `node_modules`, install packages in
112
+the same manner that they are depended on. This may cause very deep
113
+directory structures and duplicate package installs as there is no
114
+de-duplicating. Sets `--install-strategy=nested`.
115
+
116
+
117
+
118
+#### `global-style`
119
+
120
+* Default: false
121
+* Type: Boolean
122
+* DEPRECATED: This option has been deprecated in favor of
123
+ `--install-strategy=shallow`
124
+
125
+Only install direct dependencies in the top level `node_modules`, but hoist
126
+on deeper dependencies. Sets `--install-strategy=shallow`.
127
+
128
+
129
+
130
+#### `omit`
131
+
132
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
133
+ 'production', otherwise empty.
134
+* Type: "dev", "optional", or "peer" (can be set multiple times)
135
+
136
+Dependency types to omit from the installation tree on disk.
137
+
138
+Note that these dependencies _are_ still resolved and added to the
139
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
140
+physically installed on disk.
141
+
142
+If a package type appears in both the `--include` and `--omit` lists, then
143
+it will be included.
144
+
145
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
146
+variable will be set to `'production'` for all lifecycle scripts.
147
+
148
+
149
+
150
+#### `strict-peer-deps`
151
+
152
+* Default: false
153
+* Type: Boolean
154
+
155
+If set to `true`, and `--legacy-peer-deps` is not set, then _any_
156
+conflicting `peerDependencies` will be treated as an install failure, even
157
+if npm could reasonably guess the appropriate resolution based on non-peer
158
+dependency relationships.
159
+
160
+By default, conflicting `peerDependencies` deep in the dependency graph will
161
+be resolved using the nearest non-peer dependency specification, even if
162
+doing so will result in some packages receiving a peer dependency outside
163
+the range set in their package's `peerDependencies` object.
164
+
165
+When such an override is performed, a warning is printed, explaining the
166
+conflict and the packages involved. If `--strict-peer-deps` is set, then
167
+this warning is treated as a failure.
168
+
169
+
170
+
171
+#### `foreground-scripts`
172
+
173
+* Default: false
174
+* Type: Boolean
175
+
176
+Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)
177
+scripts for installed packages in the foreground process, sharing standard
178
+input, output, and error with the main npm process.
179
+
180
+Note that this will generally make installs run slower, and be much noisier,
181
+but can be useful for debugging.
182
+
183
+
184
+
185
+#### `ignore-scripts`
186
+
187
+* Default: false
188
+* Type: Boolean
189
+
190
+If true, npm does not run scripts specified in package.json files.
191
+
192
+Note that commands explicitly intended to run a particular script, such as
193
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
194
+will still run their intended script if `ignore-scripts` is set, but they
195
+will *not* run any pre- or post-scripts.
196
+
197
+
198
+
199
+#### `audit`
200
+
201
+* Default: true
202
+* Type: Boolean
203
+
204
+When "true" submit audit reports alongside the current npm command to the
205
+default registry and all registries configured for scopes. See the
206
+documentation for [`npm audit`](/cli/v10/commands/npm-audit) for details on what is
207
+submitted.
208
+
209
+
210
+
211
+#### `bin-links`
212
+
213
+* Default: true
214
+* Type: Boolean
215
+
216
+Tells npm to create symlinks (or `.cmd` shims on Windows) for package
217
+executables.
218
+
219
+Set to false to have it not do this. This can be used to work around the
220
+fact that some file systems don't support symlinks, even on ostensibly Unix
221
+systems.
222
+
223
+
224
+
225
+#### `fund`
226
+
227
+* Default: true
228
+* Type: Boolean
229
+
230
+When "true" displays the message at the end of each `npm install`
231
+acknowledging the number of dependencies looking for funding. See [`npm
232
+fund`](/cli/v10/commands/npm-fund) for details.
233
+
234
+
235
+
236
+#### `dry-run`
237
+
238
+* Default: false
239
+* Type: Boolean
240
+
241
+Indicates that you don't want npm to make any changes and that it should
242
+only report what it would have done. This can be passed into any of the
243
+commands that modify your local installation, eg, `install`, `update`,
244
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
245
+
246
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
247
+`owner`, etc.
248
+
249
+
250
+
251
+#### `workspace`
252
+
253
+* Default:
254
+* Type: String (can be set multiple times)
255
+
256
+Enable running a command in the context of the configured workspaces of the
257
+current project while filtering by running only the workspaces defined by
258
+this configuration option.
259
+
260
+Valid values for the `workspace` config are either:
261
+
262
+* Workspace names
263
+* Path to a workspace directory
264
+* Path to a parent workspace directory (will result in selecting all
265
+ workspaces within that folder)
266
+
267
+When set for the `npm init` command, this may be set to the folder of a
268
+workspace which does not yet exist, to create the folder and set it up as a
269
+brand new workspace within the project.
270
+
271
+This value is not exported to the environment for child processes.
272
+
273
+#### `workspaces`
274
+
275
+* Default: null
276
+* Type: null or Boolean
277
+
278
+Set to true to run the command in the context of **all** configured
279
+workspaces.
280
+
281
+Explicitly setting this to false will cause commands like `install` to
282
+ignore workspaces altogether. When not set explicitly:
283
+
284
+- Commands that operate on the `node_modules` tree (install, update, etc.)
285
+will link workspaces into the `node_modules` folder. - Commands that do
286
+other things (test, exec, publish, etc.) will operate on the root project,
287
+_unless_ one or more workspaces are specified in the `workspace` config.
288
+
289
+This value is not exported to the environment for child processes.
290
+
291
+#### `include-workspace-root`
292
+
293
+* Default: false
294
+* Type: Boolean
295
+
296
+Include the workspace root when workspaces are enabled for a command.
297
+
298
+When false, specifying individual workspaces via the `workspace` config, or
299
+all workspaces via the `workspaces` flag, will cause npm to operate only on
300
+the specified workspaces, and not on the root project.
301
+
302
+This value is not exported to the environment for child processes.
303
+
304
+#### `install-links`
305
+
306
+* Default: false
307
+* Type: Boolean
308
+
309
+When set file: protocol dependencies will be packed and installed as regular
310
+dependencies instead of creating a symlink. This option has no effect on
311
+workspaces.
312
+
313
+
314
+
315
+### See Also
316
+
317
+* [npm install](/cli/v10/commands/npm-install)
318
+* [package-lock.json](/cli/v10/configuring-npm/package-lock-json)
content/cli/v10/commands/npm-completion.md
new
+56
@@ -0,0 +1,56 @@
1
+---
2
+title: npm-completion
3
+section: 1
4
+description: Tab Completion for npm
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-completion.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/completion
10
+ - /cli-documentation/v10/cli-commands/npm-completion
11
+ - /cli-documentation/v10/commands/completion
12
+ - /cli-documentation/v10/commands/npm-completion
13
+ - /cli-documentation/v10/completion
14
+ - /cli-documentation/v10/npm-completion
15
+ - /cli/v10/cli-commands/completion
16
+ - /cli/v10/cli-commands/npm-completion
17
+ - /cli/v10/commands/completion
18
+ - /cli/v10/completion
19
+ - /cli/v10/npm-completion
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm completion
26
+```
27
+
28
+Note: This command is unaware of workspaces.
29
+
30
+### Description
31
+
32
+Enables tab-completion in all npm commands.
33
+
34
+The synopsis above
35
+loads the completions into your current shell. Adding it to
36
+your ~/.bashrc or ~/.zshrc will make the completions available
37
+everywhere:
38
+
39
+```bash
40
+npm completion >> ~/.bashrc
41
+npm completion >> ~/.zshrc
42
+```
43
+
44
+You may of course also pipe the output of `npm completion` to a file
45
+such as `/usr/local/etc/bash_completion.d/npm` or
46
+`/etc/bash_completion.d/npm` if you have a system that will read
47
+that file for you.
48
+
49
+When `COMP_CWORD`, `COMP_LINE`, and `COMP_POINT` are defined in the
50
+environment, `npm completion` acts in "plumbing mode", and outputs
51
+completions based on the arguments.
52
+
53
+### See Also
54
+
55
+* [npm developers](/cli/v10/using-npm/developers)
56
+* [npm](/cli/v10/commands/npm)
content/cli/v10/commands/npm-config.md
new
+196
@@ -0,0 +1,196 @@
1
+---
2
+title: npm-config
3
+section: 1
4
+description: Manage the npm configuration files
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-config.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/config
10
+ - /cli-documentation/v10/cli-commands/npm-config
11
+ - /cli-documentation/v10/commands/config
12
+ - /cli-documentation/v10/commands/npm-config
13
+ - /cli-documentation/v10/config
14
+ - /cli-documentation/v10/npm-config
15
+ - /cli/v10/cli-commands/config
16
+ - /cli/v10/cli-commands/npm-config
17
+ - /cli/v10/commands/config
18
+ - /cli/v10/config
19
+ - /cli/v10/npm-config
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm config set <key>=<value> [<key>=<value> ...]
26
+npm config get [<key> [<key> ...]]
27
+npm config delete <key> [<key> ...]
28
+npm config list [--json]
29
+npm config edit
30
+npm config fix
31
+
32
+alias: c
33
+```
34
+
35
+Note: This command is unaware of workspaces.
36
+
37
+### Description
38
+
39
+npm gets its config settings from the command line, environment
40
+variables, `npmrc` files, and in some cases, the `package.json` file.
41
+
42
+See [npmrc](/cli/v10/configuring-npm/npmrc) for more information about the npmrc
43
+files.
44
+
45
+See [config](/cli/v10/using-npm/config) for a more thorough explanation of the
46
+mechanisms involved, and a full list of config options available.
47
+
48
+The `npm config` command can be used to update and edit the contents
49
+of the user and global npmrc files.
50
+
51
+### Sub-commands
52
+
53
+Config supports the following sub-commands:
54
+
55
+#### set
56
+
57
+```bash
58
+npm config set key=value [key=value...]
59
+npm set key=value [key=value...]
60
+```
61
+
62
+Sets each of the config keys to the value provided.
63
+
64
+If value is omitted, the key will be removed from your config file entirely.
65
+
66
+Note: for backwards compatibility, `npm config set key value` is supported
67
+as an alias for `npm config set key=value`.
68
+
69
+#### get
70
+
71
+```bash
72
+npm config get [key ...]
73
+npm get [key ...]
74
+```
75
+
76
+Echo the config value(s) to stdout.
77
+
78
+If multiple keys are provided, then the values will be prefixed with the
79
+key names.
80
+
81
+If no keys are provided, then this command behaves the same as `npm config
82
+list`.
83
+
84
+#### list
85
+
86
+```bash
87
+npm config list
88
+```
89
+
90
+Show all the config settings. Use `-l` to also show defaults. Use `--json`
91
+to show the settings in json format.
92
+
93
+#### delete
94
+
95
+```bash
96
+npm config delete key [key ...]
97
+```
98
+
99
+Deletes the specified keys from all configuration files.
100
+
101
+#### edit
102
+
103
+```bash
104
+npm config edit
105
+```
106
+
107
+Opens the config file in an editor. Use the `--global` flag to edit the
108
+global config.
109
+
110
+#### fix
111
+
112
+```bash
113
+npm config fix
114
+```
115
+
116
+Attempts to repair invalid configuration items. Usually this means
117
+attaching authentication config (i.e. `_auth`, `_authToken`) to the
118
+configured `registry`.
119
+
120
+### Configuration
121
+
122
+#### `json`
123
+
124
+* Default: false
125
+* Type: Boolean
126
+
127
+Whether or not to output JSON data, rather than the normal output.
128
+
129
+* In `npm pkg set` it enables parsing set values with JSON.parse() before
130
+ saving them to your `package.json`.
131
+
132
+Not supported by all npm commands.
133
+
134
+
135
+
136
+#### `global`
137
+
138
+* Default: false
139
+* Type: Boolean
140
+
141
+Operates in "global" mode, so that packages are installed into the `prefix`
142
+folder instead of the current working directory. See
143
+[folders](/cli/v10/configuring-npm/folders) for more on the differences in behavior.
144
+
145
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
146
+ of the current working directory.
147
+* bin files are linked to `{prefix}/bin`
148
+* man pages are linked to `{prefix}/share/man`
149
+
150
+
151
+
152
+#### `editor`
153
+
154
+* Default: The EDITOR or VISUAL environment variables, or
155
+ '%SYSTEMROOT%\notepad.exe' on Windows, or 'vi' on Unix systems
156
+* Type: String
157
+
158
+The command to run for `npm edit` and `npm config edit`.
159
+
160
+
161
+
162
+#### `location`
163
+
164
+* Default: "user" unless `--global` is passed, which will also set this value
165
+ to "global"
166
+* Type: "global", "user", or "project"
167
+
168
+When passed to `npm config` this refers to which config file to use.
169
+
170
+When set to "global" mode, packages are installed into the `prefix` folder
171
+instead of the current working directory. See
172
+[folders](/cli/v10/configuring-npm/folders) for more on the differences in behavior.
173
+
174
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
175
+ of the current working directory.
176
+* bin files are linked to `{prefix}/bin`
177
+* man pages are linked to `{prefix}/share/man`
178
+
179
+
180
+
181
+#### `long`
182
+
183
+* Default: false
184
+* Type: Boolean
185
+
186
+Show extended information in `ls`, `search`, and `help-search`.
187
+
188
+
189
+
190
+### See Also
191
+
192
+* [npm folders](/cli/v10/configuring-npm/folders)
193
+* [npm config](/cli/v10/commands/npm-config)
194
+* [package.json](/cli/v10/configuring-npm/package-json)
195
+* [npmrc](/cli/v10/configuring-npm/npmrc)
196
+* [npm](/cli/v10/commands/npm)
content/cli/v10/commands/npm-dedupe.md
new
+321
@@ -0,0 +1,321 @@
1
+---
2
+title: npm-dedupe
3
+section: 1
4
+description: Reduce duplication in the package tree
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-dedupe.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/dedupe
10
+ - /cli-documentation/v10/cli-commands/npm-dedupe
11
+ - /cli-documentation/v10/commands/dedupe
12
+ - /cli-documentation/v10/commands/npm-dedupe
13
+ - /cli-documentation/v10/dedupe
14
+ - /cli-documentation/v10/npm-dedupe
15
+ - /cli/v10/cli-commands/dedupe
16
+ - /cli/v10/cli-commands/npm-dedupe
17
+ - /cli/v10/commands/dedupe
18
+ - /cli/v10/dedupe
19
+ - /cli/v10/npm-dedupe
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm dedupe
26
+
27
+alias: ddp
28
+```
29
+
30
+### Description
31
+
32
+Searches the local package tree and attempts to simplify the overall
33
+structure by moving dependencies further up the tree, where they can
34
+be more effectively shared by multiple dependent packages.
35
+
36
+For example, consider this dependency graph:
37
+
38
+```
39
+a
40
++-- b <-- depends on c@1.0.x
41
+| `-- c@1.0.3
42
+`-- d <-- depends on c@~1.0.9
43
+ `-- c@1.0.10
44
+```
45
+
46
+In this case, `npm dedupe` will transform the tree to:
47
+
48
+```bash
49
+a
50
++-- b
51
++-- d
52
+`-- c@1.0.10
53
+```
54
+
55
+Because of the hierarchical nature of node's module lookup, b and d
56
+will both get their dependency met by the single c package at the root
57
+level of the tree.
58
+
59
+In some cases, you may have a dependency graph like this:
60
+
61
+```
62
+a
63
++-- b <-- depends on c@1.0.x
64
++-- c@1.0.3
65
+`-- d <-- depends on c@1.x
66
+ `-- c@1.9.9
67
+```
68
+
69
+During the installation process, the `c@1.0.3` dependency for `b` was
70
+placed in the root of the tree. Though `d`'s dependency on `c@1.x` could
71
+have been satisfied by `c@1.0.3`, the newer `c@1.9.0` dependency was used,
72
+because npm favors updates by default, even when doing so causes
73
+duplication.
74
+
75
+Running `npm dedupe` will cause npm to note the duplication and
76
+re-evaluate, deleting the nested `c` module, because the one in the root is
77
+sufficient.
78
+
79
+To prefer deduplication over novelty during the installation process, run
80
+`npm install --prefer-dedupe` or `npm config set prefer-dedupe true`.
81
+
82
+Arguments are ignored. Dedupe always acts on the entire tree.
83
+
84
+Note that this operation transforms the dependency tree, but will never
85
+result in new modules being installed.
86
+
87
+Using `npm find-dupes` will run the command in `--dry-run` mode.
88
+
89
+Note: `npm dedupe` will never update the semver values of direct
90
+dependencies in your project `package.json`, if you want to update
91
+values in `package.json` you can run: `npm update --save` instead.
92
+
93
+### Configuration
94
+
95
+#### `install-strategy`
96
+
97
+* Default: "hoisted"
98
+* Type: "hoisted", "nested", "shallow", or "linked"
99
+
100
+Sets the strategy for installing packages in node_modules. hoisted
101
+(default): Install non-duplicated in top-level, and duplicated as necessary
102
+within directory structure. nested: (formerly --legacy-bundling) install in
103
+place, no hoisting. shallow (formerly --global-style) only install direct
104
+deps at top-level. linked: (experimental) install in node_modules/.store,
105
+link in place, unhoisted.
106
+
107
+
108
+
109
+#### `legacy-bundling`
110
+
111
+* Default: false
112
+* Type: Boolean
113
+* DEPRECATED: This option has been deprecated in favor of
114
+ `--install-strategy=nested`
115
+
116
+Instead of hoisting package installs in `node_modules`, install packages in
117
+the same manner that they are depended on. This may cause very deep
118
+directory structures and duplicate package installs as there is no
119
+de-duplicating. Sets `--install-strategy=nested`.
120
+
121
+
122
+
123
+#### `global-style`
124
+
125
+* Default: false
126
+* Type: Boolean
127
+* DEPRECATED: This option has been deprecated in favor of
128
+ `--install-strategy=shallow`
129
+
130
+Only install direct dependencies in the top level `node_modules`, but hoist
131
+on deeper dependencies. Sets `--install-strategy=shallow`.
132
+
133
+
134
+
135
+#### `strict-peer-deps`
136
+
137
+* Default: false
138
+* Type: Boolean
139
+
140
+If set to `true`, and `--legacy-peer-deps` is not set, then _any_
141
+conflicting `peerDependencies` will be treated as an install failure, even
142
+if npm could reasonably guess the appropriate resolution based on non-peer
143
+dependency relationships.
144
+
145
+By default, conflicting `peerDependencies` deep in the dependency graph will
146
+be resolved using the nearest non-peer dependency specification, even if
147
+doing so will result in some packages receiving a peer dependency outside
148
+the range set in their package's `peerDependencies` object.
149
+
150
+When such an override is performed, a warning is printed, explaining the
151
+conflict and the packages involved. If `--strict-peer-deps` is set, then
152
+this warning is treated as a failure.
153
+
154
+
155
+
156
+#### `package-lock`
157
+
158
+* Default: true
159
+* Type: Boolean
160
+
161
+If set to false, then ignore `package-lock.json` files when installing. This
162
+will also prevent _writing_ `package-lock.json` if `save` is true.
163
+
164
+
165
+
166
+#### `omit`
167
+
168
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
169
+ 'production', otherwise empty.
170
+* Type: "dev", "optional", or "peer" (can be set multiple times)
171
+
172
+Dependency types to omit from the installation tree on disk.
173
+
174
+Note that these dependencies _are_ still resolved and added to the
175
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
176
+physically installed on disk.
177
+
178
+If a package type appears in both the `--include` and `--omit` lists, then
179
+it will be included.
180
+
181
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
182
+variable will be set to `'production'` for all lifecycle scripts.
183
+
184
+
185
+
186
+#### `ignore-scripts`
187
+
188
+* Default: false
189
+* Type: Boolean
190
+
191
+If true, npm does not run scripts specified in package.json files.
192
+
193
+Note that commands explicitly intended to run a particular script, such as
194
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
195
+will still run their intended script if `ignore-scripts` is set, but they
196
+will *not* run any pre- or post-scripts.
197
+
198
+
199
+
200
+#### `audit`
201
+
202
+* Default: true
203
+* Type: Boolean
204
+
205
+When "true" submit audit reports alongside the current npm command to the
206
+default registry and all registries configured for scopes. See the
207
+documentation for [`npm audit`](/cli/v10/commands/npm-audit) for details on what is
208
+submitted.
209
+
210
+
211
+
212
+#### `bin-links`
213
+
214
+* Default: true
215
+* Type: Boolean
216
+
217
+Tells npm to create symlinks (or `.cmd` shims on Windows) for package
218
+executables.
219
+
220
+Set to false to have it not do this. This can be used to work around the
221
+fact that some file systems don't support symlinks, even on ostensibly Unix
222
+systems.
223
+
224
+
225
+
226
+#### `fund`
227
+
228
+* Default: true
229
+* Type: Boolean
230
+
231
+When "true" displays the message at the end of each `npm install`
232
+acknowledging the number of dependencies looking for funding. See [`npm
233
+fund`](/cli/v10/commands/npm-fund) for details.
234
+
235
+
236
+
237
+#### `dry-run`
238
+
239
+* Default: false
240
+* Type: Boolean
241
+
242
+Indicates that you don't want npm to make any changes and that it should
243
+only report what it would have done. This can be passed into any of the
244
+commands that modify your local installation, eg, `install`, `update`,
245
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
246
+
247
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
248
+`owner`, etc.
249
+
250
+
251
+
252
+#### `workspace`
253
+
254
+* Default:
255
+* Type: String (can be set multiple times)
256
+
257
+Enable running a command in the context of the configured workspaces of the
258
+current project while filtering by running only the workspaces defined by
259
+this configuration option.
260
+
261
+Valid values for the `workspace` config are either:
262
+
263
+* Workspace names
264
+* Path to a workspace directory
265
+* Path to a parent workspace directory (will result in selecting all
266
+ workspaces within that folder)
267
+
268
+When set for the `npm init` command, this may be set to the folder of a
269
+workspace which does not yet exist, to create the folder and set it up as a
270
+brand new workspace within the project.
271
+
272
+This value is not exported to the environment for child processes.
273
+
274
+#### `workspaces`
275
+
276
+* Default: null
277
+* Type: null or Boolean
278
+
279
+Set to true to run the command in the context of **all** configured
280
+workspaces.
281
+
282
+Explicitly setting this to false will cause commands like `install` to
283
+ignore workspaces altogether. When not set explicitly:
284
+
285
+- Commands that operate on the `node_modules` tree (install, update, etc.)
286
+will link workspaces into the `node_modules` folder. - Commands that do
287
+other things (test, exec, publish, etc.) will operate on the root project,
288
+_unless_ one or more workspaces are specified in the `workspace` config.
289
+
290
+This value is not exported to the environment for child processes.
291
+
292
+#### `include-workspace-root`
293
+
294
+* Default: false
295
+* Type: Boolean
296
+
297
+Include the workspace root when workspaces are enabled for a command.
298
+
299
+When false, specifying individual workspaces via the `workspace` config, or
300
+all workspaces via the `workspaces` flag, will cause npm to operate only on
301
+the specified workspaces, and not on the root project.
302
+
303
+This value is not exported to the environment for child processes.
304
+
305
+#### `install-links`
306
+
307
+* Default: false
308
+* Type: Boolean
309
+
310
+When set file: protocol dependencies will be packed and installed as regular
311
+dependencies instead of creating a symlink. This option has no effect on
312
+workspaces.
313
+
314
+
315
+
316
+### See Also
317
+
318
+* [npm find-dupes](/cli/v10/commands/npm-find-dupes)
319
+* [npm ls](/cli/v10/commands/npm-ls)
320
+* [npm update](/cli/v10/commands/npm-update)
321
+* [npm install](/cli/v10/commands/npm-install)
content/cli/v10/commands/npm-deprecate.md
new
+88
@@ -0,0 +1,88 @@
1
+---
2
+title: npm-deprecate
3
+section: 1
4
+description: Deprecate a version of a package
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-deprecate.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/deprecate
10
+ - /cli-documentation/v10/cli-commands/npm-deprecate
11
+ - /cli-documentation/v10/commands/deprecate
12
+ - /cli-documentation/v10/commands/npm-deprecate
13
+ - /cli-documentation/v10/deprecate
14
+ - /cli-documentation/v10/npm-deprecate
15
+ - /cli/v10/cli-commands/deprecate
16
+ - /cli/v10/cli-commands/npm-deprecate
17
+ - /cli/v10/commands/deprecate
18
+ - /cli/v10/deprecate
19
+ - /cli/v10/npm-deprecate
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm deprecate <package-spec> <message>
26
+```
27
+
28
+Note: This command is unaware of workspaces.
29
+
30
+### Description
31
+
32
+This command will update the npm registry entry for a package, providing a
33
+deprecation warning to all who attempt to install it.
34
+
35
+It works on [version ranges](https://semver.npmjs.com/) as well as specific
36
+versions, so you can do something like this:
37
+
38
+```bash
39
+npm deprecate my-thing@"< 0.2.3" "critical bug fixed in v0.2.3"
40
+```
41
+
42
+SemVer ranges passed to this command are interpreted such that they *do*
43
+include prerelease versions. For example:
44
+
45
+```bash
46
+npm deprecate my-thing@1.x "1.x is no longer supported"
47
+```
48
+
49
+In this case, a version `my-thing@1.0.0-beta.0` will also be deprecated.
50
+
51
+You must be the package owner to deprecate something. See the `owner` and
52
+`adduser` help topics.
53
+
54
+To un-deprecate a package, specify an empty string (`""`) for the `message`
55
+argument. Note that you must use double quotes with no space between them to
56
+format an empty string.
57
+
58
+### Configuration
59
+
60
+#### `registry`
61
+
62
+* Default: "https://registry.npmjs.org/"
63
+* Type: URL
64
+
65
+The base URL of the npm registry.
66
+
67
+
68
+
69
+#### `otp`
70
+
71
+* Default: null
72
+* Type: null or String
73
+
74
+This is a one-time password from a two-factor authenticator. It's needed
75
+when publishing or changing package permissions with `npm access`.
76
+
77
+If not set, and a registry response fails with a challenge for a one-time
78
+password, npm will prompt on the command line for one.
79
+
80
+
81
+
82
+### See Also
83
+
84
+* [package spec](/cli/v10/using-npm/package-spec)
85
+* [npm publish](/cli/v10/commands/npm-publish)
86
+* [npm registry](/cli/v10/using-npm/registry)
87
+* [npm owner](/cli/v10/commands/npm-owner)
88
+* [npm adduser](/cli/v10/commands/npm-adduser)
content/cli/v10/commands/npm-diff.md
new
+331
@@ -0,0 +1,331 @@
1
+---
2
+title: npm-diff
3
+section: 1
4
+description: The registry diff command
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-diff.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/diff
10
+ - /cli-documentation/v10/cli-commands/npm-diff
11
+ - /cli-documentation/v10/commands/diff
12
+ - /cli-documentation/v10/commands/npm-diff
13
+ - /cli-documentation/v10/diff
14
+ - /cli-documentation/v10/npm-diff
15
+ - /cli/v10/cli-commands/diff
16
+ - /cli/v10/cli-commands/npm-diff
17
+ - /cli/v10/commands/diff
18
+ - /cli/v10/diff
19
+ - /cli/v10/npm-diff
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm diff [...<paths>]
26
+```
27
+
28
+### Description
29
+
30
+Similar to its `git diff` counterpart, this command will print diff patches
31
+of files for packages published to the npm registry.
32
+
33
+* `npm diff --diff=<spec-a> --diff=<spec-b>`
34
+
35
+ Compares two package versions using their registry specifiers, e.g:
36
+ `npm diff --diff=pkg@1.0.0 --diff=pkg@^2.0.0`. It's also possible to
37
+ compare across forks of any package,
38
+ e.g: `npm diff --diff=pkg@1.0.0 --diff=pkg-fork@1.0.0`.
39
+
40
+ Any valid spec can be used, so that it's also possible to compare
41
+ directories or git repositories,
42
+ e.g: `npm diff --diff=pkg@latest --diff=./packages/pkg`
43
+
44
+ Here's an example comparing two different versions of a package named
45
+ `abbrev` from the registry:
46
+
47
+ ```bash
48
+ npm diff --diff=abbrev@1.1.0 --diff=abbrev@1.1.1
49
+ ```
50
+
51
+ On success, output looks like:
52
+
53
+ ```bash
54
+ diff --git a/package.json b/package.json
55
+ index v1.1.0..v1.1.1 100644
56
+ --- a/package.json
57
+ +++ b/package.json
58
+ @@ -1,6 +1,6 @@
59
+ {
60
+ "name": "abbrev",
61
+ - "version": "1.1.0",
62
+ + "version": "1.1.1",
63
+ "description": "Like ruby's abbrev module, but in js",
64
+ "author": "Isaac Z. Schlueter <i@izs.me>",
65
+ "main": "abbrev.js",
66
+ ```
67
+
68
+ Given the flexible nature of npm specs, you can also target local
69
+ directories or git repos just like when using `npm install`:
70
+
71
+ ```bash
72
+ npm diff --diff=https://github.com/npm/libnpmdiff --diff=./local-path
73
+ ```
74
+
75
+ In the example above we can compare the contents from the package installed
76
+ from the git repo at `github.com/npm/libnpmdiff` with the contents of the
77
+ `./local-path` that contains a valid package, such as a modified copy of
78
+ the original.
79
+
80
+* `npm diff` (in a package directory, no arguments):
81
+
82
+ If the package is published to the registry, `npm diff` will fetch the
83
+ tarball version tagged as `latest` (this value can be configured using the
84
+ `tag` option) and proceed to compare the contents of files present in that
85
+ tarball, with the current files in your local file system.
86
+
87
+ This workflow provides a handy way for package authors to see what
88
+ package-tracked files have been changed in comparison with the latest
89
+ published version of that package.
90
+
91
+* `npm diff --diff=<pkg-name>` (in a package directory):
92
+
93
+ When using a single package name (with no version or tag specifier) as an
94
+ argument, `npm diff` will work in a similar way to
95
+ [`npm-outdated`](npm-outdated) and reach for the registry to figure out
96
+ what current published version of the package named `<pkg-name>`
97
+ will satisfy its dependent declared semver-range. Once that specific
98
+ version is known `npm diff` will print diff patches comparing the
99
+ current version of `<pkg-name>` found in the local file system with
100
+ that specific version returned by the registry.
101
+
102
+ Given a package named `abbrev` that is currently installed:
103
+
104
+ ```bash
105
+ npm diff --diff=abbrev
106
+ ```
107
+
108
+ That will request from the registry its most up to date version and
109
+ will print a diff output comparing the currently installed version to this
110
+ newer one if the version numbers are not the same.
111
+
112
+* `npm diff --diff=<spec-a>` (in a package directory):
113
+
114
+ Similar to using only a single package name, it's also possible to declare
115
+ a full registry specifier version if you wish to compare the local version
116
+ of an installed package with the specific version/tag/semver-range provided
117
+ in `<spec-a>`.
118
+
119
+ An example: assuming `pkg@1.0.0` is installed in the current `node_modules`
120
+ folder, running:
121
+
122
+ ```bash
123
+ npm diff --diff=pkg@2.0.0
124
+ ```
125
+
126
+ It will effectively be an alias to
127
+ `npm diff --diff=pkg@1.0.0 --diff=pkg@2.0.0`.
128
+
129
+* `npm diff --diff=<semver-a> [--diff=<semver-b>]` (in a package directory):
130
+
131
+ Using `npm diff` along with semver-valid version numbers is a shorthand
132
+ to compare different versions of the current package.
133
+
134
+ It needs to be run from a package directory, such that for a package named
135
+ `pkg` running `npm diff --diff=1.0.0 --diff=1.0.1` is the same as running
136
+ `npm diff --diff=pkg@1.0.0 --diff=pkg@1.0.1`.
137
+
138
+ If only a single argument `<version-a>` is provided, then the current local
139
+ file system is going to be compared against that version.
140
+
141
+ Here's an example comparing two specific versions (published to the
142
+ configured registry) of the current project directory:
143
+
144
+ ```bash
145
+ npm diff --diff=1.0.0 --diff=1.1.0
146
+ ```
147
+
148
+Note that tag names are not valid `--diff` argument values, if you wish to
149
+compare to a published tag, you must use the `pkg@tagname` syntax.
150
+
151
+#### Filtering files
152
+
153
+It's possible to also specify positional arguments using file names or globs
154
+pattern matching in order to limit the result of diff patches to only a subset
155
+of files for a given package, e.g:
156
+
157
+ ```bash
158
+ npm diff --diff=pkg@2 ./lib/ CHANGELOG.md
159
+ ```
160
+
161
+In the example above the diff output is only going to print contents of files
162
+located within the folder `./lib/` and changed lines of code within the
163
+`CHANGELOG.md` file.
164
+
165
+### Configuration
166
+
167
+#### `diff`
168
+
169
+* Default:
170
+* Type: String (can be set multiple times)
171
+
172
+Define arguments to compare in `npm diff`.
173
+
174
+
175
+
176
+#### `diff-name-only`
177
+
178
+* Default: false
179
+* Type: Boolean
180
+
181
+Prints only filenames when using `npm diff`.
182
+
183
+
184
+
185
+#### `diff-unified`
186
+
187
+* Default: 3
188
+* Type: Number
189
+
190
+The number of lines of context to print in `npm diff`.
191
+
192
+
193
+
194
+#### `diff-ignore-all-space`
195
+
196
+* Default: false
197
+* Type: Boolean
198
+
199
+Ignore whitespace when comparing lines in `npm diff`.
200
+
201
+
202
+
203
+#### `diff-no-prefix`
204
+
205
+* Default: false
206
+* Type: Boolean
207
+
208
+Do not show any source or destination prefix in `npm diff` output.
209
+
210
+Note: this causes `npm diff` to ignore the `--diff-src-prefix` and
211
+`--diff-dst-prefix` configs.
212
+
213
+
214
+
215
+#### `diff-src-prefix`
216
+
217
+* Default: "a/"
218
+* Type: String
219
+
220
+Source prefix to be used in `npm diff` output.
221
+
222
+
223
+
224
+#### `diff-dst-prefix`
225
+
226
+* Default: "b/"
227
+* Type: String
228
+
229
+Destination prefix to be used in `npm diff` output.
230
+
231
+
232
+
233
+#### `diff-text`
234
+
235
+* Default: false
236
+* Type: Boolean
237
+
238
+Treat all files as text in `npm diff`.
239
+
240
+
241
+
242
+#### `global`
243
+
244
+* Default: false
245
+* Type: Boolean
246
+
247
+Operates in "global" mode, so that packages are installed into the `prefix`
248
+folder instead of the current working directory. See
249
+[folders](/cli/v10/configuring-npm/folders) for more on the differences in behavior.
250
+
251
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
252
+ of the current working directory.
253
+* bin files are linked to `{prefix}/bin`
254
+* man pages are linked to `{prefix}/share/man`
255
+
256
+
257
+
258
+#### `tag`
259
+
260
+* Default: "latest"
261
+* Type: String
262
+
263
+If you ask npm to install a package and don't tell it a specific version,
264
+then it will install the specified tag.
265
+
266
+Also the tag that is added to the package@version specified by the `npm tag`
267
+command, if no explicit tag is given.
268
+
269
+When used by the `npm diff` command, this is the tag used to fetch the
270
+tarball that will be compared with the local files by default.
271
+
272
+
273
+
274
+#### `workspace`
275
+
276
+* Default:
277
+* Type: String (can be set multiple times)
278
+
279
+Enable running a command in the context of the configured workspaces of the
280
+current project while filtering by running only the workspaces defined by
281
+this configuration option.
282
+
283
+Valid values for the `workspace` config are either:
284
+
285
+* Workspace names
286
+* Path to a workspace directory
287
+* Path to a parent workspace directory (will result in selecting all
288
+ workspaces within that folder)
289
+
290
+When set for the `npm init` command, this may be set to the folder of a
291
+workspace which does not yet exist, to create the folder and set it up as a
292
+brand new workspace within the project.
293
+
294
+This value is not exported to the environment for child processes.
295
+
296
+#### `workspaces`
297
+
298
+* Default: null
299
+* Type: null or Boolean
300
+
301
+Set to true to run the command in the context of **all** configured
302
+workspaces.
303
+
304
+Explicitly setting this to false will cause commands like `install` to
305
+ignore workspaces altogether. When not set explicitly:
306
+
307
+- Commands that operate on the `node_modules` tree (install, update, etc.)
308
+will link workspaces into the `node_modules` folder. - Commands that do
309
+other things (test, exec, publish, etc.) will operate on the root project,
310
+_unless_ one or more workspaces are specified in the `workspace` config.
311
+
312
+This value is not exported to the environment for child processes.
313
+
314
+#### `include-workspace-root`
315
+
316
+* Default: false
317
+* Type: Boolean
318
+
319
+Include the workspace root when workspaces are enabled for a command.
320
+
321
+When false, specifying individual workspaces via the `workspace` config, or
322
+all workspaces via the `workspaces` flag, will cause npm to operate only on
323
+the specified workspaces, and not on the root project.
324
+
325
+This value is not exported to the environment for child processes.
326
+## See Also
327
+
328
+* [npm outdated](/cli/v10/commands/npm-outdated)
329
+* [npm install](/cli/v10/commands/npm-install)
330
+* [npm config](/cli/v10/commands/npm-config)
331
+* [npm registry](/cli/v10/using-npm/registry)
content/cli/v10/commands/npm-dist-tag.md
new
+169
@@ -0,0 +1,169 @@
1
+---
2
+title: npm-dist-tag
3
+section: 1
4
+description: Modify package distribution tags
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-dist-tag.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/dist-tag
10
+ - /cli-documentation/v10/cli-commands/npm-dist-tag
11
+ - /cli-documentation/v10/commands/dist-tag
12
+ - /cli-documentation/v10/commands/npm-dist-tag
13
+ - /cli-documentation/v10/dist-tag
14
+ - /cli-documentation/v10/npm-dist-tag
15
+ - /cli/v10/cli-commands/dist-tag
16
+ - /cli/v10/cli-commands/npm-dist-tag
17
+ - /cli/v10/commands/dist-tag
18
+ - /cli/v10/dist-tag
19
+ - /cli/v10/npm-dist-tag
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm dist-tag add <package-spec (with version)> [<tag>]
26
+npm dist-tag rm <package-spec> <tag>
27
+npm dist-tag ls [<package-spec>]
28
+
29
+alias: dist-tags
30
+```
31
+
32
+### Description
33
+
34
+Add, remove, and enumerate distribution tags on a package:
35
+
36
+* add: Tags the specified version of the package with the specified tag,
37
+ or the [`--tag` config](/cli/v10/using-npm/config#tag) if not specified. If you have
38
+ two-factor authentication on auth-and-writes then you’ll need to include a
39
+ one-time password on the command line with
40
+ `--otp <one-time password>`, or go through a second factor flow based on your `authtype`.
41
+
42
+* rm: Clear a tag that is no longer in use from the package. If you have
43
+ two-factor authentication on auth-and-writes then you’ll need to include
44
+ a one-time password on the command line with `--otp <one-time password>`,
45
+ or go through a second factor flow based on your `authtype`
46
+
47
+* ls: Show all of the dist-tags for a package, defaulting to the package in
48
+ the current prefix. This is the default action if none is specified.
49
+
50
+A tag can be used when installing packages as a reference to a version instead
51
+of using a specific version number:
52
+
53
+```bash
54
+npm install <name>@<tag>
55
+```
56
+
57
+When installing dependencies, a preferred tagged version may be specified:
58
+
59
+```bash
60
+npm install --tag <tag>
61
+```
62
+
63
+(This also applies to any other commands that resolve and install
64
+dependencies, such as `npm dedupe`, `npm update`, and `npm audit fix`.)
65
+
66
+Publishing a package sets the `latest` tag to the published version unless the
67
+`--tag` option is used. For example, `npm publish --tag=beta`.
68
+
69
+By default, `npm install <pkg>` (without any `@<version>` or `@<tag>`
70
+specifier) installs the `latest` tag.
71
+
72
+### Purpose
73
+
74
+Tags can be used to provide an alias instead of version numbers.
75
+
76
+For example, a project might choose to have multiple streams of development
77
+and use a different tag for each stream, e.g., `stable`, `beta`, `dev`,
78
+`canary`.
79
+
80
+By default, the `latest` tag is used by npm to identify the current version
81
+of a package, and `npm install <pkg>` (without any `@<version>` or `@<tag>`
82
+specifier) installs the `latest` tag. Typically, projects only use the
83
+`latest` tag for stable release versions, and use other tags for unstable
84
+versions such as prereleases.
85
+
86
+The `next` tag is used by some projects to identify the upcoming version.
87
+
88
+Other than `latest`, no tag has any special significance to npm itself.
89
+
90
+### Caveats
91
+
92
+This command used to be known as `npm tag`, which only created new tags,
93
+and so had a different syntax.
94
+
95
+Tags must share a namespace with version numbers, because they are
96
+specified in the same slot: `npm install <pkg>@<version>` vs
97
+`npm install <pkg>@<tag>`.
98
+
99
+Tags that can be interpreted as valid semver ranges will be rejected. For
100
+example, `v1.4` cannot be used as a tag, because it is interpreted by
101
+semver as `>=1.4.0 <1.5.0`. See <https://github.com/npm/npm/issues/6082>.
102
+
103
+The simplest way to avoid semver problems with tags is to use tags that do
104
+not begin with a number or the letter `v`.
105
+
106
+### Configuration
107
+
108
+#### `workspace`
109
+
110
+* Default:
111
+* Type: String (can be set multiple times)
112
+
113
+Enable running a command in the context of the configured workspaces of the
114
+current project while filtering by running only the workspaces defined by
115
+this configuration option.
116
+
117
+Valid values for the `workspace` config are either:
118
+
119
+* Workspace names
120
+* Path to a workspace directory
121
+* Path to a parent workspace directory (will result in selecting all
122
+ workspaces within that folder)
123
+
124
+When set for the `npm init` command, this may be set to the folder of a
125
+workspace which does not yet exist, to create the folder and set it up as a
126
+brand new workspace within the project.
127
+
128
+This value is not exported to the environment for child processes.
129
+
130
+#### `workspaces`
131
+
132
+* Default: null
133
+* Type: null or Boolean
134
+
135
+Set to true to run the command in the context of **all** configured
136
+workspaces.
137
+
138
+Explicitly setting this to false will cause commands like `install` to
139
+ignore workspaces altogether. When not set explicitly:
140
+
141
+- Commands that operate on the `node_modules` tree (install, update, etc.)
142
+will link workspaces into the `node_modules` folder. - Commands that do
143
+other things (test, exec, publish, etc.) will operate on the root project,
144
+_unless_ one or more workspaces are specified in the `workspace` config.
145
+
146
+This value is not exported to the environment for child processes.
147
+
148
+#### `include-workspace-root`
149
+
150
+* Default: false
151
+* Type: Boolean
152
+
153
+Include the workspace root when workspaces are enabled for a command.
154
+
155
+When false, specifying individual workspaces via the `workspace` config, or
156
+all workspaces via the `workspaces` flag, will cause npm to operate only on
157
+the specified workspaces, and not on the root project.
158
+
159
+This value is not exported to the environment for child processes.
160
+
161
+### See Also
162
+
163
+* [package spec](/cli/v10/using-npm/package-spec)
164
+* [npm publish](/cli/v10/commands/npm-publish)
165
+* [npm install](/cli/v10/commands/npm-install)
166
+* [npm dedupe](/cli/v10/commands/npm-dedupe)
167
+* [npm registry](/cli/v10/using-npm/registry)
168
+* [npm config](/cli/v10/commands/npm-config)
169
+* [npmrc](/cli/v10/configuring-npm/npmrc)
content/cli/v10/commands/npm-docs.md
new
+123
@@ -0,0 +1,123 @@
1
+---
2
+title: npm-docs
3
+section: 1
4
+description: Open documentation for a package in a web browser
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-docs.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/docs
10
+ - /cli-documentation/v10/cli-commands/npm-docs
11
+ - /cli-documentation/v10/commands/docs
12
+ - /cli-documentation/v10/commands/npm-docs
13
+ - /cli-documentation/v10/docs
14
+ - /cli-documentation/v10/npm-docs
15
+ - /cli/v10/cli-commands/docs
16
+ - /cli/v10/cli-commands/npm-docs
17
+ - /cli/v10/commands/docs
18
+ - /cli/v10/docs
19
+ - /cli/v10/npm-docs
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm docs [<pkgname> [<pkgname> ...]]
26
+
27
+alias: home
28
+```
29
+
30
+### Description
31
+
32
+This command tries to guess at the likely location of a package's
33
+documentation URL, and then tries to open it using the
34
+[`--browser` config](/cli/v10/using-npm/config#browser) param. You can pass multiple
35
+package names at once. If no package name is provided, it will search for a
36
+`package.json` in the current folder and use the `name` property.
37
+
38
+### Configuration
39
+
40
+#### `browser`
41
+
42
+* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
43
+* Type: null, Boolean, or String
44
+
45
+The browser that is called by npm commands to open websites.
46
+
47
+Set to `false` to suppress browser behavior and instead print urls to
48
+terminal.
49
+
50
+Set to `true` to use default system URL opener.
51
+
52
+
53
+
54
+#### `registry`
55
+
56
+* Default: "https://registry.npmjs.org/"
57
+* Type: URL
58
+
59
+The base URL of the npm registry.
60
+
61
+
62
+
63
+#### `workspace`
64
+
65
+* Default:
66
+* Type: String (can be set multiple times)
67
+
68
+Enable running a command in the context of the configured workspaces of the
69
+current project while filtering by running only the workspaces defined by
70
+this configuration option.
71
+
72
+Valid values for the `workspace` config are either:
73
+
74
+* Workspace names
75
+* Path to a workspace directory
76
+* Path to a parent workspace directory (will result in selecting all
77
+ workspaces within that folder)
78
+
79
+When set for the `npm init` command, this may be set to the folder of a
80
+workspace which does not yet exist, to create the folder and set it up as a
81
+brand new workspace within the project.
82
+
83
+This value is not exported to the environment for child processes.
84
+
85
+#### `workspaces`
86
+
87
+* Default: null
88
+* Type: null or Boolean
89
+
90
+Set to true to run the command in the context of **all** configured
91
+workspaces.
92
+
93
+Explicitly setting this to false will cause commands like `install` to
94
+ignore workspaces altogether. When not set explicitly:
95
+
96
+- Commands that operate on the `node_modules` tree (install, update, etc.)
97
+will link workspaces into the `node_modules` folder. - Commands that do
98
+other things (test, exec, publish, etc.) will operate on the root project,
99
+_unless_ one or more workspaces are specified in the `workspace` config.
100
+
101
+This value is not exported to the environment for child processes.
102
+
103
+#### `include-workspace-root`
104
+
105
+* Default: false
106
+* Type: Boolean
107
+
108
+Include the workspace root when workspaces are enabled for a command.
109
+
110
+When false, specifying individual workspaces via the `workspace` config, or
111
+all workspaces via the `workspaces` flag, will cause npm to operate only on
112
+the specified workspaces, and not on the root project.
113
+
114
+This value is not exported to the environment for child processes.
115
+
116
+### See Also
117
+
118
+* [npm view](/cli/v10/commands/npm-view)
119
+* [npm publish](/cli/v10/commands/npm-publish)
120
+* [npm registry](/cli/v10/using-npm/registry)
121
+* [npm config](/cli/v10/commands/npm-config)
122
+* [npmrc](/cli/v10/configuring-npm/npmrc)
123
+* [package.json](/cli/v10/configuring-npm/package-json)
content/cli/v10/commands/npm-doctor.md
new
+137
@@ -0,0 +1,137 @@
1
+---
2
+title: npm-doctor
3
+section: 1
4
+description: Check your npm environment
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-doctor.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/doctor
10
+ - /cli-documentation/v10/cli-commands/npm-doctor
11
+ - /cli-documentation/v10/commands/doctor
12
+ - /cli-documentation/v10/commands/npm-doctor
13
+ - /cli-documentation/v10/doctor
14
+ - /cli-documentation/v10/npm-doctor
15
+ - /cli/v10/cli-commands/doctor
16
+ - /cli/v10/cli-commands/npm-doctor
17
+ - /cli/v10/commands/doctor
18
+ - /cli/v10/doctor
19
+ - /cli/v10/npm-doctor
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm doctor [ping] [registry] [versions] [environment] [permissions] [cache]
26
+```
27
+
28
+Note: This command is unaware of workspaces.
29
+
30
+### Description
31
+
32
+`npm doctor` runs a set of checks to ensure that your npm installation has
33
+what it needs to manage your JavaScript packages. npm is mostly a
34
+standalone tool, but it does have some basic requirements that must be met:
35
+
36
++ Node.js and git must be executable by npm.
37
++ The primary npm registry, `registry.npmjs.com`, or another service that
38
+ uses the registry API, is available.
39
++ The directories that npm uses, `node_modules` (both locally and
40
+ globally), exist and can be written by the current user.
41
++ The npm cache exists, and the package tarballs within it aren't corrupt.
42
+
43
+Without all of these working properly, npm may not work properly. Many
44
+issues are often attributable to things that are outside npm's code base,
45
+so `npm doctor` confirms that the npm installation is in a good state.
46
+
47
+Also, in addition to this, there are also very many issue reports due to
48
+using old versions of npm. Since npm is constantly improving, running
49
+`npm@latest` is better than an old version.
50
+
51
+`npm doctor` verifies the following items in your environment, and if
52
+there are any recommended changes, it will display them. By default npm
53
+runs all of these checks. You can limit what checks are ran by
54
+specifying them as extra arguments.
55
+
56
+#### `npm ping`
57
+
58
+By default, npm installs from the primary npm registry,
59
+`registry.npmjs.org`. `npm doctor` hits a special ping endpoint within the
60
+registry. This can also be checked with `npm ping`. If this check fails,
61
+you may be using a proxy that needs to be configured, or may need to talk
62
+to your IT staff to get access over HTTPS to `registry.npmjs.org`.
63
+
64
+This check is done against whichever registry you've configured (you can
65
+see what that is by running `npm config get registry`), and if you're using
66
+a private registry that doesn't support the `/whoami` endpoint supported by
67
+the primary registry, this check may fail.
68
+
69
+#### `npm -v`
70
+
71
+While Node.js may come bundled with a particular version of npm, it's the
72
+policy of the CLI team that we recommend all users run `npm@latest` if they
73
+can. As the CLI is maintained by a small team of contributors, there are
74
+only resources for a single line of development, so npm's own long-term
75
+support releases typically only receive critical security and regression
76
+fixes. The team believes that the latest tested version of npm is almost
77
+always likely to be the most functional and defect-free version of npm.
78
+
79
+#### `node -v`
80
+
81
+For most users, in most circumstances, the best version of Node will be the
82
+latest long-term support (LTS) release. Those of you who want access to new
83
+ECMAscript features or bleeding-edge changes to Node's standard library may
84
+be running a newer version, and some may be required to run an older
85
+version of Node because of enterprise change control policies. That's OK!
86
+But in general, the npm team recommends that most users run Node.js LTS.
87
+
88
+#### `npm config get registry`
89
+
90
+You may be installing from private package registries for your project or
91
+company. That's great! Others may be following tutorials or StackOverflow
92
+questions in an effort to troubleshoot problems you may be having.
93
+Sometimes, this may entail changing the registry you're pointing at. This
94
+part of `npm doctor` just lets you, and maybe whoever's helping you with
95
+support, know that you're not using the default registry.
96
+
97
+#### `which git`
98
+
99
+While it's documented in the README, it may not be obvious that npm needs
100
+Git installed to do many of the things that it does. Also, in some cases
101
+– especially on Windows – you may have Git set up in such a way that it's
102
+not accessible via your `PATH` so that npm can find it. This check ensures
103
+that Git is available.
104
+
105
+#### Permissions checks
106
+
107
+* Your cache must be readable and writable by the user running npm.
108
+* Global package binaries must be writable by the user running npm.
109
+* Your local `node_modules` path, if you're running `npm doctor` with a
110
+ project directory, must be readable and writable by the user running npm.
111
+
112
+#### Validate the checksums of cached packages
113
+
114
+When an npm package is published, the publishing process generates a
115
+checksum that npm uses at install time to verify that the package didn't
116
+get corrupted in transit. `npm doctor` uses these checksums to validate the
117
+package tarballs in your local cache (you can see where that cache is
118
+located with `npm config get cache`). In the event that there are corrupt
119
+packages in your cache, you should probably run `npm cache clean -f` and
120
+reset the cache.
121
+
122
+### Configuration
123
+
124
+#### `registry`
125
+
126
+* Default: "https://registry.npmjs.org/"
127
+* Type: URL
128
+
129
+The base URL of the npm registry.
130
+
131
+
132
+
133
+### See Also
134
+
135
+* [npm bugs](/cli/v10/commands/npm-bugs)
136
+* [npm help](/cli/v10/commands/npm-help)
137
+* [npm ping](/cli/v10/commands/npm-ping)
content/cli/v10/commands/npm-edit.md
new
+61
@@ -0,0 +1,61 @@
1
+---
2
+title: npm-edit
3
+section: 1
4
+description: Edit an installed package
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-edit.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/edit
10
+ - /cli-documentation/v10/cli-commands/npm-edit
11
+ - /cli-documentation/v10/commands/edit
12
+ - /cli-documentation/v10/commands/npm-edit
13
+ - /cli-documentation/v10/edit
14
+ - /cli-documentation/v10/npm-edit
15
+ - /cli/v10/cli-commands/edit
16
+ - /cli/v10/cli-commands/npm-edit
17
+ - /cli/v10/commands/edit
18
+ - /cli/v10/edit
19
+ - /cli/v10/npm-edit
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm edit <pkg>[/<subpkg>...]
26
+```
27
+
28
+Note: This command is unaware of workspaces.
29
+
30
+### Description
31
+
32
+Selects a dependency in the current project and opens the package folder in
33
+the default editor (or whatever you've configured as the npm `editor`
34
+config -- see [`npm-config`](npm-config).)
35
+
36
+After it has been edited, the package is rebuilt so as to pick up any
37
+changes in compiled packages.
38
+
39
+For instance, you can do `npm install connect` to install connect
40
+into your package, and then `npm edit connect` to make a few
41
+changes to your locally installed copy.
42
+
43
+### Configuration
44
+
45
+#### `editor`
46
+
47
+* Default: The EDITOR or VISUAL environment variables, or
48
+ '%SYSTEMROOT%\notepad.exe' on Windows, or 'vi' on Unix systems
49
+* Type: String
50
+
51
+The command to run for `npm edit` and `npm config edit`.
52
+
53
+
54
+
55
+### See Also
56
+
57
+* [npm folders](/cli/v10/configuring-npm/folders)
58
+* [npm explore](/cli/v10/commands/npm-explore)
59
+* [npm install](/cli/v10/commands/npm-install)
60
+* [npm config](/cli/v10/commands/npm-config)
61
+* [npmrc](/cli/v10/configuring-npm/npmrc)
content/cli/v10/commands/npm-exec.md
new
+381
@@ -0,0 +1,381 @@
1
+---
2
+title: npm-exec
3
+section: 1
4
+description: Run a command from a local or remote npm package
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-exec.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/exec
10
+ - /cli-documentation/v10/cli-commands/npm-exec
11
+ - /cli-documentation/v10/commands/exec
12
+ - /cli-documentation/v10/commands/npm-exec
13
+ - /cli-documentation/v10/exec
14
+ - /cli-documentation/v10/npm-exec
15
+ - /cli/v10/cli-commands/exec
16
+ - /cli/v10/cli-commands/npm-exec
17
+ - /cli/v10/commands/exec
18
+ - /cli/v10/exec
19
+ - /cli/v10/npm-exec
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm exec -- <pkg>[@<version>] [args...]
26
+npm exec --package=<pkg>[@<version>] -- <cmd> [args...]
27
+npm exec -c '<cmd> [args...]'
28
+npm exec --package=foo -c '<cmd> [args...]'
29
+
30
+alias: x
31
+```
32
+
33
+### Description
34
+
35
+This command allows you to run an arbitrary command from an npm package
36
+(either one installed locally, or fetched remotely), in a similar context
37
+as running it via `npm run`.
38
+
39
+Run without positional arguments or `--call`, this allows you to
40
+interactively run commands in the same sort of shell environment that
41
+`package.json` scripts are run. Interactive mode is not supported in CI
42
+environments when standard input is a TTY, to prevent hangs.
43
+
44
+Whatever packages are specified by the `--package` option will be
45
+provided in the `PATH` of the executed command, along with any locally
46
+installed package executables. The `--package` option may be
47
+specified multiple times, to execute the supplied command in an environment
48
+where all specified packages are available.
49
+
50
+If any requested packages are not present in the local project
51
+dependencies, then a prompt is printed, which can be suppressed by
52
+providing either `--yes` or `--no`. When standard input is not a TTY or a
53
+CI environment is detected, `--yes` is assumed. The requested packages are
54
+installed to a folder in the npm cache, which is added to the `PATH`
55
+environment variable in the executed process.
56
+
57
+Package names provided without a specifier will be matched with whatever
58
+version exists in the local project. Package names with a specifier will
59
+only be considered a match if they have the exact same name and version as
60
+the local dependency.
61
+
62
+If no `-c` or `--call` option is provided, then the positional arguments
63
+are used to generate the command string. If no `--package` options
64
+are provided, then npm will attempt to determine the executable name from
65
+the package specifier provided as the first positional argument according
66
+to the following heuristic:
67
+
68
+- If the package has a single entry in its `bin` field in `package.json`,
69
+ or if all entries are aliases of the same command, then that command
70
+ will be used.
71
+- If the package has multiple `bin` entries, and one of them matches the
72
+ unscoped portion of the `name` field, then that command will be used.
73
+- If this does not result in exactly one option (either because there are
74
+ no bin entries, or none of them match the `name` of the package), then
75
+ `npm exec` exits with an error.
76
+
77
+To run a binary _other than_ the named binary, specify one or more
78
+`--package` options, which will prevent npm from inferring the package from
79
+the first command argument.
80
+
81
+### `npx` vs `npm exec`
82
+
83
+When run via the `npx` binary, all flags and options *must* be set prior to
84
+any positional arguments. When run via `npm exec`, a double-hyphen `--`
85
+flag can be used to suppress npm's parsing of switches and options that
86
+should be sent to the executed command.
87
+
88
+For example:
89
+
90
+```
91
+$ npx foo@latest bar --package=@npmcli/foo
92
+```
93
+
94
+In this case, npm will resolve the `foo` package name, and run the
95
+following command:
96
+
97
+```
98
+$ foo bar --package=@npmcli/foo
99
+```
100
+
101
+Since the `--package` option comes _after_ the positional arguments, it is
102
+treated as an argument to the executed command.
103
+
104
+In contrast, due to npm's argument parsing logic, running this command is
105
+different:
106
+
107
+```
108
+$ npm exec foo@latest bar --package=@npmcli/foo
109
+```
110
+
111
+In this case, npm will parse the `--package` option first, resolving the
112
+`@npmcli/foo` package. Then, it will execute the following command in that
113
+context:
114
+
115
+```
116
+$ foo@latest bar
117
+```
118
+
119
+The double-hyphen character is recommended to explicitly tell npm to stop
120
+parsing command line options and switches. The following command would
121
+thus be equivalent to the `npx` command above:
122
+
123
+```
124
+$ npm exec -- foo@latest bar --package=@npmcli/foo
125
+```
126
+
127
+### Configuration
128
+
129
+#### `package`
130
+
131
+* Default:
132
+* Type: String (can be set multiple times)
133
+
134
+The package or packages to install for [`npm exec`](/cli/v10/commands/npm-exec)
135
+
136
+
137
+
138
+#### `call`
139
+
140
+* Default: ""
141
+* Type: String
142
+
143
+Optional companion option for `npm exec`, `npx` that allows for specifying a
144
+custom command to be run along with the installed packages.
145
+
146
+```bash
147
+npm exec --package yo --package generator-node --call "yo node"
148
+```
149
+
150
+
151
+
152
+#### `workspace`
153
+
154
+* Default:
155
+* Type: String (can be set multiple times)
156
+
157
+Enable running a command in the context of the configured workspaces of the
158
+current project while filtering by running only the workspaces defined by
159
+this configuration option.
160
+
161
+Valid values for the `workspace` config are either:
162
+
163
+* Workspace names
164
+* Path to a workspace directory
165
+* Path to a parent workspace directory (will result in selecting all
166
+ workspaces within that folder)
167
+
168
+When set for the `npm init` command, this may be set to the folder of a
169
+workspace which does not yet exist, to create the folder and set it up as a
170
+brand new workspace within the project.
171
+
172
+This value is not exported to the environment for child processes.
173
+
174
+#### `workspaces`
175
+
176
+* Default: null
177
+* Type: null or Boolean
178
+
179
+Set to true to run the command in the context of **all** configured
180
+workspaces.
181
+
182
+Explicitly setting this to false will cause commands like `install` to
183
+ignore workspaces altogether. When not set explicitly:
184
+
185
+- Commands that operate on the `node_modules` tree (install, update, etc.)
186
+will link workspaces into the `node_modules` folder. - Commands that do
187
+other things (test, exec, publish, etc.) will operate on the root project,
188
+_unless_ one or more workspaces are specified in the `workspace` config.
189
+
190
+This value is not exported to the environment for child processes.
191
+
192
+#### `include-workspace-root`
193
+
194
+* Default: false
195
+* Type: Boolean
196
+
197
+Include the workspace root when workspaces are enabled for a command.
198
+
199
+When false, specifying individual workspaces via the `workspace` config, or
200
+all workspaces via the `workspaces` flag, will cause npm to operate only on
201
+the specified workspaces, and not on the root project.
202
+
203
+This value is not exported to the environment for child processes.
204
+
205
+### Examples
206
+
207
+Run the version of `tap` in the local dependencies, with the provided
208
+arguments:
209
+
210
+```
211
+$ npm exec -- tap --bail test/foo.js
212
+$ npx tap --bail test/foo.js
213
+```
214
+
215
+Run a command _other than_ the command whose name matches the package name
216
+by specifying a `--package` option:
217
+
218
+```
219
+$ npm exec --package=foo -- bar --bar-argument
220
+# ~ or ~
221
+$ npx --package=foo bar --bar-argument
222
+```
223
+
224
+Run an arbitrary shell script, in the context of the current project:
225
+
226
+```
227
+$ npm x -c 'eslint && say "hooray, lint passed"'
228
+$ npx -c 'eslint && say "hooray, lint passed"'
229
+```
230
+
231
+### Workspaces support
232
+
233
+You may use the [`workspace`](/cli/v10/using-npm/config#workspace) or
234
+[`workspaces`](/cli/v10/using-npm/config#workspaces) configs in order to run an
235
+arbitrary command from an npm package (either one installed locally, or fetched
236
+remotely) in the context of the specified workspaces.
237
+If no positional argument or `--call` option is provided, it will open an
238
+interactive subshell in the context of each of these configured workspaces one
239
+at a time.
240
+
241
+Given a project with configured workspaces, e.g:
242
+
243
+```
244
+.
245
++-- package.json
246
+`-- packages
247
+ +-- a
248
+ | `-- package.json
249
+ +-- b
250
+ | `-- package.json
251
+ `-- c
252
+ `-- package.json
253
+```
254
+
255
+Assuming the workspace configuration is properly set up at the root level
256
+`package.json` file. e.g:
257
+
258
+```
259
+{
260
+ "workspaces": [ "./packages/*" ]
261
+}
262
+```
263
+
264
+You can execute an arbitrary command from a package in the context of each of
265
+the configured workspaces when using the
266
+[`workspaces` config options](/cli/v10/using-npm/config#workspace), in this example
267
+we're using **eslint** to lint any js file found within each workspace folder:
268
+
269
+```
270
+npm exec --ws -- eslint ./*.js
271
+```
272
+
273
+#### Filtering workspaces
274
+
275
+It's also possible to execute a command in a single workspace using the
276
+`workspace` config along with a name or directory path:
277
+
278
+```
279
+npm exec --workspace=a -- eslint ./*.js
280
+```
281
+
282
+The `workspace` config can also be specified multiple times in order to run a
283
+specific script in the context of multiple workspaces. When defining values for
284
+the `workspace` config in the command line, it also possible to use `-w` as a
285
+shorthand, e.g:
286
+
287
+```
288
+npm exec -w a -w b -- eslint ./*.js
289
+```
290
+
291
+This last command will run the `eslint` command in both `./packages/a` and
292
+`./packages/b` folders.
293
+
294
+### Compatibility with Older npx Versions
295
+
296
+The `npx` binary was rewritten in npm v7.0.0, and the standalone `npx`
297
+package deprecated at that time. `npx` uses the `npm exec`
298
+command instead of a separate argument parser and install process, with
299
+some affordances to maintain backwards compatibility with the arguments it
300
+accepted in previous versions.
301
+
302
+This resulted in some shifts in its functionality:
303
+
304
+- Any `npm` config value may be provided.
305
+- To prevent security and user-experience problems from mistyping package
306
+ names, `npx` prompts before installing anything. Suppress this
307
+ prompt with the `-y` or `--yes` option.
308
+- The `--no-install` option is deprecated, and will be converted to `--no`.
309
+- Shell fallback functionality is removed, as it is not advisable.
310
+- The `-p` argument is a shorthand for `--parseable` in npm, but shorthand
311
+ for `--package` in npx. This is maintained, but only for the `npx`
312
+ executable.
313
+- The `--ignore-existing` option is removed. Locally installed bins are
314
+ always present in the executed process `PATH`.
315
+- The `--npm` option is removed. `npx` will always use the `npm` it ships
316
+ with.
317
+- The `--node-arg` and `-n` options are removed.
318
+- The `--always-spawn` option is redundant, and thus removed.
319
+- The `--shell` option is replaced with `--script-shell`, but maintained
320
+ in the `npx` executable for backwards compatibility.
321
+
322
+### A note on caching
323
+
324
+The npm cli utilizes its internal package cache when using the package
325
+name specified. You can use the following to change how and when the
326
+cli uses this cache. See [`npm cache`](/cli/v10/commands/npm-cache) for more on
327
+how the cache works.
328
+
329
+#### prefer-online
330
+
331
+Forces staleness checks for packages, making the cli look for updates
332
+immediately even if the package is already in the cache.
333
+
334
+#### prefer-offline
335
+
336
+Bypasses staleness checks for packages. Missing data will still be
337
+requested from the server. To force full offline mode, use `offline`.
338
+
339
+#### offline
340
+
341
+Forces full offline mode. Any packages not locally cached will result in
342
+an error.
343
+
344
+#### workspace
345
+
346
+* Default:
347
+* Type: String (can be set multiple times)
348
+
349
+Enable running a command in the context of the configured workspaces of the
350
+current project while filtering by running only the workspaces defined by
351
+this configuration option.
352
+
353
+Valid values for the `workspace` config are either:
354
+
355
+* Workspace names
356
+* Path to a workspace directory
357
+* Path to a parent workspace directory (will result to selecting all of the
358
+ nested workspaces)
359
+
360
+This value is not exported to the environment for child processes.
361
+
362
+#### workspaces
363
+
364
+* Alias: `--ws`
365
+* Type: Boolean
366
+* Default: `false`
367
+
368
+Run scripts in the context of all configured workspaces for the current
369
+project.
370
+
371
+### See Also
372
+
373
+* [npm run-script](/cli/v10/commands/npm-run-script)
374
+* [npm scripts](/cli/v10/using-npm/scripts)
375
+* [npm test](/cli/v10/commands/npm-test)
376
+* [npm start](/cli/v10/commands/npm-start)
377
+* [npm restart](/cli/v10/commands/npm-restart)
378
+* [npm stop](/cli/v10/commands/npm-stop)
379
+* [npm config](/cli/v10/commands/npm-config)
380
+* [npm workspaces](/cli/v10/using-npm/workspaces)
381
+* [npx](/cli/v10/commands/npx)
content/cli/v10/commands/npm-explain.md
new
+120
@@ -0,0 +1,120 @@
1
+---
2
+title: npm-explain
3
+section: 1
4
+description: Explain installed packages
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-explain.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/explain
10
+ - /cli-documentation/v10/cli-commands/npm-explain
11
+ - /cli-documentation/v10/commands/explain
12
+ - /cli-documentation/v10/commands/npm-explain
13
+ - /cli-documentation/v10/explain
14
+ - /cli-documentation/v10/npm-explain
15
+ - /cli/v10/cli-commands/explain
16
+ - /cli/v10/cli-commands/npm-explain
17
+ - /cli/v10/commands/explain
18
+ - /cli/v10/explain
19
+ - /cli/v10/npm-explain
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm explain <package-spec>
26
+
27
+alias: why
28
+```
29
+
30
+### Description
31
+
32
+This command will print the chain of dependencies causing a given package
33
+to be installed in the current project.
34
+
35
+If one or more package specs are provided, then only packages matching
36
+one of the specifiers will have their relationships explained.
37
+
38
+The package spec can also refer to a folder within `./node_modules`
39
+
40
+For example, running `npm explain glob` within npm's source tree will show:
41
+
42
+```bash
43
+glob@7.1.6
44
+node_modules/glob
45
+ glob@"^7.1.4" from the root project
46
+
47
+glob@7.1.1 dev
48
+node_modules/tacks/node_modules/glob
49
+ glob@"^7.0.5" from rimraf@2.6.2
50
+ node_modules/tacks/node_modules/rimraf
51
+ rimraf@"^2.6.2" from tacks@1.3.0
52
+ node_modules/tacks
53
+ dev tacks@"^1.3.0" from the root project
54
+```
55
+
56
+To explain just the package residing at a specific folder, pass that as the
57
+argument to the command. This can be useful when trying to figure out
58
+exactly why a given dependency is being duplicated to satisfy conflicting
59
+version requirements within the project.
60
+
61
+```bash
62
+$ npm explain node_modules/nyc/node_modules/find-up
63
+find-up@3.0.0 dev
64
+node_modules/nyc/node_modules/find-up
65
+ find-up@"^3.0.0" from nyc@14.1.1
66
+ node_modules/nyc
67
+ nyc@"^14.1.1" from tap@14.10.8
68
+ node_modules/tap
69
+ dev tap@"^14.10.8" from the root project
70
+```
71
+
72
+### Configuration
73
+#### `json`
74
+
75
+* Default: false
76
+* Type: Boolean
77
+
78
+Whether or not to output JSON data, rather than the normal output.
79
+
80
+* In `npm pkg set` it enables parsing set values with JSON.parse() before
81
+ saving them to your `package.json`.
82
+
83
+Not supported by all npm commands.
84
+
85
+
86
+
87
+#### `workspace`
88
+
89
+* Default:
90
+* Type: String (can be set multiple times)
91
+
92
+Enable running a command in the context of the configured workspaces of the
93
+current project while filtering by running only the workspaces defined by
94
+this configuration option.
95
+
96
+Valid values for the `workspace` config are either:
97
+
98
+* Workspace names
99
+* Path to a workspace directory
100
+* Path to a parent workspace directory (will result in selecting all
101
+ workspaces within that folder)
102
+
103
+When set for the `npm init` command, this may be set to the folder of a
104
+workspace which does not yet exist, to create the folder and set it up as a
105
+brand new workspace within the project.
106
+
107
+This value is not exported to the environment for child processes.
108
+
109
+### See Also
110
+
111
+* [package spec](/cli/v10/using-npm/package-spec)
112
+* [npm config](/cli/v10/commands/npm-config)
113
+* [npmrc](/cli/v10/configuring-npm/npmrc)
114
+* [npm folders](/cli/v10/configuring-npm/folders)
115
+* [npm ls](/cli/v10/commands/npm-ls)
116
+* [npm install](/cli/v10/commands/npm-install)
117
+* [npm link](/cli/v10/commands/npm-link)
118
+* [npm prune](/cli/v10/commands/npm-prune)
119
+* [npm outdated](/cli/v10/commands/npm-outdated)
120
+* [npm update](/cli/v10/commands/npm-update)
content/cli/v10/commands/npm-explore.md
new
+64
@@ -0,0 +1,64 @@
1
+---
2
+title: npm-explore
3
+section: 1
4
+description: Browse an installed package
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-explore.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/explore
10
+ - /cli-documentation/v10/cli-commands/npm-explore
11
+ - /cli-documentation/v10/commands/explore
12
+ - /cli-documentation/v10/commands/npm-explore
13
+ - /cli-documentation/v10/explore
14
+ - /cli-documentation/v10/npm-explore
15
+ - /cli/v10/cli-commands/explore
16
+ - /cli/v10/cli-commands/npm-explore
17
+ - /cli/v10/commands/explore
18
+ - /cli/v10/explore
19
+ - /cli/v10/npm-explore
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm explore <pkg> [ -- <command>]
26
+```
27
+
28
+Note: This command is unaware of workspaces.
29
+
30
+### Description
31
+
32
+Spawn a subshell in the directory of the installed package specified.
33
+
34
+If a command is specified, then it is run in the subshell, which then
35
+immediately terminates.
36
+
37
+This is particularly handy in the case of git submodules in the
38
+`node_modules` folder:
39
+
40
+```bash
41
+npm explore some-dependency -- git pull origin master
42
+```
43
+
44
+Note that the package is *not* automatically rebuilt afterwards, so be
45
+sure to use `npm rebuild <pkg>` if you make any changes.
46
+
47
+### Configuration
48
+
49
+#### `shell`
50
+
51
+* Default: SHELL environment variable, or "bash" on Posix, or "cmd.exe" on
52
+ Windows
53
+* Type: String
54
+
55
+The shell to run for the `npm explore` command.
56
+
57
+
58
+
59
+### See Also
60
+
61
+* [npm folders](/cli/v10/configuring-npm/folders)
62
+* [npm edit](/cli/v10/commands/npm-edit)
63
+* [npm rebuild](/cli/v10/commands/npm-rebuild)
64
+* [npm install](/cli/v10/commands/npm-install)
content/cli/v10/commands/npm-find-dupes.md
new
+247
@@ -0,0 +1,247 @@
1
+---
2
+title: npm-find-dupes
3
+section: 1
4
+description: Find duplication in the package tree
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-find-dupes.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/find-dupes
10
+ - /cli-documentation/v10/cli-commands/npm-find-dupes
11
+ - /cli-documentation/v10/commands/find-dupes
12
+ - /cli-documentation/v10/commands/npm-find-dupes
13
+ - /cli-documentation/v10/find-dupes
14
+ - /cli-documentation/v10/npm-find-dupes
15
+ - /cli/v10/cli-commands/find-dupes
16
+ - /cli/v10/cli-commands/npm-find-dupes
17
+ - /cli/v10/commands/find-dupes
18
+ - /cli/v10/find-dupes
19
+ - /cli/v10/npm-find-dupes
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm find-dupes
26
+```
27
+
28
+### Description
29
+
30
+Runs `npm dedupe` in `--dry-run` mode, making npm only output the
31
+duplications, without actually changing the package tree.
32
+
33
+### Configuration
34
+
35
+#### `install-strategy`
36
+
37
+* Default: "hoisted"
38
+* Type: "hoisted", "nested", "shallow", or "linked"
39
+
40
+Sets the strategy for installing packages in node_modules. hoisted
41
+(default): Install non-duplicated in top-level, and duplicated as necessary
42
+within directory structure. nested: (formerly --legacy-bundling) install in
43
+place, no hoisting. shallow (formerly --global-style) only install direct
44
+deps at top-level. linked: (experimental) install in node_modules/.store,
45
+link in place, unhoisted.
46
+
47
+
48
+
49
+#### `legacy-bundling`
50
+
51
+* Default: false
52
+* Type: Boolean
53
+* DEPRECATED: This option has been deprecated in favor of
54
+ `--install-strategy=nested`
55
+
56
+Instead of hoisting package installs in `node_modules`, install packages in
57
+the same manner that they are depended on. This may cause very deep
58
+directory structures and duplicate package installs as there is no
59
+de-duplicating. Sets `--install-strategy=nested`.
60
+
61
+
62
+
63
+#### `global-style`
64
+
65
+* Default: false
66
+* Type: Boolean
67
+* DEPRECATED: This option has been deprecated in favor of
68
+ `--install-strategy=shallow`
69
+
70
+Only install direct dependencies in the top level `node_modules`, but hoist
71
+on deeper dependencies. Sets `--install-strategy=shallow`.
72
+
73
+
74
+
75
+#### `strict-peer-deps`
76
+
77
+* Default: false
78
+* Type: Boolean
79
+
80
+If set to `true`, and `--legacy-peer-deps` is not set, then _any_
81
+conflicting `peerDependencies` will be treated as an install failure, even
82
+if npm could reasonably guess the appropriate resolution based on non-peer
83
+dependency relationships.
84
+
85
+By default, conflicting `peerDependencies` deep in the dependency graph will
86
+be resolved using the nearest non-peer dependency specification, even if
87
+doing so will result in some packages receiving a peer dependency outside
88
+the range set in their package's `peerDependencies` object.
89
+
90
+When such an override is performed, a warning is printed, explaining the
91
+conflict and the packages involved. If `--strict-peer-deps` is set, then
92
+this warning is treated as a failure.
93
+
94
+
95
+
96
+#### `package-lock`
97
+
98
+* Default: true
99
+* Type: Boolean
100
+
101
+If set to false, then ignore `package-lock.json` files when installing. This
102
+will also prevent _writing_ `package-lock.json` if `save` is true.
103
+
104
+
105
+
106
+#### `omit`
107
+
108
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
109
+ 'production', otherwise empty.
110
+* Type: "dev", "optional", or "peer" (can be set multiple times)
111
+
112
+Dependency types to omit from the installation tree on disk.
113
+
114
+Note that these dependencies _are_ still resolved and added to the
115
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
116
+physically installed on disk.
117
+
118
+If a package type appears in both the `--include` and `--omit` lists, then
119
+it will be included.
120
+
121
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
122
+variable will be set to `'production'` for all lifecycle scripts.
123
+
124
+
125
+
126
+#### `ignore-scripts`
127
+
128
+* Default: false
129
+* Type: Boolean
130
+
131
+If true, npm does not run scripts specified in package.json files.
132
+
133
+Note that commands explicitly intended to run a particular script, such as
134
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
135
+will still run their intended script if `ignore-scripts` is set, but they
136
+will *not* run any pre- or post-scripts.
137
+
138
+
139
+
140
+#### `audit`
141
+
142
+* Default: true
143
+* Type: Boolean
144
+
145
+When "true" submit audit reports alongside the current npm command to the
146
+default registry and all registries configured for scopes. See the
147
+documentation for [`npm audit`](/cli/v10/commands/npm-audit) for details on what is
148
+submitted.
149
+
150
+
151
+
152
+#### `bin-links`
153
+
154
+* Default: true
155
+* Type: Boolean
156
+
157
+Tells npm to create symlinks (or `.cmd` shims on Windows) for package
158
+executables.
159
+
160
+Set to false to have it not do this. This can be used to work around the
161
+fact that some file systems don't support symlinks, even on ostensibly Unix
162
+systems.
163
+
164
+
165
+
166
+#### `fund`
167
+
168
+* Default: true
169
+* Type: Boolean
170
+
171
+When "true" displays the message at the end of each `npm install`
172
+acknowledging the number of dependencies looking for funding. See [`npm
173
+fund`](/cli/v10/commands/npm-fund) for details.
174
+
175
+
176
+
177
+#### `workspace`
178
+
179
+* Default:
180
+* Type: String (can be set multiple times)
181
+
182
+Enable running a command in the context of the configured workspaces of the
183
+current project while filtering by running only the workspaces defined by
184
+this configuration option.
185
+
186
+Valid values for the `workspace` config are either:
187
+
188
+* Workspace names
189
+* Path to a workspace directory
190
+* Path to a parent workspace directory (will result in selecting all
191
+ workspaces within that folder)
192
+
193
+When set for the `npm init` command, this may be set to the folder of a
194
+workspace which does not yet exist, to create the folder and set it up as a
195
+brand new workspace within the project.
196
+
197
+This value is not exported to the environment for child processes.
198
+
199
+#### `workspaces`
200
+
201
+* Default: null
202
+* Type: null or Boolean
203
+
204
+Set to true to run the command in the context of **all** configured
205
+workspaces.
206
+
207
+Explicitly setting this to false will cause commands like `install` to
208
+ignore workspaces altogether. When not set explicitly:
209
+
210
+- Commands that operate on the `node_modules` tree (install, update, etc.)
211
+will link workspaces into the `node_modules` folder. - Commands that do
212
+other things (test, exec, publish, etc.) will operate on the root project,
213
+_unless_ one or more workspaces are specified in the `workspace` config.
214
+
215
+This value is not exported to the environment for child processes.
216
+
217
+#### `include-workspace-root`
218
+
219
+* Default: false
220
+* Type: Boolean
221
+
222
+Include the workspace root when workspaces are enabled for a command.
223
+
224
+When false, specifying individual workspaces via the `workspace` config, or
225
+all workspaces via the `workspaces` flag, will cause npm to operate only on
226
+the specified workspaces, and not on the root project.
227
+
228
+This value is not exported to the environment for child processes.
229
+
230
+#### `install-links`
231
+
232
+* Default: false
233
+* Type: Boolean
234
+
235
+When set file: protocol dependencies will be packed and installed as regular
236
+dependencies instead of creating a symlink. This option has no effect on
237
+workspaces.
238
+
239
+
240
+
241
+### See Also
242
+
243
+* [npm dedupe](/cli/v10/commands/npm-dedupe)
244
+* [npm ls](/cli/v10/commands/npm-ls)
245
+* [npm update](/cli/v10/commands/npm-update)
246
+* [npm install](/cli/v10/commands/npm-install)
247
+
content/cli/v10/commands/npm-fund.md
new
+160
@@ -0,0 +1,160 @@
1
+---
2
+title: npm-fund
3
+section: 1
4
+description: Retrieve funding information
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-fund.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/fund
10
+ - /cli-documentation/v10/cli-commands/npm-fund
11
+ - /cli-documentation/v10/commands/fund
12
+ - /cli-documentation/v10/commands/npm-fund
13
+ - /cli-documentation/v10/fund
14
+ - /cli-documentation/v10/npm-fund
15
+ - /cli/v10/cli-commands/fund
16
+ - /cli/v10/cli-commands/npm-fund
17
+ - /cli/v10/commands/fund
18
+ - /cli/v10/fund
19
+ - /cli/v10/npm-fund
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm fund [<package-spec>]
26
+```
27
+
28
+### Description
29
+
30
+This command retrieves information on how to fund the dependencies of a
31
+given project. If no package name is provided, it will list all
32
+dependencies that are looking for funding in a tree structure, listing
33
+the type of funding and the url to visit. If a package name is provided
34
+then it tries to open its funding url using the
35
+[`--browser` config](/cli/v10/using-npm/config#browser) param; if there are multiple
36
+funding sources for the package, the user will be instructed to pass the
37
+`--which` option to disambiguate.
38
+
39
+The list will avoid duplicated entries and will stack all packages that
40
+share the same url as a single entry. Thus, the list does not have the
41
+same shape of the output from `npm ls`.
42
+
43
+#### Example
44
+
45
+### Workspaces support
46
+
47
+It's possible to filter the results to only include a single workspace
48
+and its dependencies using the
49
+[`workspace` config](/cli/v10/using-npm/config#workspace) option.
50
+
51
+#### Example:
52
+
53
+Here's an example running `npm fund` in a project with a configured
54
+workspace `a`:
55
+
56
+```bash
57
+$ npm fund
58
+test-workspaces-fund@1.0.0
59
++-- https://example.com/a
60
+| | `-- a@1.0.0
61
+| `-- https://example.com/maintainer
62
+| `-- foo@1.0.0
63
++-- https://example.com/npmcli-funding
64
+| `-- @npmcli/test-funding
65
+`-- https://example.com/org
66
+ `-- bar@2.0.0
67
+```
68
+
69
+And here is an example of the expected result when filtering only by a
70
+specific workspace `a` in the same project:
71
+
72
+```bash
73
+$ npm fund -w a
74
+test-workspaces-fund@1.0.0
75
+`-- https://example.com/a
76
+ | `-- a@1.0.0
77
+ `-- https://example.com/maintainer
78
+ `-- foo@2.0.0
79
+```
80
+
81
+### Configuration
82
+
83
+#### `json`
84
+
85
+* Default: false
86
+* Type: Boolean
87
+
88
+Whether or not to output JSON data, rather than the normal output.
89
+
90
+* In `npm pkg set` it enables parsing set values with JSON.parse() before
91
+ saving them to your `package.json`.
92
+
93
+Not supported by all npm commands.
94
+
95
+
96
+
97
+#### `browser`
98
+
99
+* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
100
+* Type: null, Boolean, or String
101
+
102
+The browser that is called by npm commands to open websites.
103
+
104
+Set to `false` to suppress browser behavior and instead print urls to
105
+terminal.
106
+
107
+Set to `true` to use default system URL opener.
108
+
109
+
110
+
111
+#### `unicode`
112
+
113
+* Default: false on windows, true on mac/unix systems with a unicode locale,
114
+ as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables.
115
+* Type: Boolean
116
+
117
+When set to true, npm uses unicode characters in the tree output. When
118
+false, it uses ascii characters instead of unicode glyphs.
119
+
120
+
121
+
122
+#### `workspace`
123
+
124
+* Default:
125
+* Type: String (can be set multiple times)
126
+
127
+Enable running a command in the context of the configured workspaces of the
128
+current project while filtering by running only the workspaces defined by
129
+this configuration option.
130
+
131
+Valid values for the `workspace` config are either:
132
+
133
+* Workspace names
134
+* Path to a workspace directory
135
+* Path to a parent workspace directory (will result in selecting all
136
+ workspaces within that folder)
137
+
138
+When set for the `npm init` command, this may be set to the folder of a
139
+workspace which does not yet exist, to create the folder and set it up as a
140
+brand new workspace within the project.
141
+
142
+This value is not exported to the environment for child processes.
143
+
144
+#### `which`
145
+
146
+* Default: null
147
+* Type: null or Number
148
+
149
+If there are multiple funding sources, which 1-indexed source URL to open.
150
+
151
+
152
+
153
+## See Also
154
+
155
+* [package spec](/cli/v10/using-npm/package-spec)
156
+* [npm install](/cli/v10/commands/npm-install)
157
+* [npm docs](/cli/v10/commands/npm-docs)
158
+* [npm ls](/cli/v10/commands/npm-ls)
159
+* [npm config](/cli/v10/commands/npm-config)
160
+* [npm workspaces](/cli/v10/using-npm/workspaces)
content/cli/v10/commands/npm-help-search.md
new
+55
@@ -0,0 +1,55 @@
1
+---
2
+title: npm-help-search
3
+section: 1
4
+description: Search npm help documentation
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-help-search.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/help-search
10
+ - /cli-documentation/v10/cli-commands/npm-help-search
11
+ - /cli-documentation/v10/commands/help-search
12
+ - /cli-documentation/v10/commands/npm-help-search
13
+ - /cli-documentation/v10/help-search
14
+ - /cli-documentation/v10/npm-help-search
15
+ - /cli/v10/cli-commands/help-search
16
+ - /cli/v10/cli-commands/npm-help-search
17
+ - /cli/v10/commands/help-search
18
+ - /cli/v10/help-search
19
+ - /cli/v10/npm-help-search
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm help-search <text>
26
+```
27
+
28
+Note: This command is unaware of workspaces.
29
+
30
+### Description
31
+
32
+This command will search the npm markdown documentation files for the terms
33
+provided, and then list the results, sorted by relevance.
34
+
35
+If only one result is found, then it will show that help topic.
36
+
37
+If the argument to `npm help` is not a known help topic, then it will call
38
+`help-search`. It is rarely if ever necessary to call this command
39
+directly.
40
+
41
+### Configuration
42
+
43
+#### `long`
44
+
45
+* Default: false
46
+* Type: Boolean
47
+
48
+Show extended information in `ls`, `search`, and `help-search`.
49
+
50
+
51
+
52
+### See Also
53
+
54
+* [npm](/cli/v10/commands/npm)
55
+* [npm help](/cli/v10/commands/npm-help)
content/cli/v10/commands/npm-help.md
new
+61
@@ -0,0 +1,61 @@
1
+---
2
+title: npm-help
3
+section: 1
4
+description: Get help on npm
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-help.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/help
10
+ - /cli-documentation/v10/cli-commands/npm-help
11
+ - /cli-documentation/v10/commands/help
12
+ - /cli-documentation/v10/commands/npm-help
13
+ - /cli-documentation/v10/help
14
+ - /cli-documentation/v10/npm-help
15
+ - /cli/v10/cli-commands/help
16
+ - /cli/v10/cli-commands/npm-help
17
+ - /cli/v10/commands/help
18
+ - /cli/v10/help
19
+ - /cli/v10/npm-help
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm help <term> [<terms..>]
26
+
27
+alias: hlep
28
+```
29
+
30
+Note: This command is unaware of workspaces.
31
+
32
+### Description
33
+
34
+If supplied a topic, then show the appropriate documentation page.
35
+
36
+If the topic does not exist, or if multiple terms are provided, then npm
37
+will run the `help-search` command to find a match. Note that, if
38
+`help-search` finds a single subject, then it will run `help` on that
39
+topic, so unique matches are equivalent to specifying a topic name.
40
+
41
+### Configuration
42
+
43
+#### `viewer`
44
+
45
+* Default: "man" on Posix, "browser" on Windows
46
+* Type: String
47
+
48
+The program to use to view help content.
49
+
50
+Set to `"browser"` to view html help content in the default web browser.
51
+
52
+
53
+
54
+### See Also
55
+
56
+* [npm](/cli/v10/commands/npm)
57
+* [npm folders](/cli/v10/configuring-npm/folders)
58
+* [npm config](/cli/v10/commands/npm-config)
59
+* [npmrc](/cli/v10/configuring-npm/npmrc)
60
+* [package.json](/cli/v10/configuring-npm/package-json)
61
+* [npm help-search](/cli/v10/commands/npm-help-search)
content/cli/v10/commands/npm-hook.md
new
+127
@@ -0,0 +1,127 @@
1
+---
2
+title: npm-hook
3
+section: 1
4
+description: Manage registry hooks
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-hook.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/hook
10
+ - /cli-documentation/v10/cli-commands/npm-hook
11
+ - /cli-documentation/v10/commands/hook
12
+ - /cli-documentation/v10/commands/npm-hook
13
+ - /cli-documentation/v10/hook
14
+ - /cli-documentation/v10/npm-hook
15
+ - /cli/v10/cli-commands/hook
16
+ - /cli/v10/cli-commands/npm-hook
17
+ - /cli/v10/commands/hook
18
+ - /cli/v10/hook
19
+ - /cli/v10/npm-hook
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm hook add <pkg> <url> <secret> [--type=<type>]
26
+npm hook ls [pkg]
27
+npm hook rm <id>
28
+npm hook update <id> <url> <secret>
29
+```
30
+
31
+Note: This command is unaware of workspaces.
32
+
33
+### Description
34
+
35
+Allows you to manage [npm
36
+hooks](https://blog.npmjs.org/post/145260155635/introducing-hooks-get-notifications-of-npm),
37
+including adding, removing, listing, and updating.
38
+
39
+Hooks allow you to configure URL endpoints that will be notified whenever a
40
+change happens to any of the supported entity types. Three different types
41
+of entities can be watched by hooks: packages, owners, and scopes.
42
+
43
+To create a package hook, simply reference the package name.
44
+
45
+To create an owner hook, prefix the owner name with `~` (as in,
46
+`~youruser`).
47
+
48
+To create a scope hook, prefix the scope name with `@` (as in,
49
+`@yourscope`).
50
+
51
+The hook `id` used by `update` and `rm` are the IDs listed in `npm hook ls`
52
+for that particular hook.
53
+
54
+The shared secret will be sent along to the URL endpoint so you can verify
55
+the request came from your own configured hook.
56
+
57
+### Example
58
+
59
+Add a hook to watch a package for changes:
60
+
61
+```bash
62
+$ npm hook add lodash https://example.com/ my-shared-secret
63
+```
64
+
65
+Add a hook to watch packages belonging to the user `substack`:
66
+
67
+```bash
68
+$ npm hook add ~substack https://example.com/ my-shared-secret
69
+```
70
+
71
+Add a hook to watch packages in the scope `@npm`
72
+
73
+```bash
74
+$ npm hook add @npm https://example.com/ my-shared-secret
75
+```
76
+
77
+List all your active hooks:
78
+
79
+```bash
80
+$ npm hook ls
81
+```
82
+
83
+List your active hooks for the `lodash` package:
84
+
85
+```bash
86
+$ npm hook ls lodash
87
+```
88
+
89
+Update an existing hook's url:
90
+
91
+```bash
92
+$ npm hook update id-deadbeef https://my-new-website.here/
93
+```
94
+
95
+Remove a hook:
96
+
97
+```bash
98
+$ npm hook rm id-deadbeef
99
+```
100
+
101
+### Configuration
102
+
103
+#### `registry`
104
+
105
+* Default: "https://registry.npmjs.org/"
106
+* Type: URL
107
+
108
+The base URL of the npm registry.
109
+
110
+
111
+
112
+#### `otp`
113
+
114
+* Default: null
115
+* Type: null or String
116
+
117
+This is a one-time password from a two-factor authenticator. It's needed
118
+when publishing or changing package permissions with `npm access`.
119
+
120
+If not set, and a registry response fails with a challenge for a one-time
121
+password, npm will prompt on the command line for one.
122
+
123
+
124
+
125
+### See Also
126
+
127
+* ["Introducing Hooks" blog post](https://blog.npmjs.org/post/145260155635/introducing-hooks-get-notifications-of-npm)
content/cli/v10/commands/npm-init.md
new
+314
@@ -0,0 +1,314 @@
1
+---
2
+title: npm-init
3
+section: 1
4
+description: Create a package.json file
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-init.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/init
10
+ - /cli-documentation/v10/cli-commands/npm-init
11
+ - /cli-documentation/v10/commands/init
12
+ - /cli-documentation/v10/commands/npm-init
13
+ - /cli-documentation/v10/init
14
+ - /cli-documentation/v10/npm-init
15
+ - /cli/v10/cli-commands/init
16
+ - /cli/v10/cli-commands/npm-init
17
+ - /cli/v10/commands/init
18
+ - /cli/v10/init
19
+ - /cli/v10/npm-init
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm init <package-spec> (same as `npx <package-spec>`)
26
+npm init <@scope> (same as `npx <@scope>/create`)
27
+
28
+aliases: create, innit
29
+```
30
+
31
+### Description
32
+
33
+`npm init <initializer>` can be used to set up a new or existing npm
34
+package.
35
+
36
+`initializer` in this case is an npm package named `create-<initializer>`,
37
+which will be installed by [`npm-exec`](/cli/v10/commands/npm-exec), and then have its
38
+main bin executed -- presumably creating or updating `package.json` and
39
+running any other initialization-related operations.
40
+
41
+The init command is transformed to a corresponding `npm exec` operation as
42
+follows:
43
+
44
+* `npm init foo` -> `npm exec create-foo`
45
+* `npm init @usr/foo` -> `npm exec @usr/create-foo`
46
+* `npm init @usr` -> `npm exec @usr/create`
47
+* `npm init @usr@2.0.0` -> `npm exec @usr/create@2.0.0`
48
+* `npm init @usr/foo@2.0.0` -> `npm exec @usr/create-foo@2.0.0`
49
+
50
+If the initializer is omitted (by just calling `npm init`), init will fall
51
+back to legacy init behavior. It will ask you a bunch of questions, and
52
+then write a package.json for you. It will attempt to make reasonable
53
+guesses based on existing fields, dependencies, and options selected. It is
54
+strictly additive, so it will keep any fields and values that were already
55
+set. You can also use `-y`/`--yes` to skip the questionnaire altogether. If
56
+you pass `--scope`, it will create a scoped package.
57
+
58
+*Note:* if a user already has the `create-<initializer>` package
59
+globally installed, that will be what `npm init` uses. If you want npm
60
+to use the latest version, or another specific version you must specify
61
+it:
62
+
63
+* `npm init foo@latest` # fetches and runs the latest `create-foo` from
64
+ the registry
65
+* `npm init foo@1.2.3` # runs `create-foo@1.2.3` specifically
66
+
67
+#### Forwarding additional options
68
+
69
+Any additional options will be passed directly to the command, so `npm init
70
+foo -- --hello` will map to `npm exec -- create-foo --hello`.
71
+
72
+To better illustrate how options are forwarded, here's a more evolved
73
+example showing options passed to both the **npm cli** and a create package,
74
+both following commands are equivalent:
75
+
76
+- `npm init foo -y --registry=<url> -- --hello -a`
77
+- `npm exec -y --registry=<url> -- create-foo --hello -a`
78
+
79
+### Examples
80
+
81
+Create a new React-based project using
82
+[`create-react-app`](https://npm.im/create-react-app):
83
+
84
+```bash
85
+$ npm init react-app ./my-react-app
86
+```
87
+
88
+Create a new `esm`-compatible package using
89
+[`create-esm`](https://npm.im/create-esm):
90
+
91
+```bash
92
+$ mkdir my-esm-lib && cd my-esm-lib
93
+$ npm init esm --yes
94
+```
95
+
96
+Generate a plain old package.json using legacy init:
97
+
98
+```bash
99
+$ mkdir my-npm-pkg && cd my-npm-pkg
100
+$ git init
101
+$ npm init
102
+```
103
+
104
+Generate it without having it ask any questions:
105
+
106
+```bash
107
+$ npm init -y
108
+```
109
+
110
+### Workspaces support
111
+
112
+It's possible to create a new workspace within your project by using the
113
+`workspace` config option. When using `npm init -w <dir>` the cli will
114
+create the folders and boilerplate expected while also adding a reference
115
+to your project `package.json` `"workspaces": []` property in order to make
116
+sure that new generated **workspace** is properly set up as such.
117
+
118
+Given a project with no workspaces, e.g:
119
+
120
+```
121
+.
122
++-- package.json
123
+```
124
+
125
+You may generate a new workspace using the legacy init:
126
+
127
+```bash
128
+$ npm init -w packages/a
129
+```
130
+
131
+That will generate a new folder and `package.json` file, while also updating
132
+your top-level `package.json` to add the reference to this new workspace:
133
+
134
+```
135
+.
136
++-- package.json
137
+`-- packages
138
+ `-- a
139
+ `-- package.json
140
+```
141
+
142
+The workspaces init also supports the `npm init <initializer> -w <dir>`
143
+syntax, following the same set of rules explained earlier in the initial
144
+**Description** section of this page. Similar to the previous example of
145
+creating a new React-based project using
146
+[`create-react-app`](https://npm.im/create-react-app), the following syntax
147
+will make sure to create the new react app as a nested **workspace** within your
148
+project and configure your `package.json` to recognize it as such:
149
+
150
+```bash
151
+npm init -w packages/my-react-app react-app .
152
+```
153
+
154
+This will make sure to generate your react app as expected, one important
155
+consideration to have in mind is that `npm exec` is going to be run in the
156
+context of the newly created folder for that workspace, and that's the reason
157
+why in this example the initializer uses the initializer name followed with a
158
+dot to represent the current directory in that context, e.g: `react-app .`:
159
+
160
+```
161
+.
162
++-- package.json
163
+`-- packages
164
+ +-- a
165
+ | `-- package.json
166
+ `-- my-react-app
167
+ +-- README
168
+ +-- package.json
169
+ `-- ...
170
+```
171
+
172
+### Configuration
173
+
174
+#### `yes`
175
+
176
+* Default: null
177
+* Type: null or Boolean
178
+
179
+Automatically answer "yes" to any prompts that npm might print on the
180
+command line.
181
+
182
+
183
+
184
+#### `force`
185
+
186
+* Default: false
187
+* Type: Boolean
188
+
189
+Removes various protections against unfortunate side effects, common
190
+mistakes, unnecessary performance degradation, and malicious input.
191
+
192
+* Allow clobbering non-npm files in global installs.
193
+* Allow the `npm version` command to work on an unclean git repository.
194
+* Allow deleting the cache folder with `npm cache clean`.
195
+* Allow installing packages that have an `engines` declaration requiring a
196
+ different version of npm.
197
+* Allow installing packages that have an `engines` declaration requiring a
198
+ different version of `node`, even if `--engine-strict` is enabled.
199
+* Allow `npm audit fix` to install modules outside your stated dependency
200
+ range (including SemVer-major changes).
201
+* Allow unpublishing all versions of a published package.
202
+* Allow conflicting peerDependencies to be installed in the root project.
203
+* Implicitly set `--yes` during `npm init`.
204
+* Allow clobbering existing values in `npm pkg`
205
+* Allow unpublishing of entire packages (not just a single version).
206
+
207
+If you don't have a clear idea of what you want to do, it is strongly
208
+recommended that you do not use this option!
209
+
210
+
211
+
212
+#### `scope`
213
+
214
+* Default: the scope of the current project, if any, or ""
215
+* Type: String
216
+
217
+Associate an operation with a scope for a scoped registry.
218
+
219
+Useful when logging in to or out of a private registry:
220
+
221
+```
222
+# log in, linking the scope to the custom registry
223
+npm login --scope=@mycorp --registry=https://registry.mycorp.com
224
+
225
+# log out, removing the link and the auth token
226
+npm logout --scope=@mycorp
227
+```
228
+
229
+This will cause `@mycorp` to be mapped to the registry for future
230
+installation of packages specified according to the pattern
231
+`@mycorp/package`.
232
+
233
+This will also cause `npm init` to create a scoped package.
234
+
235
+```
236
+# accept all defaults, and create a package named "@foo/whatever",
237
+# instead of just named "whatever"
238
+npm init --scope=@foo --yes
239
+```
240
+
241
+
242
+
243
+#### `workspace`
244
+
245
+* Default:
246
+* Type: String (can be set multiple times)
247
+
248
+Enable running a command in the context of the configured workspaces of the
249
+current project while filtering by running only the workspaces defined by
250
+this configuration option.
251
+
252
+Valid values for the `workspace` config are either:
253
+
254
+* Workspace names
255
+* Path to a workspace directory
256
+* Path to a parent workspace directory (will result in selecting all
257
+ workspaces within that folder)
258
+
259
+When set for the `npm init` command, this may be set to the folder of a
260
+workspace which does not yet exist, to create the folder and set it up as a
261
+brand new workspace within the project.
262
+
263
+This value is not exported to the environment for child processes.
264
+
265
+#### `workspaces`
266
+
267
+* Default: null
268
+* Type: null or Boolean
269
+
270
+Set to true to run the command in the context of **all** configured
271
+workspaces.
272
+
273
+Explicitly setting this to false will cause commands like `install` to
274
+ignore workspaces altogether. When not set explicitly:
275
+
276
+- Commands that operate on the `node_modules` tree (install, update, etc.)
277
+will link workspaces into the `node_modules` folder. - Commands that do
278
+other things (test, exec, publish, etc.) will operate on the root project,
279
+_unless_ one or more workspaces are specified in the `workspace` config.
280
+
281
+This value is not exported to the environment for child processes.
282
+
283
+#### `workspaces-update`
284
+
285
+* Default: true
286
+* Type: Boolean
287
+
288
+If set to true, the npm cli will run an update after operations that may
289
+possibly change the workspaces installed to the `node_modules` folder.
290
+
291
+
292
+
293
+#### `include-workspace-root`
294
+
295
+* Default: false
296
+* Type: Boolean
297
+
298
+Include the workspace root when workspaces are enabled for a command.
299
+
300
+When false, specifying individual workspaces via the `workspace` config, or
301
+all workspaces via the `workspaces` flag, will cause npm to operate only on
302
+the specified workspaces, and not on the root project.
303
+
304
+This value is not exported to the environment for child processes.
305
+
306
+### See Also
307
+
308
+* [package spec](/cli/v10/using-npm/package-spec)
309
+* [init-package-json module](http://npm.im/init-package-json)
310
+* [package.json](/cli/v10/configuring-npm/package-json)
311
+* [npm version](/cli/v10/commands/npm-version)
312
+* [npm scope](/cli/v10/using-npm/scope)
313
+* [npm exec](/cli/v10/commands/npm-exec)
314
+* [npm workspaces](/cli/v10/using-npm/workspaces)
content/cli/v10/commands/npm-install-ci-test.md
new
+265
@@ -0,0 +1,265 @@
1
+---
2
+title: npm-install-ci-test
3
+section: 1
4
+description: Install a project with a clean slate and run tests
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-install-ci-test.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/install-ci-test
10
+ - /cli-documentation/v10/cli-commands/npm-install-ci-test
11
+ - /cli-documentation/v10/commands/install-ci-test
12
+ - /cli-documentation/v10/commands/npm-install-ci-test
13
+ - /cli-documentation/v10/install-ci-test
14
+ - /cli-documentation/v10/npm-install-ci-test
15
+ - /cli/v10/cli-commands/install-ci-test
16
+ - /cli/v10/cli-commands/npm-install-ci-test
17
+ - /cli/v10/commands/install-ci-test
18
+ - /cli/v10/install-ci-test
19
+ - /cli/v10/npm-install-ci-test
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm install-ci-test
26
+
27
+aliases: cit, clean-install-test, sit
28
+```
29
+
30
+### Description
31
+
32
+This command runs `npm ci` followed immediately by `npm test`.
33
+
34
+### Configuration
35
+
36
+#### `install-strategy`
37
+
38
+* Default: "hoisted"
39
+* Type: "hoisted", "nested", "shallow", or "linked"
40
+
41
+Sets the strategy for installing packages in node_modules. hoisted
42
+(default): Install non-duplicated in top-level, and duplicated as necessary
43
+within directory structure. nested: (formerly --legacy-bundling) install in
44
+place, no hoisting. shallow (formerly --global-style) only install direct
45
+deps at top-level. linked: (experimental) install in node_modules/.store,
46
+link in place, unhoisted.
47
+
48
+
49
+
50
+#### `legacy-bundling`
51
+
52
+* Default: false
53
+* Type: Boolean
54
+* DEPRECATED: This option has been deprecated in favor of
55
+ `--install-strategy=nested`
56
+
57
+Instead of hoisting package installs in `node_modules`, install packages in
58
+the same manner that they are depended on. This may cause very deep
59
+directory structures and duplicate package installs as there is no
60
+de-duplicating. Sets `--install-strategy=nested`.
61
+
62
+
63
+
64
+#### `global-style`
65
+
66
+* Default: false
67
+* Type: Boolean
68
+* DEPRECATED: This option has been deprecated in favor of
69
+ `--install-strategy=shallow`
70
+
71
+Only install direct dependencies in the top level `node_modules`, but hoist
72
+on deeper dependencies. Sets `--install-strategy=shallow`.
73
+
74
+
75
+
76
+#### `omit`
77
+
78
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
79
+ 'production', otherwise empty.
80
+* Type: "dev", "optional", or "peer" (can be set multiple times)
81
+
82
+Dependency types to omit from the installation tree on disk.
83
+
84
+Note that these dependencies _are_ still resolved and added to the
85
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
86
+physically installed on disk.
87
+
88
+If a package type appears in both the `--include` and `--omit` lists, then
89
+it will be included.
90
+
91
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
92
+variable will be set to `'production'` for all lifecycle scripts.
93
+
94
+
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 an 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
+
116
+
117
+#### `foreground-scripts`
118
+
119
+* Default: false
120
+* Type: Boolean
121
+
122
+Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)
123
+scripts for installed packages in the foreground process, sharing standard
124
+input, output, and error with the main npm process.
125
+
126
+Note that this will generally make installs run slower, and be much noisier,
127
+but can be useful for debugging.
128
+
129
+
130
+
131
+#### `ignore-scripts`
132
+
133
+* Default: false
134
+* Type: Boolean
135
+
136
+If true, npm does not run scripts specified in package.json files.
137
+
138
+Note that commands explicitly intended to run a particular script, such as
139
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
140
+will still run their intended script if `ignore-scripts` is set, but they
141
+will *not* run any pre- or post-scripts.
142
+
143
+
144
+
145
+#### `audit`
146
+
147
+* Default: true
148
+* Type: Boolean
149
+
150
+When "true" submit audit reports alongside the current npm command to the
151
+default registry and all registries configured for scopes. See the
152
+documentation for [`npm audit`](/cli/v10/commands/npm-audit) for details on what is
153
+submitted.
154
+
155
+
156
+
157
+#### `bin-links`
158
+
159
+* Default: true
160
+* Type: Boolean
161
+
162
+Tells npm to create symlinks (or `.cmd` shims on Windows) for package
163
+executables.
164
+
165
+Set to false to have it not do this. This can be used to work around the
166
+fact that some file systems don't support symlinks, even on ostensibly Unix
167
+systems.
168
+
169
+
170
+
171
+#### `fund`
172
+
173
+* Default: true
174
+* Type: Boolean
175
+
176
+When "true" displays the message at the end of each `npm install`
177
+acknowledging the number of dependencies looking for funding. See [`npm
178
+fund`](/cli/v10/commands/npm-fund) for details.
179
+
180
+
181
+
182
+#### `dry-run`
183
+
184
+* Default: false
185
+* Type: Boolean
186
+
187
+Indicates that you don't want npm to make any changes and that it should
188
+only report what it would have done. This can be passed into any of the
189
+commands that modify your local installation, eg, `install`, `update`,
190
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
191
+
192
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
193
+`owner`, etc.
194
+
195
+
196
+
197
+#### `workspace`
198
+
199
+* Default:
200
+* Type: String (can be set multiple times)
201
+
202
+Enable running a command in the context of the configured workspaces of the
203
+current project while filtering by running only the workspaces defined by
204
+this configuration option.
205
+
206
+Valid values for the `workspace` config are either:
207
+
208
+* Workspace names
209
+* Path to a workspace directory
210
+* Path to a parent workspace directory (will result in selecting all
211
+ workspaces within that folder)
212
+
213
+When set for the `npm init` command, this may be set to the folder of a
214
+workspace which does not yet exist, to create the folder and set it up as a
215
+brand new workspace within the project.
216
+
217
+This value is not exported to the environment for child processes.
218
+
219
+#### `workspaces`
220
+
221
+* Default: null
222
+* Type: null or Boolean
223
+
224
+Set to true to run the command in the context of **all** configured
225
+workspaces.
226
+
227
+Explicitly setting this to false will cause commands like `install` to
228
+ignore workspaces altogether. When not set explicitly:
229
+
230
+- Commands that operate on the `node_modules` tree (install, update, etc.)
231
+will link workspaces into the `node_modules` folder. - Commands that do
232
+other things (test, exec, publish, etc.) will operate on the root project,
233
+_unless_ one or more workspaces are specified in the `workspace` config.
234
+
235
+This value is not exported to the environment for child processes.
236
+
237
+#### `include-workspace-root`
238
+
239
+* Default: false
240
+* Type: Boolean
241
+
242
+Include the workspace root when workspaces are enabled for a command.
243
+
244
+When false, specifying individual workspaces via the `workspace` config, or
245
+all workspaces via the `workspaces` flag, will cause npm to operate only on
246
+the specified workspaces, and not on the root project.
247
+
248
+This value is not exported to the environment for child processes.
249
+
250
+#### `install-links`
251
+
252
+* Default: false
253
+* Type: Boolean
254
+
255
+When set file: protocol dependencies will be packed and installed as regular
256
+dependencies instead of creating a symlink. This option has no effect on
257
+workspaces.
258
+
259
+
260
+
261
+### See Also
262
+
263
+* [npm install-test](/cli/v10/commands/npm-install-test)
264
+* [npm ci](/cli/v10/commands/npm-ci)
265
+* [npm test](/cli/v10/commands/npm-test)
content/cli/v10/commands/npm-install-test.md
new
+342
@@ -0,0 +1,342 @@
1
+---
2
+title: npm-install-test
3
+section: 1
4
+description: Install package(s) and run tests
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-install-test.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/install-test
10
+ - /cli-documentation/v10/cli-commands/npm-install-test
11
+ - /cli-documentation/v10/commands/install-test
12
+ - /cli-documentation/v10/commands/npm-install-test
13
+ - /cli-documentation/v10/install-test
14
+ - /cli-documentation/v10/npm-install-test
15
+ - /cli/v10/cli-commands/install-test
16
+ - /cli/v10/cli-commands/npm-install-test
17
+ - /cli/v10/commands/install-test
18
+ - /cli/v10/install-test
19
+ - /cli/v10/npm-install-test
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm install-test [<package-spec> ...]
26
+
27
+alias: it
28
+```
29
+
30
+### Description
31
+
32
+This command runs an `npm install` followed immediately by an `npm test`. It
33
+takes exactly the same arguments as `npm install`.
34
+
35
+### Configuration
36
+
37
+#### `save`
38
+
39
+* Default: `true` unless when using `npm update` where it defaults to `false`
40
+* Type: Boolean
41
+
42
+Save installed packages to a `package.json` file as dependencies.
43
+
44
+When used with the `npm rm` command, removes the dependency from
45
+`package.json`.
46
+
47
+Will also prevent writing to `package-lock.json` if set to `false`.
48
+
49
+
50
+
51
+#### `save-exact`
52
+
53
+* Default: false
54
+* Type: Boolean
55
+
56
+Dependencies saved to package.json will be configured with an exact version
57
+rather than using npm's default semver range operator.
58
+
59
+
60
+
61
+#### `global`
62
+
63
+* Default: false
64
+* Type: Boolean
65
+
66
+Operates in "global" mode, so that packages are installed into the `prefix`
67
+folder instead of the current working directory. See
68
+[folders](/cli/v10/configuring-npm/folders) for more on the differences in behavior.
69
+
70
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
71
+ of the current working directory.
72
+* bin files are linked to `{prefix}/bin`
73
+* man pages are linked to `{prefix}/share/man`
74
+
75
+
76
+
77
+#### `install-strategy`
78
+
79
+* Default: "hoisted"
80
+* Type: "hoisted", "nested", "shallow", or "linked"
81
+
82
+Sets the strategy for installing packages in node_modules. hoisted
83
+(default): Install non-duplicated in top-level, and duplicated as necessary
84
+within directory structure. nested: (formerly --legacy-bundling) install in
85
+place, no hoisting. shallow (formerly --global-style) only install direct
86
+deps at top-level. linked: (experimental) install in node_modules/.store,
87
+link in place, unhoisted.
88
+
89
+
90
+
91
+#### `legacy-bundling`
92
+
93
+* Default: false
94
+* Type: Boolean
95
+* DEPRECATED: This option has been deprecated in favor of
96
+ `--install-strategy=nested`
97
+
98
+Instead of hoisting package installs in `node_modules`, install packages in
99
+the same manner that they are depended on. This may cause very deep
100
+directory structures and duplicate package installs as there is no
101
+de-duplicating. Sets `--install-strategy=nested`.
102
+
103
+
104
+
105
+#### `global-style`
106
+
107
+* Default: false
108
+* Type: Boolean
109
+* DEPRECATED: This option has been deprecated in favor of
110
+ `--install-strategy=shallow`
111
+
112
+Only install direct dependencies in the top level `node_modules`, but hoist
113
+on deeper dependencies. Sets `--install-strategy=shallow`.
114
+
115
+
116
+
117
+#### `omit`
118
+
119
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
120
+ 'production', otherwise empty.
121
+* Type: "dev", "optional", or "peer" (can be set multiple times)
122
+
123
+Dependency types to omit from the installation tree on disk.
124
+
125
+Note that these dependencies _are_ still resolved and added to the
126
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
127
+physically installed on disk.
128
+
129
+If a package type appears in both the `--include` and `--omit` lists, then
130
+it will be included.
131
+
132
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
133
+variable will be set to `'production'` for all lifecycle scripts.
134
+
135
+
136
+
137
+#### `strict-peer-deps`
138
+
139
+* Default: false
140
+* Type: Boolean
141
+
142
+If set to `true`, and `--legacy-peer-deps` is not set, then _any_
143
+conflicting `peerDependencies` will be treated as an install failure, even
144
+if npm could reasonably guess the appropriate resolution based on non-peer
145
+dependency relationships.
146
+
147
+By default, conflicting `peerDependencies` deep in the dependency graph will
148
+be resolved using the nearest non-peer dependency specification, even if
149
+doing so will result in some packages receiving a peer dependency outside
150
+the range set in their package's `peerDependencies` object.
151
+
152
+When such an override is performed, a warning is printed, explaining the
153
+conflict and the packages involved. If `--strict-peer-deps` is set, then
154
+this warning is treated as a failure.
155
+
156
+
157
+
158
+#### `prefer-dedupe`
159
+
160
+* Default: false
161
+* Type: Boolean
162
+
163
+Prefer to deduplicate packages if possible, rather than choosing a newer
164
+version of a dependency.
165
+
166
+
167
+
168
+#### `package-lock`
169
+
170
+* Default: true
171
+* Type: Boolean
172
+
173
+If set to false, then ignore `package-lock.json` files when installing. This
174
+will also prevent _writing_ `package-lock.json` if `save` is true.
175
+
176
+
177
+
178
+#### `package-lock-only`
179
+
180
+* Default: false
181
+* Type: Boolean
182
+
183
+If set to true, the current operation will only use the `package-lock.json`,
184
+ignoring `node_modules`.
185
+
186
+For `update` this means only the `package-lock.json` will be updated,
187
+instead of checking `node_modules` and downloading dependencies.
188
+
189
+For `list` this means the output will be based on the tree described by the
190
+`package-lock.json`, rather than the contents of `node_modules`.
191
+
192
+
193
+
194
+#### `foreground-scripts`
195
+
196
+* Default: false
197
+* Type: Boolean
198
+
199
+Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)
200
+scripts for installed packages in the foreground process, sharing standard
201
+input, output, and error with the main npm process.
202
+
203
+Note that this will generally make installs run slower, and be much noisier,
204
+but can be useful for debugging.
205
+
206
+
207
+
208
+#### `ignore-scripts`
209
+
210
+* Default: false
211
+* Type: Boolean
212
+
213
+If true, npm does not run scripts specified in package.json files.
214
+
215
+Note that commands explicitly intended to run a particular script, such as
216
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
217
+will still run their intended script if `ignore-scripts` is set, but they
218
+will *not* run any pre- or post-scripts.
219
+
220
+
221
+
222
+#### `audit`
223
+
224
+* Default: true
225
+* Type: Boolean
226
+
227
+When "true" submit audit reports alongside the current npm command to the
228
+default registry and all registries configured for scopes. See the
229
+documentation for [`npm audit`](/cli/v10/commands/npm-audit) for details on what is
230
+submitted.
231
+
232
+
233
+
234
+#### `bin-links`
235
+
236
+* Default: true
237
+* Type: Boolean
238
+
239
+Tells npm to create symlinks (or `.cmd` shims on Windows) for package
240
+executables.
241
+
242
+Set to false to have it not do this. This can be used to work around the
243
+fact that some file systems don't support symlinks, even on ostensibly Unix
244
+systems.
245
+
246
+
247
+
248
+#### `fund`
249
+
250
+* Default: true
251
+* Type: Boolean
252
+
253
+When "true" displays the message at the end of each `npm install`
254
+acknowledging the number of dependencies looking for funding. See [`npm
255
+fund`](/cli/v10/commands/npm-fund) for details.
256
+
257
+
258
+
259
+#### `dry-run`
260
+
261
+* Default: false
262
+* Type: Boolean
263
+
264
+Indicates that you don't want npm to make any changes and that it should
265
+only report what it would have done. This can be passed into any of the
266
+commands that modify your local installation, eg, `install`, `update`,
267
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
268
+
269
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
270
+`owner`, etc.
271
+
272
+
273
+
274
+#### `workspace`
275
+
276
+* Default:
277
+* Type: String (can be set multiple times)
278
+
279
+Enable running a command in the context of the configured workspaces of the
280
+current project while filtering by running only the workspaces defined by
281
+this configuration option.
282
+
283
+Valid values for the `workspace` config are either:
284
+
285
+* Workspace names
286
+* Path to a workspace directory
287
+* Path to a parent workspace directory (will result in selecting all
288
+ workspaces within that folder)
289
+
290
+When set for the `npm init` command, this may be set to the folder of a
291
+workspace which does not yet exist, to create the folder and set it up as a
292
+brand new workspace within the project.
293
+
294
+This value is not exported to the environment for child processes.
295
+
296
+#### `workspaces`
297
+
298
+* Default: null
299
+* Type: null or Boolean
300
+
301
+Set to true to run the command in the context of **all** configured
302
+workspaces.
303
+
304
+Explicitly setting this to false will cause commands like `install` to
305
+ignore workspaces altogether. When not set explicitly:
306
+
307
+- Commands that operate on the `node_modules` tree (install, update, etc.)
308
+will link workspaces into the `node_modules` folder. - Commands that do
309
+other things (test, exec, publish, etc.) will operate on the root project,
310
+_unless_ one or more workspaces are specified in the `workspace` config.
311
+
312
+This value is not exported to the environment for child processes.
313
+
314
+#### `include-workspace-root`
315
+
316
+* Default: false
317
+* Type: Boolean
318
+
319
+Include the workspace root when workspaces are enabled for a command.
320
+
321
+When false, specifying individual workspaces via the `workspace` config, or
322
+all workspaces via the `workspaces` flag, will cause npm to operate only on
323
+the specified workspaces, and not on the root project.
324
+
325
+This value is not exported to the environment for child processes.
326
+
327
+#### `install-links`
328
+
329
+* Default: false
330
+* Type: Boolean
331
+
332
+When set file: protocol dependencies will be packed and installed as regular
333
+dependencies instead of creating a symlink. This option has no effect on
334
+workspaces.
335
+
336
+
337
+
338
+### See Also
339
+
340
+* [npm install](/cli/v10/commands/npm-install)
341
+* [npm install-ci-test](/cli/v10/commands/npm-install-ci-test)
342
+* [npm test](/cli/v10/commands/npm-test)
content/cli/v10/commands/npm-install.md
new
+778
@@ -0,0 +1,778 @@
1
+---
2
+title: npm-install
3
+section: 1
4
+description: Install a package
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-install.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/install
10
+ - /cli-documentation/v10/cli-commands/npm-install
11
+ - /cli-documentation/v10/commands/install
12
+ - /cli-documentation/v10/commands/npm-install
13
+ - /cli-documentation/v10/install
14
+ - /cli-documentation/v10/npm-install
15
+ - /cli/v10/cli-commands/install
16
+ - /cli/v10/cli-commands/npm-install
17
+ - /cli/v10/commands/install
18
+ - /cli/v10/install
19
+ - /cli/v10/npm-install
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm install [<package-spec> ...]
26
+
27
+aliases: add, i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall
28
+```
29
+
30
+### Description
31
+
32
+This command installs a package and any packages that it depends on. If the
33
+package has a package-lock, or an npm shrinkwrap file, or a yarn lock file,
34
+the installation of dependencies will be driven by that, respecting the
35
+following order of precedence:
36
+
37
+* `npm-shrinkwrap.json`
38
+* `package-lock.json`
39
+* `yarn.lock`
40
+
41
+See [package-lock.json](/cli/v10/configuring-npm/package-lock-json) and
42
+[`npm shrinkwrap`](/cli/v10/commands/npm-shrinkwrap).
43
+
44
+A `package` is:
45
+
46
+* a) a folder containing a program described by a
47
+ [`package.json`](/cli/v10/configuring-npm/package-json) file
48
+* b) a gzipped tarball containing (a)
49
+* c) a url that resolves to (b)
50
+* d) a `<name>@<version>` that is published on the registry (see
51
+ [`registry`](/cli/v10/using-npm/registry)) with (c)
52
+* e) a `<name>@<tag>` (see [`npm dist-tag`](/cli/v10/commands/npm-dist-tag)) that
53
+ points to (d)
54
+* f) a `<name>` that has a "latest" tag satisfying (e)
55
+* g) a `<git remote url>` that resolves to (a)
56
+
57
+Even if you never publish your package, you can still get a lot of benefits
58
+of using npm if you just want to write a node program (a), and perhaps if
59
+you also want to be able to easily install it elsewhere after packing it up
60
+into a tarball (b).
61
+
62
+
63
+* `npm install` (in a package directory, no arguments):
64
+
65
+ Install the dependencies to the local `node_modules` folder.
66
+
67
+ In global mode (ie, with `-g` or `--global` appended to the command),
68
+ it installs the current package context (ie, the current working
69
+ directory) as a global package.
70
+
71
+ By default, `npm install` will install all modules listed as
72
+ dependencies in [`package.json`](/cli/v10/configuring-npm/package-json).
73
+
74
+ With the `--production` flag (or when the `NODE_ENV` environment
75
+ variable is set to `production`), npm will not install modules listed
76
+ in `devDependencies`. To install all modules listed in both
77
+ `dependencies` and `devDependencies` when `NODE_ENV` environment
78
+ variable is set to `production`, you can use `--production=false`.
79
+
80
+ > NOTE: The `--production` flag has no particular meaning when adding a
81
+ dependency to a project.
82
+
83
+* `npm install <folder>`:
84
+
85
+ If `<folder>` sits inside the root of your project, its dependencies will be installed and may
86
+ be hoisted to the top-level `node_modules` as they would for other
87
+ types of dependencies. If `<folder>` sits outside the root of your project,
88
+ *npm will not install the package dependencies* in the directory `<folder>`,
89
+ but it will create a symlink to `<folder>`.
90
+
91
+ > NOTE: If you want to install the content of a directory like a package from the registry instead of creating a link, you would need to use the `--install-links` option.
92
+
93
+ Example:
94
+
95
+ ```bash
96
+ npm install ../../other-package --install-links
97
+ npm install ./sub-package
98
+ ```
99
+
100
+* `npm install <tarball file>`:
101
+
102
+ Install a package that is sitting on the filesystem. Note: if you just
103
+ want to link a dev directory into your npm root, you can do this more
104
+ easily by using [`npm link`](/cli/v10/commands/npm-link).
105
+
106
+ Tarball requirements:
107
+ * The filename *must* use `.tar`, `.tar.gz`, or `.tgz` as the
108
+ extension.
109
+ * The package contents should reside in a subfolder inside the tarball
110
+ (usually it is called `package/`). npm strips one directory layer
111
+ when installing the package (an equivalent of `tar x
112
+ --strip-components=1` is run).
113
+ * The package must contain a `package.json` file with `name` and
114
+ `version` properties.
115
+
116
+ Example:
117
+
118
+ ```bash
119
+ npm install ./package.tgz
120
+ ```
121
+
122
+* `npm install <tarball url>`:
123
+
124
+ Fetch the tarball url, and then install it. In order to distinguish between
125
+ this and other options, the argument must start with "http://" or "https://"
126
+
127
+ Example:
128
+
129
+ ```bash
130
+ npm install https://github.com/indexzero/forever/tarball/v0.5.6
131
+ ```
132
+
133
+* `npm install [<@scope>/]<name>`:
134
+
135
+ Do a `<name>@<tag>` install, where `<tag>` is the "tag" config. (See
136
+ [`config`](/cli/v10/using-npm/config#tag). The config's default value is `latest`.)
137
+
138
+ In most cases, this will install the version of the modules tagged as
139
+ `latest` on the npm registry.
140
+
141
+ Example:
142
+
143
+ ```bash
144
+ npm install sax
145
+ ```
146
+
147
+ `npm install` saves any specified packages into `dependencies` by default.
148
+ Additionally, you can control where and how they get saved with some
149
+ additional flags:
150
+
151
+ * `-P, --save-prod`: Package will appear in your `dependencies`. This
152
+ is the default unless `-D` or `-O` are present.
153
+
154
+ * `-D, --save-dev`: Package will appear in your `devDependencies`.
155
+
156
+ * `-O, --save-optional`: Package will appear in your
157
+ `optionalDependencies`.
158
+
159
+ * `--no-save`: Prevents saving to `dependencies`.
160
+
161
+ When using any of the above options to save dependencies to your
162
+ package.json, there are two additional, optional flags:
163
+
164
+ * `-E, --save-exact`: Saved dependencies will be configured with an
165
+ exact version rather than using npm's default semver range operator.
166
+
167
+ * `-B, --save-bundle`: Saved dependencies will also be added to your
168
+ `bundleDependencies` list.
169
+
170
+ Further, if you have an `npm-shrinkwrap.json` or `package-lock.json`
171
+ then it will be updated as well.
172
+
173
+ `<scope>` is optional. The package will be downloaded from the registry
174
+ associated with the specified scope. If no registry is associated with
175
+ the given scope the default registry is assumed. See
176
+ [`scope`](/cli/v10/using-npm/scope).
177
+
178
+ Note: if you do not include the @-symbol on your scope name, npm will
179
+ interpret this as a GitHub repository instead, see below. Scopes names
180
+ must also be followed by a slash.
181
+
182
+ Examples:
183
+
184
+ ```bash
185
+ npm install sax
186
+ npm install githubname/reponame
187
+ npm install @myorg/privatepackage
188
+ npm install node-tap --save-dev
189
+ npm install dtrace-provider --save-optional
190
+ npm install readable-stream --save-exact
191
+ npm install ansi-regex --save-bundle
192
+ ```
193
+
194
+ **Note**: If there is a file or folder named `<name>` in the current
195
+ working directory, then it will try to install that, and only try to
196
+ fetch the package by name if it is not valid.
197
+
198
+* `npm install <alias>@npm:<name>`:
199
+
200
+ Install a package under a custom alias. Allows multiple versions of
201
+ a same-name package side-by-side, more convenient import names for
202
+ packages with otherwise long ones, and using git forks replacements
203
+ or forked npm packages as replacements. Aliasing works only on your
204
+ project and does not rename packages in transitive dependencies.
205
+ Aliases should follow the naming conventions stated in
206
+ [`validate-npm-package-name`](https://www.npmjs.com/package/validate-npm-package-name#naming-rules).
207
+
208
+ Examples:
209
+
210
+ ```bash
211
+ npm install my-react@npm:react
212
+ npm install jquery2@npm:jquery@2
213
+ npm install jquery3@npm:jquery@3
214
+ npm install npa@npm:npm-package-arg
215
+ ```
216
+
217
+* `npm install [<@scope>/]<name>@<tag>`:
218
+
219
+ Install the version of the package that is referenced by the specified tag.
220
+ If the tag does not exist in the registry data for that package, then this
221
+ will fail.
222
+
223
+ Example:
224
+
225
+ ```bash
226
+ npm install sax@latest
227
+ npm install @myorg/mypackage@latest
228
+ ```
229
+
230
+* `npm install [<@scope>/]<name>@<version>`:
231
+
232
+ Install the specified version of the package. This will fail if the
233
+ version has not been published to the registry.
234
+
235
+ Example:
236
+
237
+ ```bash
238
+ npm install sax@0.1.1
239
+ npm install @myorg/privatepackage@1.5.0
240
+ ```
241
+
242
+* `npm install [<@scope>/]<name>@<version range>`:
243
+
244
+ Install a version of the package matching the specified version range.
245
+ This will follow the same rules for resolving dependencies described in
246
+ [`package.json`](/cli/v10/configuring-npm/package-json).
247
+
248
+ Note that most version ranges must be put in quotes so that your shell
249
+ will treat it as a single argument.
250
+
251
+ Example:
252
+
253
+ ```bash
254
+ npm install sax@">=0.1.0 <0.2.0"
255
+ npm install @myorg/privatepackage@"16 - 17"
256
+ ```
257
+
258
+* `npm install <git remote url>`:
259
+
260
+ Installs the package from the hosted git provider, cloning it with
261
+ `git`. For a full git remote url, only that URL will be attempted.
262
+
263
+ ```bash
264
+ <protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>[#<commit-ish> | #semver:<semver>]
265
+ ```
266
+
267
+ `<protocol>` is one of `git`, `git+ssh`, `git+http`, `git+https`, or
268
+ `git+file`.
269
+
270
+ If `#<commit-ish>` is provided, it will be used to clone exactly that
271
+ commit. If the commit-ish has the format `#semver:<semver>`, `<semver>`
272
+ can be any valid semver range or exact version, and npm will look for
273
+ any tags or refs matching that range in the remote repository, much as
274
+ it would for a registry dependency. If neither `#<commit-ish>` or
275
+ `#semver:<semver>` is specified, then the default branch of the
276
+ repository is used.
277
+
278
+ If the repository makes use of submodules, those submodules will be
279
+ cloned as well.
280
+
281
+ If the package being installed contains a `prepare` script, its
282
+ `dependencies` and `devDependencies` will be installed, and the prepare
283
+ script will be run, before the package is packaged and installed.
284
+
285
+ The following git environment variables are recognized by npm and will
286
+ be added to the environment when running git:
287
+
288
+ * `GIT_ASKPASS`
289
+ * `GIT_EXEC_PATH`
290
+ * `GIT_PROXY_COMMAND`
291
+ * `GIT_SSH`
292
+ * `GIT_SSH_COMMAND`
293
+ * `GIT_SSL_CAINFO`
294
+ * `GIT_SSL_NO_VERIFY`
295
+
296
+ See the git man page for details.
297
+
298
+ Examples:
299
+
300
+ ```bash
301
+ npm install git+ssh://git@github.com:npm/cli.git#v1.0.27
302
+ npm install git+ssh://git@github.com:npm/cli#pull/273
303
+ npm install git+ssh://git@github.com:npm/cli#semver:^5.0
304
+ npm install git+https://isaacs@github.com/npm/cli.git
305
+ npm install git://github.com/npm/cli.git#v1.0.27
306
+ GIT_SSH_COMMAND='ssh -i ~/.ssh/custom_ident' npm install git+ssh://git@github.com:npm/cli.git
307
+ ```
308
+
309
+* `npm install <githubname>/<githubrepo>[#<commit-ish>]`:
310
+* `npm install github:<githubname>/<githubrepo>[#<commit-ish>]`:
311
+
312
+ Install the package at `https://github.com/githubname/githubrepo` by
313
+ attempting to clone it using `git`.
314
+
315
+ If `#<commit-ish>` is provided, it will be used to clone exactly that
316
+ commit. If the commit-ish has the format `#semver:<semver>`, `<semver>`
317
+ can be any valid semver range or exact version, and npm will look for
318
+ any tags or refs matching that range in the remote repository, much as
319
+ it would for a registry dependency. If neither `#<commit-ish>` or
320
+ `#semver:<semver>` is specified, then the default branch is used.
321
+
322
+ As with regular git dependencies, `dependencies` and `devDependencies`
323
+ will be installed if the package has a `prepare` script before the
324
+ package is done installing.
325
+
326
+ Examples:
327
+
328
+ ```bash
329
+ npm install mygithubuser/myproject
330
+ npm install github:mygithubuser/myproject
331
+ ```
332
+
333
+* `npm install gist:[<githubname>/]<gistID>[#<commit-ish>|#semver:<semver>]`:
334
+
335
+ Install the package at `https://gist.github.com/gistID` by attempting to
336
+ clone it using `git`. The GitHub username associated with the gist is
337
+ optional and will not be saved in `package.json`.
338
+
339
+ As with regular git dependencies, `dependencies` and `devDependencies` will
340
+ be installed if the package has a `prepare` script before the package is
341
+ done installing.
342
+
343
+ Example:
344
+
345
+ ```bash
346
+ npm install gist:101a11beef
347
+ ```
348
+
349
+* `npm install bitbucket:<bitbucketname>/<bitbucketrepo>[#<commit-ish>]`:
350
+
351
+ Install the package at `https://bitbucket.org/bitbucketname/bitbucketrepo`
352
+ by attempting to clone it using `git`.
353
+
354
+ If `#<commit-ish>` is provided, it will be used to clone exactly that
355
+ commit. If the commit-ish has the format `#semver:<semver>`, `<semver>` can
356
+ be any valid semver range or exact version, and npm will look for any tags
357
+ or refs matching that range in the remote repository, much as it would for a
358
+ registry dependency. If neither `#<commit-ish>` or `#semver:<semver>` is
359
+ specified, then `master` is used.
360
+
361
+ As with regular git dependencies, `dependencies` and `devDependencies` will
362
+ be installed if the package has a `prepare` script before the package is
363
+ done installing.
364
+
365
+ Example:
366
+
367
+ ```bash
368
+ npm install bitbucket:mybitbucketuser/myproject
369
+ ```
370
+
371
+* `npm install gitlab:<gitlabname>/<gitlabrepo>[#<commit-ish>]`:
372
+
373
+ Install the package at `https://gitlab.com/gitlabname/gitlabrepo`
374
+ by attempting to clone it using `git`.
375
+
376
+ If `#<commit-ish>` is provided, it will be used to clone exactly that
377
+ commit. If the commit-ish has the format `#semver:<semver>`, `<semver>` can
378
+ be any valid semver range or exact version, and npm will look for any tags
379
+ or refs matching that range in the remote repository, much as it would for a
380
+ registry dependency. If neither `#<commit-ish>` or `#semver:<semver>` is
381
+ specified, then `master` is used.
382
+
383
+ As with regular git dependencies, `dependencies` and `devDependencies` will
384
+ be installed if the package has a `prepare` script before the package is
385
+ done installing.
386
+
387
+ Example:
388
+
389
+ ```bash
390
+ npm install gitlab:mygitlabuser/myproject
391
+ npm install gitlab:myusr/myproj#semver:^5.0
392
+ ```
393
+
394
+You may combine multiple arguments and even multiple types of arguments.
395
+For example:
396
+
397
+```bash
398
+npm install sax@">=0.1.0 <0.2.0" bench supervisor
399
+```
400
+
401
+The `--tag` argument will apply to all of the specified install targets. If
402
+a tag with the given name exists, the tagged version is preferred over
403
+newer versions.
404
+
405
+The `--dry-run` argument will report in the usual way what the install
406
+would have done without actually installing anything.
407
+
408
+The `--package-lock-only` argument will only update the
409
+`package-lock.json`, instead of checking `node_modules` and downloading
410
+dependencies.
411
+
412
+The `-f` or `--force` argument will force npm to fetch remote resources
413
+even if a local copy exists on disk.
414
+
415
+```bash
416
+npm install sax --force
417
+```
418
+
419
+### Configuration
420
+
421
+See the [`config`](/cli/v10/using-npm/config) help doc. Many of the configuration
422
+params have some effect on installation, since that's most of what npm
423
+does.
424
+
425
+These are some of the most common options related to installation.
426
+
427
+#### `save`
428
+
429
+* Default: `true` unless when using `npm update` where it defaults to `false`
430
+* Type: Boolean
431
+
432
+Save installed packages to a `package.json` file as dependencies.
433
+
434
+When used with the `npm rm` command, removes the dependency from
435
+`package.json`.
436
+
437
+Will also prevent writing to `package-lock.json` if set to `false`.
438
+
439
+
440
+
441
+#### `save-exact`
442
+
443
+* Default: false
444
+* Type: Boolean
445
+
446
+Dependencies saved to package.json will be configured with an exact version
447
+rather than using npm's default semver range operator.
448
+
449
+
450
+
451
+#### `global`
452
+
453
+* Default: false
454
+* Type: Boolean
455
+
456
+Operates in "global" mode, so that packages are installed into the `prefix`
457
+folder instead of the current working directory. See
458
+[folders](/cli/v10/configuring-npm/folders) for more on the differences in behavior.
459
+
460
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
461
+ of the current working directory.
462
+* bin files are linked to `{prefix}/bin`
463
+* man pages are linked to `{prefix}/share/man`
464
+
465
+
466
+
467
+#### `install-strategy`
468
+
469
+* Default: "hoisted"
470
+* Type: "hoisted", "nested", "shallow", or "linked"
471
+
472
+Sets the strategy for installing packages in node_modules. hoisted
473
+(default): Install non-duplicated in top-level, and duplicated as necessary
474
+within directory structure. nested: (formerly --legacy-bundling) install in
475
+place, no hoisting. shallow (formerly --global-style) only install direct
476
+deps at top-level. linked: (experimental) install in node_modules/.store,
477
+link in place, unhoisted.
478
+
479
+
480
+
481
+#### `legacy-bundling`
482
+
483
+* Default: false
484
+* Type: Boolean
485
+* DEPRECATED: This option has been deprecated in favor of
486
+ `--install-strategy=nested`
487
+
488
+Instead of hoisting package installs in `node_modules`, install packages in
489
+the same manner that they are depended on. This may cause very deep
490
+directory structures and duplicate package installs as there is no
491
+de-duplicating. Sets `--install-strategy=nested`.
492
+
493
+
494
+
495
+#### `global-style`
496
+
497
+* Default: false
498
+* Type: Boolean
499
+* DEPRECATED: This option has been deprecated in favor of
500
+ `--install-strategy=shallow`
501
+
502
+Only install direct dependencies in the top level `node_modules`, but hoist
503
+on deeper dependencies. Sets `--install-strategy=shallow`.
504
+
505
+
506
+
507
+#### `omit`
508
+
509
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
510
+ 'production', otherwise empty.
511
+* Type: "dev", "optional", or "peer" (can be set multiple times)
512
+
513
+Dependency types to omit from the installation tree on disk.
514
+
515
+Note that these dependencies _are_ still resolved and added to the
516
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
517
+physically installed on disk.
518
+
519
+If a package type appears in both the `--include` and `--omit` lists, then
520
+it will be included.
521
+
522
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
523
+variable will be set to `'production'` for all lifecycle scripts.
524
+
525
+
526
+
527
+#### `strict-peer-deps`
528
+
529
+* Default: false
530
+* Type: Boolean
531
+
532
+If set to `true`, and `--legacy-peer-deps` is not set, then _any_
533
+conflicting `peerDependencies` will be treated as an install failure, even
534
+if npm could reasonably guess the appropriate resolution based on non-peer
535
+dependency relationships.
536
+
537
+By default, conflicting `peerDependencies` deep in the dependency graph will
538
+be resolved using the nearest non-peer dependency specification, even if
539
+doing so will result in some packages receiving a peer dependency outside
540
+the range set in their package's `peerDependencies` object.
541
+
542
+When such an override is performed, a warning is printed, explaining the
543
+conflict and the packages involved. If `--strict-peer-deps` is set, then
544
+this warning is treated as a failure.
545
+
546
+
547
+
548
+#### `prefer-dedupe`
549
+
550
+* Default: false
551
+* Type: Boolean
552
+
553
+Prefer to deduplicate packages if possible, rather than choosing a newer
554
+version of a dependency.
555
+
556
+
557
+
558
+#### `package-lock`
559
+
560
+* Default: true
561
+* Type: Boolean
562
+
563
+If set to false, then ignore `package-lock.json` files when installing. This
564
+will also prevent _writing_ `package-lock.json` if `save` is true.
565
+
566
+
567
+
568
+#### `package-lock-only`
569
+
570
+* Default: false
571
+* Type: Boolean
572
+
573
+If set to true, the current operation will only use the `package-lock.json`,
574
+ignoring `node_modules`.
575
+
576
+For `update` this means only the `package-lock.json` will be updated,
577
+instead of checking `node_modules` and downloading dependencies.
578
+
579
+For `list` this means the output will be based on the tree described by the
580
+`package-lock.json`, rather than the contents of `node_modules`.
581
+
582
+
583
+
584
+#### `foreground-scripts`
585
+
586
+* Default: false
587
+* Type: Boolean
588
+
589
+Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)
590
+scripts for installed packages in the foreground process, sharing standard
591
+input, output, and error with the main npm process.
592
+
593
+Note that this will generally make installs run slower, and be much noisier,
594
+but can be useful for debugging.
595
+
596
+
597
+
598
+#### `ignore-scripts`
599
+
600
+* Default: false
601
+* Type: Boolean
602
+
603
+If true, npm does not run scripts specified in package.json files.
604
+
605
+Note that commands explicitly intended to run a particular script, such as
606
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
607
+will still run their intended script if `ignore-scripts` is set, but they
608
+will *not* run any pre- or post-scripts.
609
+
610
+
611
+
612
+#### `audit`
613
+
614
+* Default: true
615
+* Type: Boolean
616
+
617
+When "true" submit audit reports alongside the current npm command to the
618
+default registry and all registries configured for scopes. See the
619
+documentation for [`npm audit`](/cli/v10/commands/npm-audit) for details on what is
620
+submitted.
621
+
622
+
623
+
624
+#### `bin-links`
625
+
626
+* Default: true
627
+* Type: Boolean
628
+
629
+Tells npm to create symlinks (or `.cmd` shims on Windows) for package
630
+executables.
631
+
632
+Set to false to have it not do this. This can be used to work around the
633
+fact that some file systems don't support symlinks, even on ostensibly Unix
634
+systems.
635
+
636
+
637
+
638
+#### `fund`
639
+
640
+* Default: true
641
+* Type: Boolean
642
+
643
+When "true" displays the message at the end of each `npm install`
644
+acknowledging the number of dependencies looking for funding. See [`npm
645
+fund`](/cli/v10/commands/npm-fund) for details.
646
+
647
+
648
+
649
+#### `dry-run`
650
+
651
+* Default: false
652
+* Type: Boolean
653
+
654
+Indicates that you don't want npm to make any changes and that it should
655
+only report what it would have done. This can be passed into any of the
656
+commands that modify your local installation, eg, `install`, `update`,
657
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
658
+
659
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
660
+`owner`, etc.
661
+
662
+
663
+
664
+#### `workspace`
665
+
666
+* Default:
667
+* Type: String (can be set multiple times)
668
+
669
+Enable running a command in the context of the configured workspaces of the
670
+current project while filtering by running only the workspaces defined by
671
+this configuration option.
672
+
673
+Valid values for the `workspace` config are either:
674
+
675
+* Workspace names
676
+* Path to a workspace directory
677
+* Path to a parent workspace directory (will result in selecting all
678
+ workspaces within that folder)
679
+
680
+When set for the `npm init` command, this may be set to the folder of a
681
+workspace which does not yet exist, to create the folder and set it up as a
682
+brand new workspace within the project.
683
+
684
+This value is not exported to the environment for child processes.
685
+
686
+#### `workspaces`
687
+
688
+* Default: null
689
+* Type: null or Boolean
690
+
691
+Set to true to run the command in the context of **all** configured
692
+workspaces.
693
+
694
+Explicitly setting this to false will cause commands like `install` to
695
+ignore workspaces altogether. When not set explicitly:
696
+
697
+- Commands that operate on the `node_modules` tree (install, update, etc.)
698
+will link workspaces into the `node_modules` folder. - Commands that do
699
+other things (test, exec, publish, etc.) will operate on the root project,
700
+_unless_ one or more workspaces are specified in the `workspace` config.
701
+
702
+This value is not exported to the environment for child processes.
703
+
704
+#### `include-workspace-root`
705
+
706
+* Default: false
707
+* Type: Boolean
708
+
709
+Include the workspace root when workspaces are enabled for a command.
710
+
711
+When false, specifying individual workspaces via the `workspace` config, or
712
+all workspaces via the `workspaces` flag, will cause npm to operate only on
713
+the specified workspaces, and not on the root project.
714
+
715
+This value is not exported to the environment for child processes.
716
+
717
+#### `install-links`
718
+
719
+* Default: false
720
+* Type: Boolean
721
+
722
+When set file: protocol dependencies will be packed and installed as regular
723
+dependencies instead of creating a symlink. This option has no effect on
724
+workspaces.
725
+
726
+
727
+
728
+### Algorithm
729
+
730
+Given a `package{dep}` structure: `A{B,C}, B{C}, C{D}`,
731
+the npm install algorithm produces:
732
+
733
+```bash
734
+A
735
++-- B
736
++-- C
737
++-- D
738
+```
739
+
740
+That is, the dependency from B to C is satisfied by the fact that A already
741
+caused C to be installed at a higher level. D is still installed at the top
742
+level because nothing conflicts with it.
743
+
744
+For `A{B,C}, B{C,D@1}, C{D@2}`, this algorithm produces:
745
+
746
+```bash
747
+A
748
++-- B
749
++-- C
750
+ `-- D@2
751
++-- D@1
752
+```
753
+
754
+Because B's D@1 will be installed in the top-level, C now has to install
755
+D@2 privately for itself. This algorithm is deterministic, but different
756
+trees may be produced if two dependencies are requested for installation in
757
+a different order.
758
+
759
+See [folders](/cli/v10/configuring-npm/folders) for a more detailed description of
760
+the specific folder structures that npm creates.
761
+
762
+### See Also
763
+
764
+* [npm folders](/cli/v10/configuring-npm/folders)
765
+* [npm update](/cli/v10/commands/npm-update)
766
+* [npm audit](/cli/v10/commands/npm-audit)
767
+* [npm fund](/cli/v10/commands/npm-fund)
768
+* [npm link](/cli/v10/commands/npm-link)
769
+* [npm rebuild](/cli/v10/commands/npm-rebuild)
770
+* [npm scripts](/cli/v10/using-npm/scripts)
771
+* [npm config](/cli/v10/commands/npm-config)
772
+* [npmrc](/cli/v10/configuring-npm/npmrc)
773
+* [npm registry](/cli/v10/using-npm/registry)
774
+* [npm dist-tag](/cli/v10/commands/npm-dist-tag)
775
+* [npm uninstall](/cli/v10/commands/npm-uninstall)
776
+* [npm shrinkwrap](/cli/v10/commands/npm-shrinkwrap)
777
+* [package.json](/cli/v10/configuring-npm/package-json)
778
+* [workspaces](/cli/v10/using-npm/workspaces)
content/cli/v10/commands/npm-link.md
new
+397
@@ -0,0 +1,397 @@
1
+---
2
+title: npm-link
3
+section: 1
4
+description: Symlink a package folder
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-link.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/link
10
+ - /cli-documentation/v10/cli-commands/npm-link
11
+ - /cli-documentation/v10/commands/link
12
+ - /cli-documentation/v10/commands/npm-link
13
+ - /cli-documentation/v10/link
14
+ - /cli-documentation/v10/npm-link
15
+ - /cli/v10/cli-commands/link
16
+ - /cli/v10/cli-commands/npm-link
17
+ - /cli/v10/commands/link
18
+ - /cli/v10/link
19
+ - /cli/v10/npm-link
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm link [<package-spec>]
26
+
27
+alias: ln
28
+```
29
+
30
+### Description
31
+
32
+This is handy for installing your own stuff, so that you can work on it and
33
+test iteratively without having to continually rebuild.
34
+
35
+Package linking is a two-step process.
36
+
37
+First, `npm link` in a package folder with no arguments will create a
38
+symlink in the global folder `{prefix}/lib/node_modules/<package>` that
39
+links to the package where the `npm link` command was executed. It will
40
+also link any bins in the package to `{prefix}/bin/{name}`. Note that
41
+`npm link` uses the global prefix (see `npm prefix -g` for its value).
42
+
43
+Next, in some other location, `npm link package-name` will create a
44
+symbolic link from globally-installed `package-name` to `node_modules/` of
45
+the current folder.
46
+
47
+Note that `package-name` is taken from `package.json`, _not_ from the
48
+directory name.
49
+
50
+The package name can be optionally prefixed with a scope. See
51
+[`scope`](/cli/v10/using-npm/scope). The scope must be preceded by an @-symbol and
52
+followed by a slash.
53
+
54
+When creating tarballs for `npm publish`, the linked packages are
55
+"snapshotted" to their current state by resolving the symbolic links, if
56
+they are included in `bundleDependencies`.
57
+
58
+For example:
59
+
60
+```bash
61
+cd ~/projects/node-redis # go into the package directory
62
+npm link # creates global link
63
+cd ~/projects/node-bloggy # go into some other package directory.
64
+npm link redis # link-install the package
65
+```
66
+
67
+Now, any changes to `~/projects/node-redis` will be reflected in
68
+`~/projects/node-bloggy/node_modules/node-redis/`. Note that the link
69
+should be to the package name, not the directory name for that package.
70
+
71
+You may also shortcut the two steps in one. For example, to do the
72
+above use-case in a shorter way:
73
+
74
+```bash
75
+cd ~/projects/node-bloggy # go into the dir of your main project
76
+npm link ../node-redis # link the dir of your dependency
77
+```
78
+
79
+The second line is the equivalent of doing:
80
+
81
+```bash
82
+(cd ../node-redis; npm link)
83
+npm link redis
84
+```
85
+
86
+That is, it first creates a global link, and then links the global
87
+installation target into your project's `node_modules` folder.
88
+
89
+Note that in this case, you are referring to the directory name,
90
+`node-redis`, rather than the package name `redis`.
91
+
92
+If your linked package is scoped (see [`scope`](/cli/v10/using-npm/scope)) your
93
+link command must include that scope, e.g.
94
+
95
+```bash
96
+npm link @myorg/privatepackage
97
+```
98
+
99
+### Caveat
100
+
101
+Note that package dependencies linked in this way are _not_ saved to
102
+`package.json` by default, on the assumption that the intention is to have
103
+a link stand in for a regular non-link dependency. Otherwise, for example,
104
+if you depend on `redis@^3.0.1`, and ran `npm link redis`, it would replace
105
+the `^3.0.1` dependency with `file:../path/to/node-redis`, which you
106
+probably don't want! Additionally, other users or developers on your
107
+project would run into issues if they do not have their folders set up
108
+exactly the same as yours.
109
+
110
+If you are adding a _new_ dependency as a link, you should add it to the
111
+relevant metadata by running `npm install <dep> --package-lock-only`.
112
+
113
+If you _want_ to save the `file:` reference in your `package.json` and
114
+`package-lock.json` files, you can use `npm link <dep> --save` to do so.
115
+
116
+### Workspace Usage
117
+
118
+`npm link <pkg> --workspace <name>` will link the relevant package as a
119
+dependency of the specified workspace(s). Note that It may actually be
120
+linked into the parent project's `node_modules` folder, if there are no
121
+conflicting dependencies.
122
+
123
+`npm link --workspace <name>` will create a global link to the specified
124
+workspace(s).
125
+
126
+### Configuration
127
+
128
+#### `save`
129
+
130
+* Default: `true` unless when using `npm update` where it defaults to `false`
131
+* Type: Boolean
132
+
133
+Save installed packages to a `package.json` file as dependencies.
134
+
135
+When used with the `npm rm` command, removes the dependency from
136
+`package.json`.
137
+
138
+Will also prevent writing to `package-lock.json` if set to `false`.
139
+
140
+
141
+
142
+#### `save-exact`
143
+
144
+* Default: false
145
+* Type: Boolean
146
+
147
+Dependencies saved to package.json will be configured with an exact version
148
+rather than using npm's default semver range operator.
149
+
150
+
151
+
152
+#### `global`
153
+
154
+* Default: false
155
+* Type: Boolean
156
+
157
+Operates in "global" mode, so that packages are installed into the `prefix`
158
+folder instead of the current working directory. See
159
+[folders](/cli/v10/configuring-npm/folders) for more on the differences in behavior.
160
+
161
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
162
+ of the current working directory.
163
+* bin files are linked to `{prefix}/bin`
164
+* man pages are linked to `{prefix}/share/man`
165
+
166
+
167
+
168
+#### `install-strategy`
169
+
170
+* Default: "hoisted"
171
+* Type: "hoisted", "nested", "shallow", or "linked"
172
+
173
+Sets the strategy for installing packages in node_modules. hoisted
174
+(default): Install non-duplicated in top-level, and duplicated as necessary
175
+within directory structure. nested: (formerly --legacy-bundling) install in
176
+place, no hoisting. shallow (formerly --global-style) only install direct
177
+deps at top-level. linked: (experimental) install in node_modules/.store,
178
+link in place, unhoisted.
179
+
180
+
181
+
182
+#### `legacy-bundling`
183
+
184
+* Default: false
185
+* Type: Boolean
186
+* DEPRECATED: This option has been deprecated in favor of
187
+ `--install-strategy=nested`
188
+
189
+Instead of hoisting package installs in `node_modules`, install packages in
190
+the same manner that they are depended on. This may cause very deep
191
+directory structures and duplicate package installs as there is no
192
+de-duplicating. Sets `--install-strategy=nested`.
193
+
194
+
195
+
196
+#### `global-style`
197
+
198
+* Default: false
199
+* Type: Boolean
200
+* DEPRECATED: This option has been deprecated in favor of
201
+ `--install-strategy=shallow`
202
+
203
+Only install direct dependencies in the top level `node_modules`, but hoist
204
+on deeper dependencies. Sets `--install-strategy=shallow`.
205
+
206
+
207
+
208
+#### `strict-peer-deps`
209
+
210
+* Default: false
211
+* Type: Boolean
212
+
213
+If set to `true`, and `--legacy-peer-deps` is not set, then _any_
214
+conflicting `peerDependencies` will be treated as an install failure, even
215
+if npm could reasonably guess the appropriate resolution based on non-peer
216
+dependency relationships.
217
+
218
+By default, conflicting `peerDependencies` deep in the dependency graph will
219
+be resolved using the nearest non-peer dependency specification, even if
220
+doing so will result in some packages receiving a peer dependency outside
221
+the range set in their package's `peerDependencies` object.
222
+
223
+When such an override is performed, a warning is printed, explaining the
224
+conflict and the packages involved. If `--strict-peer-deps` is set, then
225
+this warning is treated as a failure.
226
+
227
+
228
+
229
+#### `package-lock`
230
+
231
+* Default: true
232
+* Type: Boolean
233
+
234
+If set to false, then ignore `package-lock.json` files when installing. This
235
+will also prevent _writing_ `package-lock.json` if `save` is true.
236
+
237
+
238
+
239
+#### `omit`
240
+
241
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
242
+ 'production', otherwise empty.
243
+* Type: "dev", "optional", or "peer" (can be set multiple times)
244
+
245
+Dependency types to omit from the installation tree on disk.
246
+
247
+Note that these dependencies _are_ still resolved and added to the
248
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
249
+physically installed on disk.
250
+
251
+If a package type appears in both the `--include` and `--omit` lists, then
252
+it will be included.
253
+
254
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
255
+variable will be set to `'production'` for all lifecycle scripts.
256
+
257
+
258
+
259
+#### `ignore-scripts`
260
+
261
+* Default: false
262
+* Type: Boolean
263
+
264
+If true, npm does not run scripts specified in package.json files.
265
+
266
+Note that commands explicitly intended to run a particular script, such as
267
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
268
+will still run their intended script if `ignore-scripts` is set, but they
269
+will *not* run any pre- or post-scripts.
270
+
271
+
272
+
273
+#### `audit`
274
+
275
+* Default: true
276
+* Type: Boolean
277
+
278
+When "true" submit audit reports alongside the current npm command to the
279
+default registry and all registries configured for scopes. See the
280
+documentation for [`npm audit`](/cli/v10/commands/npm-audit) for details on what is
281
+submitted.
282
+
283
+
284
+
285
+#### `bin-links`
286
+
287
+* Default: true
288
+* Type: Boolean
289
+
290
+Tells npm to create symlinks (or `.cmd` shims on Windows) for package
291
+executables.
292
+
293
+Set to false to have it not do this. This can be used to work around the
294
+fact that some file systems don't support symlinks, even on ostensibly Unix
295
+systems.
296
+
297
+
298
+
299
+#### `fund`
300
+
301
+* Default: true
302
+* Type: Boolean
303
+
304
+When "true" displays the message at the end of each `npm install`
305
+acknowledging the number of dependencies looking for funding. See [`npm
306
+fund`](/cli/v10/commands/npm-fund) for details.
307
+
308
+
309
+
310
+#### `dry-run`
311
+
312
+* Default: false
313
+* Type: Boolean
314
+
315
+Indicates that you don't want npm to make any changes and that it should
316
+only report what it would have done. This can be passed into any of the
317
+commands that modify your local installation, eg, `install`, `update`,
318
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
319
+
320
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
321
+`owner`, etc.
322
+
323
+
324
+
325
+#### `workspace`
326
+
327
+* Default:
328
+* Type: String (can be set multiple times)
329
+
330
+Enable running a command in the context of the configured workspaces of the
331
+current project while filtering by running only the workspaces defined by
332
+this configuration option.
333
+
334
+Valid values for the `workspace` config are either:
335
+
336
+* Workspace names
337
+* Path to a workspace directory
338
+* Path to a parent workspace directory (will result in selecting all
339
+ workspaces within that folder)
340
+
341
+When set for the `npm init` command, this may be set to the folder of a
342
+workspace which does not yet exist, to create the folder and set it up as a
343
+brand new workspace within the project.
344
+
345
+This value is not exported to the environment for child processes.
346
+
347
+#### `workspaces`
348
+
349
+* Default: null
350
+* Type: null or Boolean
351
+
352
+Set to true to run the command in the context of **all** configured
353
+workspaces.
354
+
355
+Explicitly setting this to false will cause commands like `install` to
356
+ignore workspaces altogether. When not set explicitly:
357
+
358
+- Commands that operate on the `node_modules` tree (install, update, etc.)
359
+will link workspaces into the `node_modules` folder. - Commands that do
360
+other things (test, exec, publish, etc.) will operate on the root project,
361
+_unless_ one or more workspaces are specified in the `workspace` config.
362
+
363
+This value is not exported to the environment for child processes.
364
+
365
+#### `include-workspace-root`
366
+
367
+* Default: false
368
+* Type: Boolean
369
+
370
+Include the workspace root when workspaces are enabled for a command.
371
+
372
+When false, specifying individual workspaces via the `workspace` config, or
373
+all workspaces via the `workspaces` flag, will cause npm to operate only on
374
+the specified workspaces, and not on the root project.
375
+
376
+This value is not exported to the environment for child processes.
377
+
378
+#### `install-links`
379
+
380
+* Default: false
381
+* Type: Boolean
382
+
383
+When set file: protocol dependencies will be packed and installed as regular
384
+dependencies instead of creating a symlink. This option has no effect on
385
+workspaces.
386
+
387
+
388
+
389
+### See Also
390
+
391
+* [package spec](/cli/v10/using-npm/package-spec)
392
+* [npm developers](/cli/v10/using-npm/developers)
393
+* [package.json](/cli/v10/configuring-npm/package-json)
394
+* [npm install](/cli/v10/commands/npm-install)
395
+* [npm folders](/cli/v10/configuring-npm/folders)
396
+* [npm config](/cli/v10/commands/npm-config)
397
+* [npmrc](/cli/v10/configuring-npm/npmrc)
content/cli/v10/commands/npm-login.md
new
+108
@@ -0,0 +1,108 @@
1
+---
2
+title: npm-login
3
+section: 1
4
+description: Login to a registry user account
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-login.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/login
10
+ - /cli-documentation/v10/cli-commands/npm-login
11
+ - /cli-documentation/v10/commands/login
12
+ - /cli-documentation/v10/commands/npm-login
13
+ - /cli-documentation/v10/login
14
+ - /cli-documentation/v10/npm-login
15
+ - /cli/v10/cli-commands/login
16
+ - /cli/v10/cli-commands/npm-login
17
+ - /cli/v10/commands/login
18
+ - /cli/v10/login
19
+ - /cli/v10/npm-login
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm login
26
+```
27
+
28
+Note: This command is unaware of workspaces.
29
+
30
+### Description
31
+
32
+Verify a user in the specified registry, and save the credentials to the
33
+`.npmrc` file. If no registry is specified, the default registry will be
34
+used (see [`config`](/cli/v10/using-npm/config)).
35
+
36
+When using `legacy` for your `auth-type`, the username and password, are
37
+read in from prompts.
38
+
39
+To reset your password, go to <https://www.npmjs.com/forgot>
40
+
41
+To change your email address, go to <https://www.npmjs.com/email-edit>
42
+
43
+You may use this command multiple times with the same user account to
44
+authorize on a new machine. When authenticating on a new machine,
45
+the username, password and email address must all match with
46
+your existing record.
47
+
48
+### Configuration
49
+
50
+#### `registry`
51
+
52
+* Default: "https://registry.npmjs.org/"
53
+* Type: URL
54
+
55
+The base URL of the npm registry.
56
+
57
+
58
+
59
+#### `scope`
60
+
61
+* Default: the scope of the current project, if any, or ""
62
+* Type: String
63
+
64
+Associate an operation with a scope for a scoped registry.
65
+
66
+Useful when logging in to or out of a private registry:
67
+
68
+```
69
+# log in, linking the scope to the custom registry
70
+npm login --scope=@mycorp --registry=https://registry.mycorp.com
71
+
72
+# log out, removing the link and the auth token
73
+npm logout --scope=@mycorp
74
+```
75
+
76
+This will cause `@mycorp` to be mapped to the registry for future
77
+installation of packages specified according to the pattern
78
+`@mycorp/package`.
79
+
80
+This will also cause `npm init` to create a scoped package.
81
+
82
+```
83
+# accept all defaults, and create a package named "@foo/whatever",
84
+# instead of just named "whatever"
85
+npm init --scope=@foo --yes
86
+```
87
+
88
+
89
+
90
+#### `auth-type`
91
+
92
+* Default: "web"
93
+* Type: "legacy" or "web"
94
+
95
+What authentication strategy to use with `login`. Note that if an `otp`
96
+config is given, this value will always be set to `legacy`.
97
+
98
+
99
+
100
+### See Also
101
+
102
+* [npm registry](/cli/v10/using-npm/registry)
103
+* [npm config](/cli/v10/commands/npm-config)
104
+* [npmrc](/cli/v10/configuring-npm/npmrc)
105
+* [npm owner](/cli/v10/commands/npm-owner)
106
+* [npm whoami](/cli/v10/commands/npm-whoami)
107
+* [npm token](/cli/v10/commands/npm-token)
108
+* [npm profile](/cli/v10/commands/npm-profile)
content/cli/v10/commands/npm-logout.md
new
+90
@@ -0,0 +1,90 @@
1
+---
2
+title: npm-logout
3
+section: 1
4
+description: Log out of the registry
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-logout.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/logout
10
+ - /cli-documentation/v10/cli-commands/npm-logout
11
+ - /cli-documentation/v10/commands/logout
12
+ - /cli-documentation/v10/commands/npm-logout
13
+ - /cli-documentation/v10/logout
14
+ - /cli-documentation/v10/npm-logout
15
+ - /cli/v10/cli-commands/logout
16
+ - /cli/v10/cli-commands/npm-logout
17
+ - /cli/v10/commands/logout
18
+ - /cli/v10/logout
19
+ - /cli/v10/npm-logout
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm logout
26
+```
27
+
28
+Note: This command is unaware of workspaces.
29
+
30
+### Description
31
+
32
+When logged into a registry that supports token-based authentication, tell
33
+the server to end this token's session. This will invalidate the token
34
+everywhere you're using it, not just for the current environment.
35
+
36
+When logged into a legacy registry that uses username and password
37
+authentication, this will clear the credentials in your user configuration.
38
+In this case, it will _only_ affect the current environment.
39
+
40
+If `--scope` is provided, this will find the credentials for the registry
41
+connected to that scope, if set.
42
+
43
+### Configuration
44
+
45
+#### `registry`
46
+
47
+* Default: "https://registry.npmjs.org/"
48
+* Type: URL
49
+
50
+The base URL of the npm registry.
51
+
52
+
53
+
54
+#### `scope`
55
+
56
+* Default: the scope of the current project, if any, or ""
57
+* Type: String
58
+
59
+Associate an operation with a scope for a scoped registry.
60
+
61
+Useful when logging in to or out of a private registry:
62
+
63
+```
64
+# log in, linking the scope to the custom registry
65
+npm login --scope=@mycorp --registry=https://registry.mycorp.com
66
+
67
+# log out, removing the link and the auth token
68
+npm logout --scope=@mycorp
69
+```
70
+
71
+This will cause `@mycorp` to be mapped to the registry for future
72
+installation of packages specified according to the pattern
73
+`@mycorp/package`.
74
+
75
+This will also cause `npm init` to create a scoped package.
76
+
77
+```
78
+# accept all defaults, and create a package named "@foo/whatever",
79
+# instead of just named "whatever"
80
+npm init --scope=@foo --yes
81
+```
82
+
83
+
84
+
85
+### See Also
86
+
87
+* [npm adduser](/cli/v10/commands/npm-adduser)
88
+* [npm registry](/cli/v10/using-npm/registry)
89
+* [npm config](/cli/v10/commands/npm-config)
90
+* [npm whoami](/cli/v10/commands/npm-whoami)
content/cli/v10/commands/npm-ls.md
new
+295
@@ -0,0 +1,295 @@
1
+---
2
+title: npm-ls
3
+section: 1
4
+description: List installed packages
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-ls.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/ls
10
+ - /cli-documentation/v10/cli-commands/npm-ls
11
+ - /cli-documentation/v10/commands/ls
12
+ - /cli-documentation/v10/commands/npm-ls
13
+ - /cli-documentation/v10/ls
14
+ - /cli-documentation/v10/npm-ls
15
+ - /cli/v10/cli-commands/ls
16
+ - /cli/v10/cli-commands/npm-ls
17
+ - /cli/v10/commands/ls
18
+ - /cli/v10/ls
19
+ - /cli/v10/npm-ls
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm ls <package-spec>
26
+
27
+alias: list
28
+```
29
+
30
+### Description
31
+
32
+This command will print to stdout all the versions of packages that are
33
+installed, as well as their dependencies when `--all` is specified, in a
34
+tree structure.
35
+
36
+Note: to get a "bottoms up" view of why a given package is included in the
37
+tree at all, use [`npm explain`](/cli/v10/commands/npm-explain).
38
+
39
+Positional arguments are `name@version-range` identifiers, which will limit
40
+the results to only the paths to the packages named. Note that nested
41
+packages will *also* show the paths to the specified packages. For
42
+example, running `npm ls promzard` in npm's source tree will show:
43
+
44
+```bash
45
+npm@10.0.0 /path/to/npm
46
+└─┬ init-package-json@0.0.4
47
+ └── promzard@0.1.5
48
+```
49
+
50
+It will print out extraneous, missing, and invalid packages.
51
+
52
+If a project specifies git urls for dependencies these are shown
53
+in parentheses after the `name@version` to make it easier for users to
54
+recognize potential forks of a project.
55
+
56
+The tree shown is the logical dependency tree, based on package
57
+dependencies, not the physical layout of your `node_modules` folder.
58
+
59
+When run as `ll` or `la`, it shows extended information by default.
60
+
61
+### Note: Design Changes Pending
62
+
63
+The `npm ls` command's output and behavior made a _ton_ of sense when npm
64
+created a `node_modules` folder that naively nested every dependency. In
65
+such a case, the logical dependency graph and physical tree of packages on
66
+disk would be roughly identical.
67
+
68
+With the advent of automatic install-time deduplication of dependencies in
69
+npm v3, the `ls` output was modified to display the logical dependency
70
+graph as a tree structure, since this was more useful to most users.
71
+However, without using `npm ls -l`, it became impossible to show _where_ a
72
+package was actually installed much of the time!
73
+
74
+With the advent of automatic installation of `peerDependencies` in npm v7,
75
+this gets even more curious, as `peerDependencies` are logically
76
+"underneath" their dependents in the dependency graph, but are always
77
+physically at or above their location on disk.
78
+
79
+Also, in the years since npm got an `ls` command (in version 0.0.2!),
80
+dependency graphs have gotten much larger as a general rule. Therefore, in
81
+order to avoid dumping an excessive amount of content to the terminal, `npm
82
+ls` now only shows the _top_ level dependencies, unless `--all` is
83
+provided.
84
+
85
+A thorough re-examination of the use cases, intention, behavior, and output
86
+of this command, is currently underway. Expect significant changes to at
87
+least the default human-readable `npm ls` output in npm v8.
88
+
89
+### Configuration
90
+
91
+#### `all`
92
+
93
+* Default: false
94
+* Type: Boolean
95
+
96
+When running `npm outdated` and `npm ls`, setting `--all` will show all
97
+outdated or installed packages, rather than only those directly depended
98
+upon by the current project.
99
+
100
+
101
+
102
+#### `json`
103
+
104
+* Default: false
105
+* Type: Boolean
106
+
107
+Whether or not to output JSON data, rather than the normal output.
108
+
109
+* In `npm pkg set` it enables parsing set values with JSON.parse() before
110
+ saving them to your `package.json`.
111
+
112
+Not supported by all npm commands.
113
+
114
+
115
+
116
+#### `long`
117
+
118
+* Default: false
119
+* Type: Boolean
120
+
121
+Show extended information in `ls`, `search`, and `help-search`.
122
+
123
+
124
+
125
+#### `parseable`
126
+
127
+* Default: false
128
+* Type: Boolean
129
+
130
+Output parseable results from commands that write to standard output. For
131
+`npm search`, this will be tab-separated table format.
132
+
133
+
134
+
135
+#### `global`
136
+
137
+* Default: false
138
+* Type: Boolean
139
+
140
+Operates in "global" mode, so that packages are installed into the `prefix`
141
+folder instead of the current working directory. See
142
+[folders](/cli/v10/configuring-npm/folders) for more on the differences in behavior.
143
+
144
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
145
+ of the current working directory.
146
+* bin files are linked to `{prefix}/bin`
147
+* man pages are linked to `{prefix}/share/man`
148
+
149
+
150
+
151
+#### `depth`
152
+
153
+* Default: `Infinity` if `--all` is set, otherwise `1`
154
+* Type: null or Number
155
+
156
+The depth to go when recursing packages for `npm ls`.
157
+
158
+If not set, `npm ls` will show only the immediate dependencies of the root
159
+project. If `--all` is set, then npm will show all dependencies by default.
160
+
161
+
162
+
163
+#### `omit`
164
+
165
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
166
+ 'production', otherwise empty.
167
+* Type: "dev", "optional", or "peer" (can be set multiple times)
168
+
169
+Dependency types to omit from the installation tree on disk.
170
+
171
+Note that these dependencies _are_ still resolved and added to the
172
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
173
+physically installed on disk.
174
+
175
+If a package type appears in both the `--include` and `--omit` lists, then
176
+it will be included.
177
+
178
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
179
+variable will be set to `'production'` for all lifecycle scripts.
180
+
181
+
182
+
183
+#### `link`
184
+
185
+* Default: false
186
+* Type: Boolean
187
+
188
+Used with `npm ls`, limiting output to only those packages that are linked.
189
+
190
+
191
+
192
+#### `package-lock-only`
193
+
194
+* Default: false
195
+* Type: Boolean
196
+
197
+If set to true, the current operation will only use the `package-lock.json`,
198
+ignoring `node_modules`.
199
+
200
+For `update` this means only the `package-lock.json` will be updated,
201
+instead of checking `node_modules` and downloading dependencies.
202
+
203
+For `list` this means the output will be based on the tree described by the
204
+`package-lock.json`, rather than the contents of `node_modules`.
205
+
206
+
207
+
208
+#### `unicode`
209
+
210
+* Default: false on windows, true on mac/unix systems with a unicode locale,
211
+ as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables.
212
+* Type: Boolean
213
+
214
+When set to true, npm uses unicode characters in the tree output. When
215
+false, it uses ascii characters instead of unicode glyphs.
216
+
217
+
218
+
219
+#### `workspace`
220
+
221
+* Default:
222
+* Type: String (can be set multiple times)
223
+
224
+Enable running a command in the context of the configured workspaces of the
225
+current project while filtering by running only the workspaces defined by
226
+this configuration option.
227
+
228
+Valid values for the `workspace` config are either:
229
+
230
+* Workspace names
231
+* Path to a workspace directory
232
+* Path to a parent workspace directory (will result in selecting all
233
+ workspaces within that folder)
234
+
235
+When set for the `npm init` command, this may be set to the folder of a
236
+workspace which does not yet exist, to create the folder and set it up as a
237
+brand new workspace within the project.
238
+
239
+This value is not exported to the environment for child processes.
240
+
241
+#### `workspaces`
242
+
243
+* Default: null
244
+* Type: null or Boolean
245
+
246
+Set to true to run the command in the context of **all** configured
247
+workspaces.
248
+
249
+Explicitly setting this to false will cause commands like `install` to
250
+ignore workspaces altogether. When not set explicitly:
251
+
252
+- Commands that operate on the `node_modules` tree (install, update, etc.)
253
+will link workspaces into the `node_modules` folder. - Commands that do
254
+other things (test, exec, publish, etc.) will operate on the root project,
255
+_unless_ one or more workspaces are specified in the `workspace` config.
256
+
257
+This value is not exported to the environment for child processes.
258
+
259
+#### `include-workspace-root`
260
+
261
+* Default: false
262
+* Type: Boolean
263
+
264
+Include the workspace root when workspaces are enabled for a command.
265
+
266
+When false, specifying individual workspaces via the `workspace` config, or
267
+all workspaces via the `workspaces` flag, will cause npm to operate only on
268
+the specified workspaces, and not on the root project.
269
+
270
+This value is not exported to the environment for child processes.
271
+
272
+#### `install-links`
273
+
274
+* Default: false
275
+* Type: Boolean
276
+
277
+When set file: protocol dependencies will be packed and installed as regular
278
+dependencies instead of creating a symlink. This option has no effect on
279
+workspaces.
280
+
281
+
282
+
283
+### See Also
284
+
285
+* [package spec](/cli/v10/using-npm/package-spec)
286
+* [npm explain](/cli/v10/commands/npm-explain)
287
+* [npm config](/cli/v10/commands/npm-config)
288
+* [npmrc](/cli/v10/configuring-npm/npmrc)
289
+* [npm folders](/cli/v10/configuring-npm/folders)
290
+* [npm explain](/cli/v10/commands/npm-explain)
291
+* [npm install](/cli/v10/commands/npm-install)
292
+* [npm link](/cli/v10/commands/npm-link)
293
+* [npm prune](/cli/v10/commands/npm-prune)
294
+* [npm outdated](/cli/v10/commands/npm-outdated)
295
+* [npm update](/cli/v10/commands/npm-update)
content/cli/v10/commands/npm-org.md
new
+129
@@ -0,0 +1,129 @@
1
+---
2
+title: npm-org
3
+section: 1
4
+description: Manage orgs
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-org.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-org
10
+ - /cli-documentation/v10/cli-commands/org
11
+ - /cli-documentation/v10/commands/npm-org
12
+ - /cli-documentation/v10/commands/org
13
+ - /cli-documentation/v10/npm-org
14
+ - /cli-documentation/v10/org
15
+ - /cli/v10/cli-commands/npm-org
16
+ - /cli/v10/cli-commands/org
17
+ - /cli/v10/commands/org
18
+ - /cli/v10/npm-org
19
+ - /cli/v10/org
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm org set orgname username [developer | admin | owner]
26
+npm org rm orgname username
27
+npm org ls orgname [<username>]
28
+
29
+alias: ogr
30
+```
31
+
32
+Note: This command is unaware of workspaces.
33
+
34
+### Example
35
+
36
+Add a new developer to an org:
37
+
38
+```bash
39
+$ npm org set my-org @mx-smith
40
+```
41
+
42
+Add a new admin to an org (or change a developer to an admin):
43
+
44
+```bash
45
+$ npm org set my-org @mx-santos admin
46
+```
47
+
48
+Remove a user from an org:
49
+
50
+```bash
51
+$ npm org rm my-org mx-santos
52
+```
53
+
54
+List all users in an org:
55
+
56
+```bash
57
+$ npm org ls my-org
58
+```
59
+
60
+List all users in JSON format:
61
+
62
+```bash
63
+$ npm org ls my-org --json
64
+```
65
+
66
+See what role a user has in an org:
67
+
68
+```bash
69
+$ npm org ls my-org @mx-santos
70
+```
71
+
72
+### Description
73
+
74
+You can use the `npm org` commands to manage and view users of an
75
+organization. It supports adding and removing users, changing their roles,
76
+listing them, and finding specific ones and their roles.
77
+
78
+### Configuration
79
+
80
+#### `registry`
81
+
82
+* Default: "https://registry.npmjs.org/"
83
+* Type: URL
84
+
85
+The base URL of the npm registry.
86
+
87
+
88
+
89
+#### `otp`
90
+
91
+* Default: null
92
+* Type: null or String
93
+
94
+This is a one-time password from a two-factor authenticator. It's needed
95
+when publishing or changing package permissions with `npm access`.
96
+
97
+If not set, and a registry response fails with a challenge for a one-time
98
+password, npm will prompt on the command line for one.
99
+
100
+
101
+
102
+#### `json`
103
+
104
+* Default: false
105
+* Type: Boolean
106
+
107
+Whether or not to output JSON data, rather than the normal output.
108
+
109
+* In `npm pkg set` it enables parsing set values with JSON.parse() before
110
+ saving them to your `package.json`.
111
+
112
+Not supported by all npm commands.
113
+
114
+
115
+
116
+#### `parseable`
117
+
118
+* Default: false
119
+* Type: Boolean
120
+
121
+Output parseable results from commands that write to standard output. For
122
+`npm search`, this will be tab-separated table format.
123
+
124
+
125
+
126
+### See Also
127
+
128
+* [using orgs](/cli/v10/using-npm/orgs)
129
+* [Documentation on npm Orgs](https://docs.npmjs.com/orgs/)
content/cli/v10/commands/npm-outdated.md
new
+193
@@ -0,0 +1,193 @@
1
+---
2
+title: npm-outdated
3
+section: 1
4
+description: Check for outdated packages
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-outdated.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-outdated
10
+ - /cli-documentation/v10/cli-commands/outdated
11
+ - /cli-documentation/v10/commands/npm-outdated
12
+ - /cli-documentation/v10/commands/outdated
13
+ - /cli-documentation/v10/npm-outdated
14
+ - /cli-documentation/v10/outdated
15
+ - /cli/v10/cli-commands/npm-outdated
16
+ - /cli/v10/cli-commands/outdated
17
+ - /cli/v10/commands/outdated
18
+ - /cli/v10/npm-outdated
19
+ - /cli/v10/outdated
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm outdated [<package-spec> ...]
26
+```
27
+
28
+### Description
29
+
30
+This command will check the registry to see if any (or, specific) installed
31
+packages are currently outdated.
32
+
33
+By default, only the direct dependencies of the root project and direct
34
+dependencies of your configured *workspaces* are shown.
35
+Use `--all` to find all outdated meta-dependencies as well.
36
+
37
+In the output:
38
+
39
+* `wanted` is the maximum version of the package that satisfies the semver
40
+ range specified in `package.json`. If there's no available semver range
41
+ (i.e. you're running `npm outdated --global`, or the package isn't
42
+ included in `package.json`), then `wanted` shows the currently-installed
43
+ version.
44
+* `latest` is the version of the package tagged as latest in the registry.
45
+ Running `npm publish` with no special configuration will publish the
46
+ package with a dist-tag of `latest`. This may or may not be the maximum
47
+ version of the package, or the most-recently published version of the
48
+ package, depending on how the package's developer manages the latest
49
+ [dist-tag](/cli/v10/commands/npm-dist-tag).
50
+* `location` is where in the physical tree the package is located.
51
+* `depended by` shows which package depends on the displayed dependency
52
+* `package type` (when using `--long` / `-l`) tells you whether this
53
+ package is a `dependency` or a dev/peer/optional dependency. Packages not
54
+ included in `package.json` are always marked `dependencies`.
55
+* `homepage` (when using `--long` / `-l`) is the `homepage` value contained
56
+ in the package's packument
57
+* Red means there's a newer version matching your semver requirements, so
58
+ you should update now.
59
+* Yellow indicates that there's a newer version _above_ your semver
60
+ requirements (usually new major, or new 0.x minor) so proceed with
61
+ caution.
62
+
63
+### An example
64
+
65
+```bash
66
+$ npm outdated
67
+Package Current Wanted Latest Location Depended by
68
+glob 5.0.15 5.0.15 6.0.1 node_modules/glob dependent-package-name
69
+nothingness 0.0.3 git git node_modules/nothingness dependent-package-name
70
+npm 3.5.1 3.5.2 3.5.1 node_modules/npm dependent-package-name
71
+local-dev 0.0.3 linked linked local-dev dependent-package-name
72
+once 1.3.2 1.3.3 1.3.3 node_modules/once dependent-package-name
73
+```
74
+
75
+With these `dependencies`:
76
+```json
77
+{
78
+ "glob": "^5.0.15",
79
+ "nothingness": "github:othiym23/nothingness#master",
80
+ "npm": "^3.5.1",
81
+ "once": "^1.3.1"
82
+}
83
+```
84
+
85
+A few things to note:
86
+
87
+* `glob` requires `^5`, which prevents npm from installing `glob@6`, which
88
+ is outside the semver range.
89
+* Git dependencies will always be reinstalled, because of how they're
90
+ specified. The installed committish might satisfy the dependency
91
+ specifier (if it's something immutable, like a commit SHA), or it might
92
+ not, so `npm outdated` and `npm update` have to fetch Git repos to check.
93
+ This is why currently doing a reinstall of a Git dependency always forces
94
+ a new clone and install.
95
+* `npm@3.5.2` is marked as "wanted", but "latest" is `npm@3.5.1` because
96
+ npm uses dist-tags to manage its `latest` and `next` release channels.
97
+ `npm update` will install the _newest_ version, but `npm install npm`
98
+ (with no semver range) will install whatever's tagged as `latest`.
99
+* `once` is just plain out of date. Reinstalling `node_modules` from
100
+ scratch or running `npm update` will bring it up to spec.
101
+
102
+### Configuration
103
+
104
+#### `all`
105
+
106
+* Default: false
107
+* Type: Boolean
108
+
109
+When running `npm outdated` and `npm ls`, setting `--all` will show all
110
+outdated or installed packages, rather than only those directly depended
111
+upon by the current project.
112
+
113
+
114
+
115
+#### `json`
116
+
117
+* Default: false
118
+* Type: Boolean
119
+
120
+Whether or not to output JSON data, rather than the normal output.
121
+
122
+* In `npm pkg set` it enables parsing set values with JSON.parse() before
123
+ saving them to your `package.json`.
124
+
125
+Not supported by all npm commands.
126
+
127
+
128
+
129
+#### `long`
130
+
131
+* Default: false
132
+* Type: Boolean
133
+
134
+Show extended information in `ls`, `search`, and `help-search`.
135
+
136
+
137
+
138
+#### `parseable`
139
+
140
+* Default: false
141
+* Type: Boolean
142
+
143
+Output parseable results from commands that write to standard output. For
144
+`npm search`, this will be tab-separated table format.
145
+
146
+
147
+
148
+#### `global`
149
+
150
+* Default: false
151
+* Type: Boolean
152
+
153
+Operates in "global" mode, so that packages are installed into the `prefix`
154
+folder instead of the current working directory. See
155
+[folders](/cli/v10/configuring-npm/folders) for more on the differences in behavior.
156
+
157
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
158
+ of the current working directory.
159
+* bin files are linked to `{prefix}/bin`
160
+* man pages are linked to `{prefix}/share/man`
161
+
162
+
163
+
164
+#### `workspace`
165
+
166
+* Default:
167
+* Type: String (can be set multiple times)
168
+
169
+Enable running a command in the context of the configured workspaces of the
170
+current project while filtering by running only the workspaces defined by
171
+this configuration option.
172
+
173
+Valid values for the `workspace` config are either:
174
+
175
+* Workspace names
176
+* Path to a workspace directory
177
+* Path to a parent workspace directory (will result in selecting all
178
+ workspaces within that folder)
179
+
180
+When set for the `npm init` command, this may be set to the folder of a
181
+workspace which does not yet exist, to create the folder and set it up as a
182
+brand new workspace within the project.
183
+
184
+This value is not exported to the environment for child processes.
185
+
186
+### See Also
187
+
188
+* [package spec](/cli/v10/using-npm/package-spec)
189
+* [npm update](/cli/v10/commands/npm-update)
190
+* [npm dist-tag](/cli/v10/commands/npm-dist-tag)
191
+* [npm registry](/cli/v10/using-npm/registry)
192
+* [npm folders](/cli/v10/configuring-npm/folders)
193
+* [npm workspaces](/cli/v10/using-npm/workspaces)
content/cli/v10/commands/npm-owner.md
new
+121
@@ -0,0 +1,121 @@
1
+---
2
+title: npm-owner
3
+section: 1
4
+description: Manage package owners
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-owner.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-owner
10
+ - /cli-documentation/v10/cli-commands/owner
11
+ - /cli-documentation/v10/commands/npm-owner
12
+ - /cli-documentation/v10/commands/owner
13
+ - /cli-documentation/v10/npm-owner
14
+ - /cli-documentation/v10/owner
15
+ - /cli/v10/cli-commands/npm-owner
16
+ - /cli/v10/cli-commands/owner
17
+ - /cli/v10/commands/owner
18
+ - /cli/v10/npm-owner
19
+ - /cli/v10/owner
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm owner add <user> <package-spec>
26
+npm owner rm <user> <package-spec>
27
+npm owner ls <package-spec>
28
+
29
+alias: author
30
+```
31
+
32
+### Description
33
+
34
+Manage ownership of published packages.
35
+
36
+* ls: List all the users who have access to modify a package and push new
37
+ versions. Handy when you need to know who to bug for help.
38
+* add: Add a new user as a maintainer of a package. This user is enabled
39
+ to modify metadata, publish new versions, and add other owners.
40
+* rm: Remove a user from the package owner list. This immediately revokes
41
+ their privileges.
42
+
43
+Note that there is only one level of access. Either you can modify a package,
44
+or you can't. Future versions may contain more fine-grained access levels, but
45
+that is not implemented at this time.
46
+
47
+If you have two-factor authentication enabled with `auth-and-writes` (see
48
+[`npm-profile`](/cli/v10/commands/npm-profile)) then you'll need to go through a second factor
49
+flow when changing ownership or include an otp on the command line with `--otp`.
50
+
51
+### Configuration
52
+
53
+#### `registry`
54
+
55
+* Default: "https://registry.npmjs.org/"
56
+* Type: URL
57
+
58
+The base URL of the npm registry.
59
+
60
+
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
+
74
+
75
+#### `workspace`
76
+
77
+* Default:
78
+* Type: String (can be set multiple times)
79
+
80
+Enable running a command in the context of the configured workspaces of the
81
+current project while filtering by running only the workspaces defined by
82
+this configuration option.
83
+
84
+Valid values for the `workspace` config are either:
85
+
86
+* Workspace names
87
+* Path to a workspace directory
88
+* Path to a parent workspace directory (will result in selecting all
89
+ workspaces within that folder)
90
+
91
+When set for the `npm init` command, this may be set to the folder of a
92
+workspace which does not yet exist, to create the folder and set it up as a
93
+brand new workspace within the project.
94
+
95
+This value is not exported to the environment for child processes.
96
+
97
+#### `workspaces`
98
+
99
+* Default: null
100
+* Type: null or Boolean
101
+
102
+Set to true to run the command in the context of **all** configured
103
+workspaces.
104
+
105
+Explicitly setting this to false will cause commands like `install` to
106
+ignore workspaces altogether. When not set explicitly:
107
+
108
+- Commands that operate on the `node_modules` tree (install, update, etc.)
109
+will link workspaces into the `node_modules` folder. - Commands that do
110
+other things (test, exec, publish, etc.) will operate on the root project,
111
+_unless_ one or more workspaces are specified in the `workspace` config.
112
+
113
+This value is not exported to the environment for child processes.
114
+
115
+### See Also
116
+
117
+* [package spec](/cli/v10/using-npm/package-spec)
118
+* [npm profile](/cli/v10/commands/npm-profile)
119
+* [npm publish](/cli/v10/commands/npm-publish)
120
+* [npm registry](/cli/v10/using-npm/registry)
121
+* [npm adduser](/cli/v10/commands/npm-adduser)
content/cli/v10/commands/npm-pack.md
new
+141
@@ -0,0 +1,141 @@
1
+---
2
+title: npm-pack
3
+section: 1
4
+description: Create a tarball from a package
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-pack.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-pack
10
+ - /cli-documentation/v10/cli-commands/pack
11
+ - /cli-documentation/v10/commands/npm-pack
12
+ - /cli-documentation/v10/commands/pack
13
+ - /cli-documentation/v10/npm-pack
14
+ - /cli-documentation/v10/pack
15
+ - /cli/v10/cli-commands/npm-pack
16
+ - /cli/v10/cli-commands/pack
17
+ - /cli/v10/commands/pack
18
+ - /cli/v10/npm-pack
19
+ - /cli/v10/pack
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm pack <package-spec>
26
+```
27
+
28
+### Configuration
29
+
30
+#### `dry-run`
31
+
32
+* Default: false
33
+* Type: Boolean
34
+
35
+Indicates that you don't want npm to make any changes and that it should
36
+only report what it would have done. This can be passed into any of the
37
+commands that modify your local installation, eg, `install`, `update`,
38
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
39
+
40
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
41
+`owner`, etc.
42
+
43
+
44
+
45
+#### `json`
46
+
47
+* Default: false
48
+* Type: Boolean
49
+
50
+Whether or not to output JSON data, rather than the normal output.
51
+
52
+* In `npm pkg set` it enables parsing set values with JSON.parse() before
53
+ saving them to your `package.json`.
54
+
55
+Not supported by all npm commands.
56
+
57
+
58
+
59
+#### `pack-destination`
60
+
61
+* Default: "."
62
+* Type: String
63
+
64
+Directory in which `npm pack` will save tarballs.
65
+
66
+
67
+
68
+#### `workspace`
69
+
70
+* Default:
71
+* Type: String (can be set multiple times)
72
+
73
+Enable running a command in the context of the configured workspaces of the
74
+current project while filtering by running only the workspaces defined by
75
+this configuration option.
76
+
77
+Valid values for the `workspace` config are either:
78
+
79
+* Workspace names
80
+* Path to a workspace directory
81
+* Path to a parent workspace directory (will result in selecting all
82
+ workspaces within that folder)
83
+
84
+When set for the `npm init` command, this may be set to the folder of a
85
+workspace which does not yet exist, to create the folder and set it up as a
86
+brand new workspace within the project.
87
+
88
+This value is not exported to the environment for child processes.
89
+
90
+#### `workspaces`
91
+
92
+* Default: null
93
+* Type: null or Boolean
94
+
95
+Set to true to run the command in the context of **all** configured
96
+workspaces.
97
+
98
+Explicitly setting this to false will cause commands like `install` to
99
+ignore workspaces altogether. When not set explicitly:
100
+
101
+- Commands that operate on the `node_modules` tree (install, update, etc.)
102
+will link workspaces into the `node_modules` folder. - Commands that do
103
+other things (test, exec, publish, etc.) will operate on the root project,
104
+_unless_ one or more workspaces are specified in the `workspace` config.
105
+
106
+This value is not exported to the environment for child processes.
107
+
108
+#### `include-workspace-root`
109
+
110
+* Default: false
111
+* Type: Boolean
112
+
113
+Include the workspace root when workspaces are enabled for a command.
114
+
115
+When false, specifying individual workspaces via the `workspace` config, or
116
+all workspaces via the `workspaces` flag, will cause npm to operate only on
117
+the specified workspaces, and not on the root project.
118
+
119
+This value is not exported to the environment for child processes.
120
+
121
+### Description
122
+
123
+For anything that's installable (that is, a package folder, tarball,
124
+tarball url, git url, name@tag, name@version, name, or scoped name), this
125
+command will fetch it to the cache, copy the tarball to the current working
126
+directory as `<name>-<version>.tgz`, and then write the filenames out to
127
+stdout.
128
+
129
+If the same package is specified multiple times, then the file will be
130
+overwritten the second time.
131
+
132
+If no arguments are supplied, then npm packs the current package folder.
133
+
134
+### See Also
135
+
136
+* [package spec](/cli/v10/using-npm/package-spec)
137
+* [npm-packlist package](http://npm.im/npm-packlist)
138
+* [npm cache](/cli/v10/commands/npm-cache)
139
+* [npm publish](/cli/v10/commands/npm-publish)
140
+* [npm config](/cli/v10/commands/npm-config)
141
+* [npmrc](/cli/v10/configuring-npm/npmrc)
content/cli/v10/commands/npm-ping.md
new
+61
@@ -0,0 +1,61 @@
1
+---
2
+title: npm-ping
3
+section: 1
4
+description: Ping npm registry
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-ping.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-ping
10
+ - /cli-documentation/v10/cli-commands/ping
11
+ - /cli-documentation/v10/commands/npm-ping
12
+ - /cli-documentation/v10/commands/ping
13
+ - /cli-documentation/v10/npm-ping
14
+ - /cli-documentation/v10/ping
15
+ - /cli/v10/cli-commands/npm-ping
16
+ - /cli/v10/cli-commands/ping
17
+ - /cli/v10/commands/ping
18
+ - /cli/v10/npm-ping
19
+ - /cli/v10/ping
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm ping
26
+```
27
+
28
+Note: This command is unaware of workspaces.
29
+
30
+### Description
31
+
32
+Ping the configured or given npm registry and verify authentication.
33
+If it works it will output something like:
34
+
35
+```bash
36
+npm notice PING https://registry.npmjs.org/
37
+npm notice PONG 255ms
38
+```
39
+otherwise you will get an error:
40
+```bash
41
+npm notice PING http://foo.com/
42
+npm ERR! code E404
43
+npm ERR! 404 Not Found - GET http://www.foo.com/-/ping?write=true
44
+```
45
+
46
+### Configuration
47
+
48
+#### `registry`
49
+
50
+* Default: "https://registry.npmjs.org/"
51
+* Type: URL
52
+
53
+The base URL of the npm registry.
54
+
55
+
56
+
57
+### See Also
58
+
59
+* [npm doctor](/cli/v10/commands/npm-doctor)
60
+* [npm config](/cli/v10/commands/npm-config)
61
+* [npmrc](/cli/v10/configuring-npm/npmrc)
content/cli/v10/commands/npm-pkg.md
new
+287
@@ -0,0 +1,287 @@
1
+---
2
+title: npm-pkg
3
+section: 1
4
+description: Manages your package.json
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-pkg.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-pkg
10
+ - /cli-documentation/v10/cli-commands/pkg
11
+ - /cli-documentation/v10/commands/npm-pkg
12
+ - /cli-documentation/v10/commands/pkg
13
+ - /cli-documentation/v10/npm-pkg
14
+ - /cli-documentation/v10/pkg
15
+ - /cli/v10/cli-commands/npm-pkg
16
+ - /cli/v10/cli-commands/pkg
17
+ - /cli/v10/commands/pkg
18
+ - /cli/v10/npm-pkg
19
+ - /cli/v10/pkg
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm pkg set <key>=<value> [<key>=<value> ...]
26
+npm pkg get [<key> [<key> ...]]
27
+npm pkg delete <key> [<key> ...]
28
+npm pkg set [<array>[<index>].<key>=<value> ...]
29
+npm pkg set [<array>[].<key>=<value> ...]
30
+npm pkg fix
31
+```
32
+
33
+### Description
34
+
35
+A command that automates the management of `package.json` files.
36
+`npm pkg` provide 3 different sub commands that allow you to modify or retrieve
37
+values for given object keys in your `package.json`.
38
+
39
+The syntax to retrieve and set fields is a dot separated representation of
40
+the nested object properties to be found within your `package.json`, it's the
41
+same notation used in [`npm view`](/cli/v10/commands/npm-view) to retrieve information
42
+from the registry manifest, below you can find more examples on how to use it.
43
+
44
+Returned values are always in **json** format.
45
+
46
+* `npm pkg get <field>`
47
+
48
+ Retrieves a value `key`, defined in your `package.json` file.
49
+
50
+ For example, in order to retrieve the name of the current package, you
51
+ can run:
52
+
53
+ ```bash
54
+ npm pkg get name
55
+ ```
56
+
57
+ It's also possible to retrieve multiple values at once:
58
+
59
+ ```bash
60
+ npm pkg get name version
61
+ ```
62
+
63
+ You can view child fields by separating them with a period. To retrieve
64
+ the value of a test `script` value, you would run the following command:
65
+
66
+ ```bash
67
+ npm pkg get scripts.test
68
+ ```
69
+
70
+ For fields that are arrays, requesting a non-numeric field will return
71
+ all of the values from the objects in the list. For example, to get all
72
+ the contributor emails for a package, you would run:
73
+
74
+ ```bash
75
+ npm pkg get contributors.email
76
+ ```
77
+
78
+ You may also use numeric indices in square braces to specifically select
79
+ an item in an array field. To just get the email address of the first
80
+ contributor in the list, you can run:
81
+
82
+ ```bash
83
+ npm pkg get contributors[0].email
84
+ ```
85
+
86
+ For complex fields you can also name a property in square brackets
87
+ to specifically select a child field. This is especially helpful
88
+ with the exports object:
89
+
90
+ ```bash
91
+ npm pkg get "exports[.].require"
92
+ ```
93
+
94
+* `npm pkg set <field>=<value>`
95
+
96
+ Sets a `value` in your `package.json` based on the `field` value. When
97
+ saving to your `package.json` file the same set of rules used during
98
+ `npm install` and other cli commands that touches the `package.json` file
99
+ are used, making sure to respect the existing indentation and possibly
100
+ applying some validation prior to saving values to the file.
101
+
102
+ The same syntax used to retrieve values from your package can also be used
103
+ to define new properties or overriding existing ones, below are some
104
+ examples of how the dot separated syntax can be used to edit your
105
+ `package.json` file.
106
+
107
+ Defining a new bin named `mynewcommand` in your `package.json` that points
108
+ to a file `cli.js`:
109
+
110
+ ```bash
111
+ npm pkg set bin.mynewcommand=cli.js
112
+ ```
113
+
114
+ Setting multiple fields at once is also possible:
115
+
116
+ ```bash
117
+ npm pkg set description='Awesome package' engines.node='>=10'
118
+ ```
119
+
120
+ It's also possible to add to array values, for example to add a new
121
+ contributor entry:
122
+
123
+ ```bash
124
+ npm pkg set contributors[0].name='Foo' contributors[0].email='foo@bar.ca'
125
+ ```
126
+
127
+ You may also append items to the end of an array using the special
128
+ empty bracket notation:
129
+
130
+ ```bash
131
+ npm pkg set contributors[].name='Foo' contributors[].name='Bar'
132
+ ```
133
+
134
+ It's also possible to parse values as json prior to saving them to your
135
+ `package.json` file, for example in order to set a `"private": true`
136
+ property:
137
+
138
+ ```bash
139
+ npm pkg set private=true --json
140
+ ```
141
+
142
+ It also enables saving values as numbers:
143
+
144
+ ```bash
145
+ npm pkg set tap.timeout=60 --json
146
+ ```
147
+
148
+* `npm pkg delete <key>`
149
+
150
+ Deletes a `key` from your `package.json`
151
+
152
+ The same syntax used to set values from your package can also be used
153
+ to remove existing ones. For example, in order to remove a script named
154
+ build:
155
+
156
+ ```bash
157
+ npm pkg delete scripts.build
158
+ ```
159
+
160
+* `npm pkg fix`
161
+
162
+ Auto corrects common errors in your `package.json`. npm already
163
+ does this during `publish`, which leads to subtle (mostly harmless)
164
+ differences between the contents of your `package.json` file and the
165
+ manifest that npm uses during installation.
166
+
167
+### Workspaces support
168
+
169
+You can set/get/delete items across your configured workspaces by using the
170
+[`workspace`](/cli/v10/using-npm/config#workspace) or
171
+[`workspaces`](/cli/v10/using-npm/config#workspaces) config options.
172
+
173
+For example, setting a `funding` value across all configured workspaces
174
+of a project:
175
+
176
+```bash
177
+npm pkg set funding=https://example.com --ws
178
+```
179
+
180
+When using `npm pkg get` to retrieve info from your configured workspaces, the
181
+returned result will be in a json format in which top level keys are the
182
+names of each workspace, the values of these keys will be the result values
183
+returned from each of the configured workspaces, e.g:
184
+
185
+```
186
+npm pkg get name version --ws
187
+{
188
+ "a": {
189
+ "name": "a",
190
+ "version": "1.0.0"
191
+ },
192
+ "b": {
193
+ "name": "b",
194
+ "version": "1.0.0"
195
+ }
196
+}
197
+```
198
+
199
+### Configuration
200
+
201
+#### `force`
202
+
203
+* Default: false
204
+* Type: Boolean
205
+
206
+Removes various protections against unfortunate side effects, common
207
+mistakes, unnecessary performance degradation, and malicious input.
208
+
209
+* Allow clobbering non-npm files in global installs.
210
+* Allow the `npm version` command to work on an unclean git repository.
211
+* Allow deleting the cache folder with `npm cache clean`.
212
+* Allow installing packages that have an `engines` declaration requiring a
213
+ different version of npm.
214
+* Allow installing packages that have an `engines` declaration requiring a
215
+ different version of `node`, even if `--engine-strict` is enabled.
216
+* Allow `npm audit fix` to install modules outside your stated dependency
217
+ range (including SemVer-major changes).
218
+* Allow unpublishing all versions of a published package.
219
+* Allow conflicting peerDependencies to be installed in the root project.
220
+* Implicitly set `--yes` during `npm init`.
221
+* Allow clobbering existing values in `npm pkg`
222
+* Allow unpublishing of entire packages (not just a single version).
223
+
224
+If you don't have a clear idea of what you want to do, it is strongly
225
+recommended that you do not use this option!
226
+
227
+
228
+
229
+#### `json`
230
+
231
+* Default: false
232
+* Type: Boolean
233
+
234
+Whether or not to output JSON data, rather than the normal output.
235
+
236
+* In `npm pkg set` it enables parsing set values with JSON.parse() before
237
+ saving them to your `package.json`.
238
+
239
+Not supported by all npm commands.
240
+
241
+
242
+
243
+#### `workspace`
244
+
245
+* Default:
246
+* Type: String (can be set multiple times)
247
+
248
+Enable running a command in the context of the configured workspaces of the
249
+current project while filtering by running only the workspaces defined by
250
+this configuration option.
251
+
252
+Valid values for the `workspace` config are either:
253
+
254
+* Workspace names
255
+* Path to a workspace directory
256
+* Path to a parent workspace directory (will result in selecting all
257
+ workspaces within that folder)
258
+
259
+When set for the `npm init` command, this may be set to the folder of a
260
+workspace which does not yet exist, to create the folder and set it up as a
261
+brand new workspace within the project.
262
+
263
+This value is not exported to the environment for child processes.
264
+
265
+#### `workspaces`
266
+
267
+* Default: null
268
+* Type: null or Boolean
269
+
270
+Set to true to run the command in the context of **all** configured
271
+workspaces.
272
+
273
+Explicitly setting this to false will cause commands like `install` to
274
+ignore workspaces altogether. When not set explicitly:
275
+
276
+- Commands that operate on the `node_modules` tree (install, update, etc.)
277
+will link workspaces into the `node_modules` folder. - Commands that do
278
+other things (test, exec, publish, etc.) will operate on the root project,
279
+_unless_ one or more workspaces are specified in the `workspace` config.
280
+
281
+This value is not exported to the environment for child processes.
282
+## See Also
283
+
284
+* [npm install](/cli/v10/commands/npm-install)
285
+* [npm init](/cli/v10/commands/npm-init)
286
+* [npm config](/cli/v10/commands/npm-config)
287
+* [workspaces](/cli/v10/using-npm/workspaces)
content/cli/v10/commands/npm-prefix.md
new
+74
@@ -0,0 +1,74 @@
1
+---
2
+title: npm-prefix
3
+section: 1
4
+description: Display prefix
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-prefix.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-prefix
10
+ - /cli-documentation/v10/cli-commands/prefix
11
+ - /cli-documentation/v10/commands/npm-prefix
12
+ - /cli-documentation/v10/commands/prefix
13
+ - /cli-documentation/v10/npm-prefix
14
+ - /cli-documentation/v10/prefix
15
+ - /cli/v10/cli-commands/npm-prefix
16
+ - /cli/v10/cli-commands/prefix
17
+ - /cli/v10/commands/prefix
18
+ - /cli/v10/npm-prefix
19
+ - /cli/v10/prefix
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm prefix [-g]
26
+```
27
+
28
+Note: This command is unaware of workspaces.
29
+
30
+### Description
31
+
32
+Print the local prefix to standard output. This is the closest parent directory
33
+to contain a `package.json` file or `node_modules` directory, unless `-g` is
34
+also specified.
35
+
36
+If `-g` is specified, this will be the value of the global prefix. See
37
+[`npm config`](/cli/v10/commands/npm-config) for more detail.
38
+
39
+### Example
40
+
41
+```bash
42
+npm prefix
43
+/usr/local/projects/foo
44
+```
45
+
46
+```bash
47
+npm prefix -g
48
+/usr/local
49
+```
50
+
51
+### Configuration
52
+
53
+#### `global`
54
+
55
+* Default: false
56
+* Type: Boolean
57
+
58
+Operates in "global" mode, so that packages are installed into the `prefix`
59
+folder instead of the current working directory. See
60
+[folders](/cli/v10/configuring-npm/folders) for more on the differences in behavior.
61
+
62
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
63
+ of the current working directory.
64
+* bin files are linked to `{prefix}/bin`
65
+* man pages are linked to `{prefix}/share/man`
66
+
67
+
68
+
69
+### See Also
70
+
71
+* [npm root](/cli/v10/commands/npm-root)
72
+* [npm folders](/cli/v10/configuring-npm/folders)
73
+* [npm config](/cli/v10/commands/npm-config)
74
+* [npmrc](/cli/v10/configuring-npm/npmrc)
content/cli/v10/commands/npm-profile.md
new
+146
@@ -0,0 +1,146 @@
1
+---
2
+title: npm-profile
3
+section: 1
4
+description: Change settings on your registry profile
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-profile.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-profile
10
+ - /cli-documentation/v10/cli-commands/profile
11
+ - /cli-documentation/v10/commands/npm-profile
12
+ - /cli-documentation/v10/commands/profile
13
+ - /cli-documentation/v10/npm-profile
14
+ - /cli-documentation/v10/profile
15
+ - /cli/v10/cli-commands/npm-profile
16
+ - /cli/v10/cli-commands/profile
17
+ - /cli/v10/commands/profile
18
+ - /cli/v10/npm-profile
19
+ - /cli/v10/profile
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm profile enable-2fa [auth-only|auth-and-writes]
26
+npm profile disable-2fa
27
+npm profile get [<key>]
28
+npm profile set <key> <value>
29
+```
30
+
31
+Note: This command is unaware of workspaces.
32
+
33
+### Description
34
+
35
+Change your profile information on the registry. Note that this command
36
+depends on the registry implementation, so third-party registries may not
37
+support this interface.
38
+
39
+* `npm profile get [<property>]`: Display all of the properties of your
40
+ profile, or one or more specific properties. It looks like:
41
+
42
+```bash
43
++-----------------+---------------------------+
44
+| name | example |
45
++-----------------+---------------------------+
46
+| email | me@example.com (verified) |
47
++-----------------+---------------------------+
48
+| two factor auth | auth-and-writes |
49
++-----------------+---------------------------+
50
+| fullname | Example User |
51
++-----------------+---------------------------+
52
+| homepage | |
53
++-----------------+---------------------------+
54
+| freenode | |
55
++-----------------+---------------------------+
56
+| twitter | |
57
++-----------------+---------------------------+
58
+| github | |
59
++-----------------+---------------------------+
60
+| created | 2015-02-26T01:38:35.892Z |
61
++-----------------+---------------------------+
62
+| updated | 2017-10-02T21:29:45.922Z |
63
++-----------------+---------------------------+
64
+```
65
+
66
+* `npm profile set <property> <value>`: Set the value of a profile
67
+ property. You can set the following properties this way: email, fullname,
68
+ homepage, freenode, twitter, github
69
+
70
+* `npm profile set password`: Change your password. This is interactive,
71
+ you'll be prompted for your current password and a new password. You'll
72
+ also be prompted for an OTP if you have two-factor authentication
73
+ enabled.
74
+
75
+* `npm profile enable-2fa [auth-and-writes|auth-only]`: Enables two-factor
76
+ authentication. Defaults to `auth-and-writes` mode. Modes are:
77
+ * `auth-only`: Require an OTP when logging in or making changes to your
78
+ account's authentication. The OTP will be required on both the website
79
+ and the command line.
80
+ * `auth-and-writes`: Requires an OTP at all the times `auth-only` does,
81
+ and also requires one when publishing a module, setting the `latest`
82
+ dist-tag, or changing access via `npm access` and `npm owner`.
83
+
84
+* `npm profile disable-2fa`: Disables two-factor authentication.
85
+
86
+### Details
87
+
88
+Some of these commands may not be available on non npmjs.com registries.
89
+
90
+### Configuration
91
+
92
+#### `registry`
93
+
94
+* Default: "https://registry.npmjs.org/"
95
+* Type: URL
96
+
97
+The base URL of the npm registry.
98
+
99
+
100
+
101
+#### `json`
102
+
103
+* Default: false
104
+* Type: Boolean
105
+
106
+Whether or not to output JSON data, rather than the normal output.
107
+
108
+* In `npm pkg set` it enables parsing set values with JSON.parse() before
109
+ saving them to your `package.json`.
110
+
111
+Not supported by all npm commands.
112
+
113
+
114
+
115
+#### `parseable`
116
+
117
+* Default: false
118
+* Type: Boolean
119
+
120
+Output parseable results from commands that write to standard output. For
121
+`npm search`, this will be tab-separated table format.
122
+
123
+
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
+
137
+
138
+### See Also
139
+
140
+* [npm adduser](/cli/v10/commands/npm-adduser)
141
+* [npm registry](/cli/v10/using-npm/registry)
142
+* [npm config](/cli/v10/commands/npm-config)
143
+* [npmrc](/cli/v10/configuring-npm/npmrc)
144
+* [npm owner](/cli/v10/commands/npm-owner)
145
+* [npm whoami](/cli/v10/commands/npm-whoami)
146
+* [npm token](/cli/v10/commands/npm-token)
content/cli/v10/commands/npm-prune.md
new
+198
@@ -0,0 +1,198 @@
1
+---
2
+title: npm-prune
3
+section: 1
4
+description: Remove extraneous packages
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-prune.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-prune
10
+ - /cli-documentation/v10/cli-commands/prune
11
+ - /cli-documentation/v10/commands/npm-prune
12
+ - /cli-documentation/v10/commands/prune
13
+ - /cli-documentation/v10/npm-prune
14
+ - /cli-documentation/v10/prune
15
+ - /cli/v10/cli-commands/npm-prune
16
+ - /cli/v10/cli-commands/prune
17
+ - /cli/v10/commands/prune
18
+ - /cli/v10/npm-prune
19
+ - /cli/v10/prune
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm prune [[<@scope>/]<pkg>...]
26
+```
27
+
28
+### Description
29
+
30
+This command removes "extraneous" packages. If a package name is provided,
31
+then only packages matching one of the supplied names are removed.
32
+
33
+Extraneous packages are those present in the `node_modules` folder that are
34
+not listed as any package's dependency list.
35
+
36
+If the `--production` flag is specified or the `NODE_ENV` environment
37
+variable is set to `production`, this command will remove the packages
38
+specified in your `devDependencies`. Setting `--no-production` will negate
39
+`NODE_ENV` being set to `production`.
40
+
41
+If the `--dry-run` flag is used then no changes will actually be made.
42
+
43
+If the `--json` flag is used, then the changes `npm prune` made (or would
44
+have made with `--dry-run`) are printed as a JSON object.
45
+
46
+In normal operation, extraneous modules are pruned automatically, so you'll
47
+only need this command with the `--production` flag. However, in the real
48
+world, operation is not always "normal". When crashes or mistakes happen,
49
+this command can help clean up any resulting garbage.
50
+
51
+### Configuration
52
+
53
+#### `omit`
54
+
55
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
56
+ 'production', otherwise empty.
57
+* Type: "dev", "optional", or "peer" (can be set multiple times)
58
+
59
+Dependency types to omit from the installation tree on disk.
60
+
61
+Note that these dependencies _are_ still resolved and added to the
62
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
63
+physically installed on disk.
64
+
65
+If a package type appears in both the `--include` and `--omit` lists, then
66
+it will be included.
67
+
68
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
69
+variable will be set to `'production'` for all lifecycle scripts.
70
+
71
+
72
+
73
+#### `dry-run`
74
+
75
+* Default: false
76
+* Type: Boolean
77
+
78
+Indicates that you don't want npm to make any changes and that it should
79
+only report what it would have done. This can be passed into any of the
80
+commands that modify your local installation, eg, `install`, `update`,
81
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
82
+
83
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
84
+`owner`, etc.
85
+
86
+
87
+
88
+#### `json`
89
+
90
+* Default: false
91
+* Type: Boolean
92
+
93
+Whether or not to output JSON data, rather than the normal output.
94
+
95
+* In `npm pkg set` it enables parsing set values with JSON.parse() before
96
+ saving them to your `package.json`.
97
+
98
+Not supported by all npm commands.
99
+
100
+
101
+
102
+#### `foreground-scripts`
103
+
104
+* Default: false
105
+* Type: Boolean
106
+
107
+Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)
108
+scripts for installed packages in the foreground process, sharing standard
109
+input, output, and error with the main npm process.
110
+
111
+Note that this will generally make installs run slower, and be much noisier,
112
+but can be useful for debugging.
113
+
114
+
115
+
116
+#### `ignore-scripts`
117
+
118
+* Default: false
119
+* Type: Boolean
120
+
121
+If true, npm does not run scripts specified in package.json files.
122
+
123
+Note that commands explicitly intended to run a particular script, such as
124
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
125
+will still run their intended script if `ignore-scripts` is set, but they
126
+will *not* run any pre- or post-scripts.
127
+
128
+
129
+
130
+#### `workspace`
131
+
132
+* Default:
133
+* Type: String (can be set multiple times)
134
+
135
+Enable running a command in the context of the configured workspaces of the
136
+current project while filtering by running only the workspaces defined by
137
+this configuration option.
138
+
139
+Valid values for the `workspace` config are either:
140
+
141
+* Workspace names
142
+* Path to a workspace directory
143
+* Path to a parent workspace directory (will result in selecting all
144
+ workspaces within that folder)
145
+
146
+When set for the `npm init` command, this may be set to the folder of a
147
+workspace which does not yet exist, to create the folder and set it up as a
148
+brand new workspace within the project.
149
+
150
+This value is not exported to the environment for child processes.
151
+
152
+#### `workspaces`
153
+
154
+* Default: null
155
+* Type: null or Boolean
156
+
157
+Set to true to run the command in the context of **all** configured
158
+workspaces.
159
+
160
+Explicitly setting this to false will cause commands like `install` to
161
+ignore workspaces altogether. When not set explicitly:
162
+
163
+- Commands that operate on the `node_modules` tree (install, update, etc.)
164
+will link workspaces into the `node_modules` folder. - Commands that do
165
+other things (test, exec, publish, etc.) will operate on the root project,
166
+_unless_ one or more workspaces are specified in the `workspace` config.
167
+
168
+This value is not exported to the environment for child processes.
169
+
170
+#### `include-workspace-root`
171
+
172
+* Default: false
173
+* Type: Boolean
174
+
175
+Include the workspace root when workspaces are enabled for a command.
176
+
177
+When false, specifying individual workspaces via the `workspace` config, or
178
+all workspaces via the `workspaces` flag, will cause npm to operate only on
179
+the specified workspaces, and not on the root project.
180
+
181
+This value is not exported to the environment for child processes.
182
+
183
+#### `install-links`
184
+
185
+* Default: false
186
+* Type: Boolean
187
+
188
+When set file: protocol dependencies will be packed and installed as regular
189
+dependencies instead of creating a symlink. This option has no effect on
190
+workspaces.
191
+
192
+
193
+
194
+### See Also
195
+
196
+* [npm uninstall](/cli/v10/commands/npm-uninstall)
197
+* [npm folders](/cli/v10/configuring-npm/folders)
198
+* [npm ls](/cli/v10/commands/npm-ls)
content/cli/v10/commands/npm-publish.md
new
+250
@@ -0,0 +1,250 @@
1
+---
2
+title: npm-publish
3
+section: 1
4
+description: Publish a package
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-publish.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-publish
10
+ - /cli-documentation/v10/cli-commands/publish
11
+ - /cli-documentation/v10/commands/npm-publish
12
+ - /cli-documentation/v10/commands/publish
13
+ - /cli-documentation/v10/npm-publish
14
+ - /cli-documentation/v10/publish
15
+ - /cli/v10/cli-commands/npm-publish
16
+ - /cli/v10/cli-commands/publish
17
+ - /cli/v10/commands/publish
18
+ - /cli/v10/npm-publish
19
+ - /cli/v10/publish
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm publish <package-spec>
26
+```
27
+
28
+### Description
29
+
30
+Publishes a package to the registry so that it can be installed by name.
31
+
32
+By default npm will publish to the public registry. This can be
33
+overridden by specifying a different default registry or using a
34
+[`scope`](/cli/v10/using-npm/scope) in the name, combined with a
35
+scope-configured registry (see
36
+[`package.json`](/cli/v10/configuring-npm/package-json)).
37
+
38
+
39
+A `package` is interpreted the same way as other commands (like
40
+`npm install` and can be:
41
+
42
+* a) a folder containing a program described by a
43
+ [`package.json`](/cli/v10/configuring-npm/package-json) file
44
+* b) a gzipped tarball containing (a)
45
+* c) a url that resolves to (b)
46
+* d) a `<name>@<version>` that is published on the registry (see
47
+ [`registry`](/cli/v10/using-npm/registry)) with (c)
48
+* e) a `<name>@<tag>` (see [`npm dist-tag`](/cli/v10/commands/npm-dist-tag)) that
49
+ points to (d)
50
+* f) a `<name>` that has a "latest" tag satisfying (e)
51
+* g) a `<git remote url>` that resolves to (a)
52
+
53
+The publish will fail if the package name and version combination already
54
+exists in the specified registry.
55
+
56
+Once a package is published with a given name and version, that specific
57
+name and version combination can never be used again, even if it is removed
58
+with [`npm unpublish`](/cli/v10/commands/npm-unpublish).
59
+
60
+As of `npm@5`, both a sha1sum and an integrity field with a sha512sum of the
61
+tarball will be submitted to the registry during publication. Subsequent
62
+installs will use the strongest supported algorithm to verify downloads.
63
+
64
+Similar to `--dry-run` see [`npm pack`](/cli/v10/commands/npm-pack), which figures
65
+out the files to be included and packs them into a tarball to be uploaded
66
+to the registry.
67
+
68
+### Files included in package
69
+
70
+To see what will be included in your package, run `npm pack --dry-run`. All
71
+files are included by default, with the following exceptions:
72
+
73
+- Certain files that are relevant to package installation and distribution
74
+ are always included. For example, `package.json`, `README.md`,
75
+ `LICENSE`, and so on.
76
+
77
+- If there is a "files" list in
78
+ [`package.json`](/cli/v10/configuring-npm/package-json), then only the files
79
+ specified will be included. (If directories are specified, then they
80
+ will be walked recursively and their contents included, subject to the
81
+ same ignore rules.)
82
+
83
+- If there is a `.gitignore` or `.npmignore` file, then ignored files in
84
+ that and all child directories will be excluded from the package. If
85
+ _both_ files exist, then the `.gitignore` is ignored, and only the
86
+ `.npmignore` is used.
87
+
88
+ `.npmignore` files follow the [same pattern
89
+ rules](https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_ignoring)
90
+ as `.gitignore` files
91
+
92
+- If the file matches certain patterns, then it will _never_ be included,
93
+ unless explicitly added to the `"files"` list in `package.json`, or
94
+ un-ignored with a `!` rule in a `.npmignore` or `.gitignore` file.
95
+
96
+- Symbolic links are never included in npm packages.
97
+
98
+
99
+See [`developers`](/cli/v10/using-npm/developers) for full details on what's
100
+included in the published package, as well as details on how the package is
101
+built.
102
+
103
+### Configuration
104
+
105
+#### `tag`
106
+
107
+* Default: "latest"
108
+* Type: String
109
+
110
+If you ask npm to install a package and don't tell it a specific version,
111
+then it will install the specified tag.
112
+
113
+Also the tag that is added to the package@version specified by the `npm tag`
114
+command, if no explicit tag is given.
115
+
116
+When used by the `npm diff` command, this is the tag used to fetch the
117
+tarball that will be compared with the local files by default.
118
+
119
+
120
+
121
+#### `access`
122
+
123
+* Default: 'public' for new packages, existing packages it will not change the
124
+ current level
125
+* Type: null, "restricted", or "public"
126
+
127
+If you do not want your scoped package to be publicly viewable (and
128
+installable) set `--access=restricted`.
129
+
130
+Unscoped packages can not be set to `restricted`.
131
+
132
+Note: This defaults to not changing the current access level for existing
133
+packages. Specifying a value of `restricted` or `public` during publish will
134
+change the access for an existing package the same way that `npm access set
135
+status` would.
136
+
137
+
138
+
139
+#### `dry-run`
140
+
141
+* Default: false
142
+* Type: Boolean
143
+
144
+Indicates that you don't want npm to make any changes and that it should
145
+only report what it would have done. This can be passed into any of the
146
+commands that modify your local installation, eg, `install`, `update`,
147
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
148
+
149
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
150
+`owner`, etc.
151
+
152
+
153
+
154
+#### `otp`
155
+
156
+* Default: null
157
+* Type: null or String
158
+
159
+This is a one-time password from a two-factor authenticator. It's needed
160
+when publishing or changing package permissions with `npm access`.
161
+
162
+If not set, and a registry response fails with a challenge for a one-time
163
+password, npm will prompt on the command line for one.
164
+
165
+
166
+
167
+#### `workspace`
168
+
169
+* Default:
170
+* Type: String (can be set multiple times)
171
+
172
+Enable running a command in the context of the configured workspaces of the
173
+current project while filtering by running only the workspaces defined by
174
+this configuration option.
175
+
176
+Valid values for the `workspace` config are either:
177
+
178
+* Workspace names
179
+* Path to a workspace directory
180
+* Path to a parent workspace directory (will result in selecting all
181
+ workspaces within that folder)
182
+
183
+When set for the `npm init` command, this may be set to the folder of a
184
+workspace which does not yet exist, to create the folder and set it up as a
185
+brand new workspace within the project.
186
+
187
+This value is not exported to the environment for child processes.
188
+
189
+#### `workspaces`
190
+
191
+* Default: null
192
+* Type: null or Boolean
193
+
194
+Set to true to run the command in the context of **all** configured
195
+workspaces.
196
+
197
+Explicitly setting this to false will cause commands like `install` to
198
+ignore workspaces altogether. When not set explicitly:
199
+
200
+- Commands that operate on the `node_modules` tree (install, update, etc.)
201
+will link workspaces into the `node_modules` folder. - Commands that do
202
+other things (test, exec, publish, etc.) will operate on the root project,
203
+_unless_ one or more workspaces are specified in the `workspace` config.
204
+
205
+This value is not exported to the environment for child processes.
206
+
207
+#### `include-workspace-root`
208
+
209
+* Default: false
210
+* Type: Boolean
211
+
212
+Include the workspace root when workspaces are enabled for a command.
213
+
214
+When false, specifying individual workspaces via the `workspace` config, or
215
+all workspaces via the `workspaces` flag, will cause npm to operate only on
216
+the specified workspaces, and not on the root project.
217
+
218
+This value is not exported to the environment for child processes.
219
+
220
+#### `provenance`
221
+
222
+* Default: false
223
+* Type: Boolean
224
+
225
+When publishing from a supported cloud CI/CD system, the package will be
226
+publicly linked to where it was built and published from.
227
+
228
+This config can not be used with: `provenance-file`
229
+
230
+#### `provenance-file`
231
+
232
+* Default: null
233
+* Type: Path
234
+
235
+When publishing, the provenance bundle at the given path will be used.
236
+
237
+This config can not be used with: `provenance`
238
+
239
+### See Also
240
+
241
+* [package spec](/cli/v10/using-npm/package-spec)
242
+* [npm-packlist package](http://npm.im/npm-packlist)
243
+* [npm registry](/cli/v10/using-npm/registry)
244
+* [npm scope](/cli/v10/using-npm/scope)
245
+* [npm adduser](/cli/v10/commands/npm-adduser)
246
+* [npm owner](/cli/v10/commands/npm-owner)
247
+* [npm deprecate](/cli/v10/commands/npm-deprecate)
248
+* [npm dist-tag](/cli/v10/commands/npm-dist-tag)
249
+* [npm pack](/cli/v10/commands/npm-pack)
250
+* [npm profile](/cli/v10/commands/npm-profile)
content/cli/v10/commands/npm-query.md
new
+227
@@ -0,0 +1,227 @@
1
+---
2
+title: npm-query
3
+section: 1
4
+description: Dependency selector query
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-query.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-query
10
+ - /cli-documentation/v10/cli-commands/query
11
+ - /cli-documentation/v10/commands/npm-query
12
+ - /cli-documentation/v10/commands/query
13
+ - /cli-documentation/v10/npm-query
14
+ - /cli-documentation/v10/query
15
+ - /cli/v10/cli-commands/npm-query
16
+ - /cli/v10/cli-commands/query
17
+ - /cli/v10/commands/query
18
+ - /cli/v10/npm-query
19
+ - /cli/v10/query
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm query <selector>
26
+```
27
+
28
+### Description
29
+
30
+The `npm query` command allows for usage of css selectors in order to retrieve
31
+an array of dependency objects.
32
+
33
+### Piping npm query to other commands
34
+
35
+```bash
36
+# find all dependencies with postinstall scripts & uninstall them
37
+npm query ":attr(scripts, [postinstall])" | jq 'map(.name)|join("\n")' -r | xargs -I {} npm uninstall {}
38
+
39
+# find all git dependencies & explain who requires them
40
+npm query ":type(git)" | jq 'map(.name)' | xargs -I {} npm why {}
41
+```
42
+
43
+### Extended Use Cases & Queries
44
+
45
+```stylus
46
+// all deps
47
+*
48
+
49
+// all direct deps
50
+:root > *
51
+
52
+// direct production deps
53
+:root > .prod
54
+
55
+// direct development deps
56
+:root > .dev
57
+
58
+// any peer dep of a direct deps
59
+:root > * > .peer
60
+
61
+// any workspace dep
62
+.workspace
63
+
64
+// all workspaces that depend on another workspace
65
+.workspace > .workspace
66
+
67
+// all workspaces that have peer deps
68
+.workspace:has(.peer)
69
+
70
+// any dep named "lodash"
71
+// equivalent to [name="lodash"]
72
+#lodash
73
+
74
+// any deps named "lodash" & within semver range ^"1.2.3"
75
+#lodash@^1.2.3
76
+// equivalent to...
77
+[name="lodash"]:semver(^1.2.3)
78
+
79
+// get the hoisted node for a given semver range
80
+#lodash@^1.2.3:not(:deduped)
81
+
82
+// querying deps with a specific version
83
+#lodash@2.1.5
84
+// equivalent to...
85
+[name="lodash"][version="2.1.5"]
86
+
87
+// has any deps
88
+:has(*)
89
+
90
+// deps with no other deps (ie. "leaf" nodes)
91
+:empty
92
+
93
+// manually querying git dependencies
94
+[repository^=github:],
95
+[repository^=git:],
96
+[repository^=https://github.com],
97
+[repository^=http://github.com],
98
+[repository^=https://github.com],
99
+[repository^=+git:...]
100
+
101
+// querying for all git dependencies
102
+:type(git)
103
+
104
+// get production dependencies that aren't also dev deps
105
+.prod:not(.dev)
106
+
107
+// get dependencies with specific licenses
108
+[license=MIT], [license=ISC]
109
+
110
+// find all packages that have @ruyadorno as a contributor
111
+:attr(contributors, [email=ruyadorno@github.com])
112
+```
113
+
114
+### Example Response Output
115
+
116
+- an array of dependency objects is returned which can contain multiple copies of the same package which may or may not have been linked or deduped
117
+
118
+```json
119
+[
120
+ {
121
+ "name": "",
122
+ "version": "",
123
+ "description": "",
124
+ "homepage": "",
125
+ "bugs": {},
126
+ "author": {},
127
+ "license": {},
128
+ "funding": {},
129
+ "files": [],
130
+ "main": "",
131
+ "browser": "",
132
+ "bin": {},
133
+ "man": [],
134
+ "directories": {},
135
+ "repository": {},
136
+ "scripts": {},
137
+ "config": {},
138
+ "dependencies": {},
139
+ "devDependencies": {},
140
+ "optionalDependencies": {},
141
+ "bundledDependencies": {},
142
+ "peerDependencies": {},
143
+ "peerDependenciesMeta": {},
144
+ "engines": {},
145
+ "os": [],
146
+ "cpu": [],
147
+ "workspaces": {},
148
+ "keywords": [],
149
+ ...
150
+ },
151
+ ...
152
+```
153
+
154
+### Configuration
155
+
156
+#### `global`
157
+
158
+* Default: false
159
+* Type: Boolean
160
+
161
+Operates in "global" mode, so that packages are installed into the `prefix`
162
+folder instead of the current working directory. See
163
+[folders](/cli/v10/configuring-npm/folders) for more on the differences in behavior.
164
+
165
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
166
+ of the current working directory.
167
+* bin files are linked to `{prefix}/bin`
168
+* man pages are linked to `{prefix}/share/man`
169
+
170
+
171
+
172
+#### `workspace`
173
+
174
+* Default:
175
+* Type: String (can be set multiple times)
176
+
177
+Enable running a command in the context of the configured workspaces of the
178
+current project while filtering by running only the workspaces defined by
179
+this configuration option.
180
+
181
+Valid values for the `workspace` config are either:
182
+
183
+* Workspace names
184
+* Path to a workspace directory
185
+* Path to a parent workspace directory (will result in selecting all
186
+ workspaces within that folder)
187
+
188
+When set for the `npm init` command, this may be set to the folder of a
189
+workspace which does not yet exist, to create the folder and set it up as a
190
+brand new workspace within the project.
191
+
192
+This value is not exported to the environment for child processes.
193
+
194
+#### `workspaces`
195
+
196
+* Default: null
197
+* Type: null or Boolean
198
+
199
+Set to true to run the command in the context of **all** configured
200
+workspaces.
201
+
202
+Explicitly setting this to false will cause commands like `install` to
203
+ignore workspaces altogether. When not set explicitly:
204
+
205
+- Commands that operate on the `node_modules` tree (install, update, etc.)
206
+will link workspaces into the `node_modules` folder. - Commands that do
207
+other things (test, exec, publish, etc.) will operate on the root project,
208
+_unless_ one or more workspaces are specified in the `workspace` config.
209
+
210
+This value is not exported to the environment for child processes.
211
+
212
+#### `include-workspace-root`
213
+
214
+* Default: false
215
+* Type: Boolean
216
+
217
+Include the workspace root when workspaces are enabled for a command.
218
+
219
+When false, specifying individual workspaces via the `workspace` config, or
220
+all workspaces via the `workspaces` flag, will cause npm to operate only on
221
+the specified workspaces, and not on the root project.
222
+
223
+This value is not exported to the environment for child processes.
224
+## See Also
225
+
226
+* [dependency selectors](/cli/v10/using-npm/dependency-selectors)
227
+
content/cli/v10/commands/npm-rebuild.md
new
+168
@@ -0,0 +1,168 @@
1
+---
2
+title: npm-rebuild
3
+section: 1
4
+description: Rebuild a package
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-rebuild.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-rebuild
10
+ - /cli-documentation/v10/cli-commands/rebuild
11
+ - /cli-documentation/v10/commands/npm-rebuild
12
+ - /cli-documentation/v10/commands/rebuild
13
+ - /cli-documentation/v10/npm-rebuild
14
+ - /cli-documentation/v10/rebuild
15
+ - /cli/v10/cli-commands/npm-rebuild
16
+ - /cli/v10/cli-commands/rebuild
17
+ - /cli/v10/commands/rebuild
18
+ - /cli/v10/npm-rebuild
19
+ - /cli/v10/rebuild
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm rebuild [<package-spec>] ...]
26
+
27
+alias: rb
28
+```
29
+
30
+### Description
31
+
32
+This command runs the `npm build` command on the matched folders. This is
33
+useful when you install a new version of node, and must recompile all your
34
+C++ addons with the new binary. It is also useful when installing with
35
+`--ignore-scripts` and `--no-bin-links`, to explicitly choose which
36
+packages to build and/or link bins.
37
+
38
+If one or more package specs are provided, then only packages with a
39
+name and version matching one of the specifiers will be rebuilt.
40
+
41
+### Configuration
42
+
43
+#### `global`
44
+
45
+* Default: false
46
+* Type: Boolean
47
+
48
+Operates in "global" mode, so that packages are installed into the `prefix`
49
+folder instead of the current working directory. See
50
+[folders](/cli/v10/configuring-npm/folders) for more on the differences in behavior.
51
+
52
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
53
+ of the current working directory.
54
+* bin files are linked to `{prefix}/bin`
55
+* man pages are linked to `{prefix}/share/man`
56
+
57
+
58
+
59
+#### `bin-links`
60
+
61
+* Default: true
62
+* Type: Boolean
63
+
64
+Tells npm to create symlinks (or `.cmd` shims on Windows) for package
65
+executables.
66
+
67
+Set to false to have it not do this. This can be used to work around the
68
+fact that some file systems don't support symlinks, even on ostensibly Unix
69
+systems.
70
+
71
+
72
+
73
+#### `foreground-scripts`
74
+
75
+* Default: false
76
+* Type: Boolean
77
+
78
+Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)
79
+scripts for installed packages in the foreground process, sharing standard
80
+input, output, and error with the main npm process.
81
+
82
+Note that this will generally make installs run slower, and be much noisier,
83
+but can be useful for debugging.
84
+
85
+
86
+
87
+#### `ignore-scripts`
88
+
89
+* Default: false
90
+* Type: Boolean
91
+
92
+If true, npm does not run scripts specified in package.json files.
93
+
94
+Note that commands explicitly intended to run a particular script, such as
95
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
96
+will still run their intended script if `ignore-scripts` is set, but they
97
+will *not* run any pre- or post-scripts.
98
+
99
+
100
+
101
+#### `workspace`
102
+
103
+* Default:
104
+* Type: String (can be set multiple times)
105
+
106
+Enable running a command in the context of the configured workspaces of the
107
+current project while filtering by running only the workspaces defined by
108
+this configuration option.
109
+
110
+Valid values for the `workspace` config are either:
111
+
112
+* Workspace names
113
+* Path to a workspace directory
114
+* Path to a parent workspace directory (will result in selecting all
115
+ workspaces within that folder)
116
+
117
+When set for the `npm init` command, this may be set to the folder of a
118
+workspace which does not yet exist, to create the folder and set it up as a
119
+brand new workspace within the project.
120
+
121
+This value is not exported to the environment for child processes.
122
+
123
+#### `workspaces`
124
+
125
+* Default: null
126
+* Type: null or Boolean
127
+
128
+Set to true to run the command in the context of **all** configured
129
+workspaces.
130
+
131
+Explicitly setting this to false will cause commands like `install` to
132
+ignore workspaces altogether. When not set explicitly:
133
+
134
+- Commands that operate on the `node_modules` tree (install, update, etc.)
135
+will link workspaces into the `node_modules` folder. - Commands that do
136
+other things (test, exec, publish, etc.) will operate on the root project,
137
+_unless_ one or more workspaces are specified in the `workspace` config.
138
+
139
+This value is not exported to the environment for child processes.
140
+
141
+#### `include-workspace-root`
142
+
143
+* Default: false
144
+* Type: Boolean
145
+
146
+Include the workspace root when workspaces are enabled for a command.
147
+
148
+When false, specifying individual workspaces via the `workspace` config, or
149
+all workspaces via the `workspaces` flag, will cause npm to operate only on
150
+the specified workspaces, and not on the root project.
151
+
152
+This value is not exported to the environment for child processes.
153
+
154
+#### `install-links`
155
+
156
+* Default: false
157
+* Type: Boolean
158
+
159
+When set file: protocol dependencies will be packed and installed as regular
160
+dependencies instead of creating a symlink. This option has no effect on
161
+workspaces.
162
+
163
+
164
+
165
+### See Also
166
+
167
+* [package spec](/cli/v10/using-npm/package-spec)
168
+* [npm install](/cli/v10/commands/npm-install)
content/cli/v10/commands/npm-repo.md
new
+117
@@ -0,0 +1,117 @@
1
+---
2
+title: npm-repo
3
+section: 1
4
+description: Open package repository page in the browser
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-repo.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-repo
10
+ - /cli-documentation/v10/cli-commands/repo
11
+ - /cli-documentation/v10/commands/npm-repo
12
+ - /cli-documentation/v10/commands/repo
13
+ - /cli-documentation/v10/npm-repo
14
+ - /cli-documentation/v10/repo
15
+ - /cli/v10/cli-commands/npm-repo
16
+ - /cli/v10/cli-commands/repo
17
+ - /cli/v10/commands/repo
18
+ - /cli/v10/npm-repo
19
+ - /cli/v10/repo
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm repo [<pkgname> [<pkgname> ...]]
26
+```
27
+
28
+### Description
29
+
30
+This command tries to guess at the likely location of a package's
31
+repository URL, and then tries to open it using the
32
+[`--browser` config](/cli/v10/using-npm/config#browser) param. If no package name is
33
+provided, it will search for a `package.json` in the current folder and use the
34
+`repository` property.
35
+
36
+### Configuration
37
+
38
+#### `browser`
39
+
40
+* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
41
+* Type: null, Boolean, or String
42
+
43
+The browser that is called by npm commands to open websites.
44
+
45
+Set to `false` to suppress browser behavior and instead print urls to
46
+terminal.
47
+
48
+Set to `true` to use default system URL opener.
49
+
50
+
51
+
52
+#### `registry`
53
+
54
+* Default: "https://registry.npmjs.org/"
55
+* Type: URL
56
+
57
+The base URL of the npm registry.
58
+
59
+
60
+
61
+#### `workspace`
62
+
63
+* Default:
64
+* Type: String (can be set multiple times)
65
+
66
+Enable running a command in the context of the configured workspaces of the
67
+current project while filtering by running only the workspaces defined by
68
+this configuration option.
69
+
70
+Valid values for the `workspace` config are either:
71
+
72
+* Workspace names
73
+* Path to a workspace directory
74
+* Path to a parent workspace directory (will result in selecting all
75
+ workspaces within that folder)
76
+
77
+When set for the `npm init` command, this may be set to the folder of a
78
+workspace which does not yet exist, to create the folder and set it up as a
79
+brand new workspace within the project.
80
+
81
+This value is not exported to the environment for child processes.
82
+
83
+#### `workspaces`
84
+
85
+* Default: null
86
+* Type: null or Boolean
87
+
88
+Set to true to run the command in the context of **all** configured
89
+workspaces.
90
+
91
+Explicitly setting this to false will cause commands like `install` to
92
+ignore workspaces altogether. When not set explicitly:
93
+
94
+- Commands that operate on the `node_modules` tree (install, update, etc.)
95
+will link workspaces into the `node_modules` folder. - Commands that do
96
+other things (test, exec, publish, etc.) will operate on the root project,
97
+_unless_ one or more workspaces are specified in the `workspace` config.
98
+
99
+This value is not exported to the environment for child processes.
100
+
101
+#### `include-workspace-root`
102
+
103
+* Default: false
104
+* Type: Boolean
105
+
106
+Include the workspace root when workspaces are enabled for a command.
107
+
108
+When false, specifying individual workspaces via the `workspace` config, or
109
+all workspaces via the `workspaces` flag, will cause npm to operate only on
110
+the specified workspaces, and not on the root project.
111
+
112
+This value is not exported to the environment for child processes.
113
+
114
+### See Also
115
+
116
+* [npm docs](/cli/v10/commands/npm-docs)
117
+* [npm config](/cli/v10/commands/npm-config)
content/cli/v10/commands/npm-restart.md
new
+85
@@ -0,0 +1,85 @@
1
+---
2
+title: npm-restart
3
+section: 1
4
+description: Restart a package
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-restart.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-restart
10
+ - /cli-documentation/v10/cli-commands/restart
11
+ - /cli-documentation/v10/commands/npm-restart
12
+ - /cli-documentation/v10/commands/restart
13
+ - /cli-documentation/v10/npm-restart
14
+ - /cli-documentation/v10/restart
15
+ - /cli/v10/cli-commands/npm-restart
16
+ - /cli/v10/cli-commands/restart
17
+ - /cli/v10/commands/restart
18
+ - /cli/v10/npm-restart
19
+ - /cli/v10/restart
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm restart [-- <args>]
26
+```
27
+
28
+### Description
29
+
30
+This restarts a project. It is equivalent to running `npm run-script
31
+restart`.
32
+
33
+If the current project has a `"restart"` script specified in
34
+`package.json`, then the following scripts will be run:
35
+
36
+1. prerestart
37
+2. restart
38
+3. postrestart
39
+
40
+If it does _not_ have a `"restart"` script specified, but it does have
41
+`stop` and/or `start` scripts, then the following scripts will be run:
42
+
43
+1. prerestart
44
+2. prestop
45
+3. stop
46
+4. poststop
47
+6. prestart
48
+7. start
49
+8. poststart
50
+9. postrestart
51
+
52
+### Configuration
53
+
54
+#### `ignore-scripts`
55
+
56
+* Default: false
57
+* Type: Boolean
58
+
59
+If true, npm does not run scripts specified in package.json files.
60
+
61
+Note that commands explicitly intended to run a particular script, such as
62
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
63
+will still run their intended script if `ignore-scripts` is set, but they
64
+will *not* run any pre- or post-scripts.
65
+
66
+
67
+
68
+#### `script-shell`
69
+
70
+* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
71
+* Type: null or String
72
+
73
+The shell to use for scripts run with the `npm exec`, `npm run` and `npm
74
+init <package-spec>` commands.
75
+
76
+
77
+
78
+### See Also
79
+
80
+* [npm run-script](/cli/v10/commands/npm-run-script)
81
+* [npm scripts](/cli/v10/using-npm/scripts)
82
+* [npm test](/cli/v10/commands/npm-test)
83
+* [npm start](/cli/v10/commands/npm-start)
84
+* [npm stop](/cli/v10/commands/npm-stop)
85
+* [npm restart](/cli/v10/commands/npm-restart)
content/cli/v10/commands/npm-root.md
new
+66
@@ -0,0 +1,66 @@
1
+---
2
+title: npm-root
3
+section: 1
4
+description: Display npm root
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-root.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-root
10
+ - /cli-documentation/v10/cli-commands/root
11
+ - /cli-documentation/v10/commands/npm-root
12
+ - /cli-documentation/v10/commands/root
13
+ - /cli-documentation/v10/npm-root
14
+ - /cli-documentation/v10/root
15
+ - /cli/v10/cli-commands/npm-root
16
+ - /cli/v10/cli-commands/root
17
+ - /cli/v10/commands/root
18
+ - /cli/v10/npm-root
19
+ - /cli/v10/root
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm root
26
+```
27
+
28
+Note: This command is unaware of workspaces.
29
+
30
+### Description
31
+
32
+Print the effective `node_modules` folder to standard out.
33
+
34
+Useful for using npm in shell scripts that do things with the
35
+`node_modules` folder. For example:
36
+
37
+```bash
38
+#!/bin/bash
39
+global_node_modules="$(npm root --global)"
40
+echo "Global packages installed in: ${global_node_modules}"
41
+```
42
+
43
+### Configuration
44
+
45
+#### `global`
46
+
47
+* Default: false
48
+* Type: Boolean
49
+
50
+Operates in "global" mode, so that packages are installed into the `prefix`
51
+folder instead of the current working directory. See
52
+[folders](/cli/v10/configuring-npm/folders) for more on the differences in behavior.
53
+
54
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
55
+ of the current working directory.
56
+* bin files are linked to `{prefix}/bin`
57
+* man pages are linked to `{prefix}/share/man`
58
+
59
+
60
+
61
+### See Also
62
+
63
+* [npm prefix](/cli/v10/commands/npm-prefix)
64
+* [npm folders](/cli/v10/configuring-npm/folders)
65
+* [npm config](/cli/v10/commands/npm-config)
66
+* [npmrc](/cli/v10/configuring-npm/npmrc)
content/cli/v10/commands/npm-run-script.md
new
+268
@@ -0,0 +1,268 @@
1
+---
2
+title: npm-run-script
3
+section: 1
4
+description: Run arbitrary package scripts
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-run-script.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-run-script
10
+ - /cli-documentation/v10/cli-commands/run-script
11
+ - /cli-documentation/v10/commands/npm-run-script
12
+ - /cli-documentation/v10/commands/run-script
13
+ - /cli-documentation/v10/npm-run-script
14
+ - /cli-documentation/v10/run-script
15
+ - /cli/v10/cli-commands/npm-run-script
16
+ - /cli/v10/cli-commands/run-script
17
+ - /cli/v10/commands/run-script
18
+ - /cli/v10/npm-run-script
19
+ - /cli/v10/run-script
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm run-script <command> [-- <args>]
26
+
27
+aliases: run, rum, urn
28
+```
29
+
30
+### Description
31
+
32
+This runs an arbitrary command from a package's `"scripts"` object. If no
33
+`"command"` is provided, it will list the available scripts.
34
+
35
+`run[-script]` is used by the test, start, restart, and stop commands, but
36
+can be called directly, as well. When the scripts in the package are
37
+printed out, they're separated into lifecycle (test, start, restart) and
38
+directly-run scripts.
39
+
40
+Any positional arguments are passed to the specified script. Use `--` to
41
+pass `-`-prefixed flags and options which would otherwise be parsed by npm.
42
+
43
+For example:
44
+
45
+```bash
46
+npm run test -- --grep="pattern"
47
+```
48
+
49
+The arguments will only be passed to the script specified after `npm run`
50
+and not to any `pre` or `post` script.
51
+
52
+The `env` script is a special built-in command that can be used to list
53
+environment variables that will be available to the script at runtime. If an
54
+"env" command is defined in your package, it will take precedence over the
55
+built-in.
56
+
57
+In addition to the shell's pre-existing `PATH`, `npm run` adds
58
+`node_modules/.bin` to the `PATH` provided to scripts. Any binaries
59
+provided by locally-installed dependencies can be used without the
60
+`node_modules/.bin` prefix. For example, if there is a `devDependency` on
61
+`tap` in your package, you should write:
62
+
63
+```bash
64
+"scripts": {"test": "tap test/*.js"}
65
+```
66
+
67
+instead of
68
+
69
+```bash
70
+"scripts": {"test": "node_modules/.bin/tap test/*.js"}
71
+```
72
+
73
+The actual shell your script is run within is platform dependent. By default,
74
+on Unix-like systems it is the `/bin/sh` command, on Windows it is
75
+`cmd.exe`.
76
+The actual shell referred to by `/bin/sh` also depends on the system.
77
+You can customize the shell with the
78
+[`script-shell` config](/cli/v10/using-npm/config#script-shell).
79
+
80
+Scripts are run from the root of the package folder, regardless of what the
81
+current working directory is when `npm run` is called. If you want your
82
+script to use different behavior based on what subdirectory you're in, you
83
+can use the `INIT_CWD` environment variable, which holds the full path you
84
+were in when you ran `npm run`.
85
+
86
+`npm run` sets the `NODE` environment variable to the `node` executable
87
+with which `npm` is executed.
88
+
89
+If you try to run a script without having a `node_modules` directory and it
90
+fails, you will be given a warning to run `npm install`, just in case you've
91
+forgotten.
92
+
93
+### Workspaces support
94
+
95
+You may use the [`workspace`](/cli/v10/using-npm/config#workspace) or
96
+[`workspaces`](/cli/v10/using-npm/config#workspaces) configs in order to run an
97
+arbitrary command from a package's `"scripts"` object in the context of the
98
+specified workspaces. If no `"command"` is provided, it will list the available
99
+scripts for each of these configured workspaces.
100
+
101
+Given a project with configured workspaces, e.g:
102
+
103
+```
104
+.
105
++-- package.json
106
+`-- packages
107
+ +-- a
108
+ | `-- package.json
109
+ +-- b
110
+ | `-- package.json
111
+ `-- c
112
+ `-- package.json
113
+```
114
+
115
+Assuming the workspace configuration is properly set up at the root level
116
+`package.json` file. e.g:
117
+
118
+```
119
+{
120
+ "workspaces": [ "./packages/*" ]
121
+}
122
+```
123
+
124
+And that each of the configured workspaces has a configured `test` script,
125
+we can run tests in all of them using the
126
+[`workspaces` config](/cli/v10/using-npm/config#workspaces):
127
+
128
+```
129
+npm test --workspaces
130
+```
131
+
132
+#### Filtering workspaces
133
+
134
+It's also possible to run a script in a single workspace using the `workspace`
135
+config along with a name or directory path:
136
+
137
+```
138
+npm test --workspace=a
139
+```
140
+
141
+The `workspace` config can also be specified multiple times in order to run a
142
+specific script in the context of multiple workspaces. When defining values for
143
+the `workspace` config in the command line, it also possible to use `-w` as a
144
+shorthand, e.g:
145
+
146
+```
147
+npm test -w a -w b
148
+```
149
+
150
+This last command will run `test` in both `./packages/a` and `./packages/b`
151
+packages.
152
+
153
+### Configuration
154
+
155
+#### `workspace`
156
+
157
+* Default:
158
+* Type: String (can be set multiple times)
159
+
160
+Enable running a command in the context of the configured workspaces of the
161
+current project while filtering by running only the workspaces defined by
162
+this configuration option.
163
+
164
+Valid values for the `workspace` config are either:
165
+
166
+* Workspace names
167
+* Path to a workspace directory
168
+* Path to a parent workspace directory (will result in selecting all
169
+ workspaces within that folder)
170
+
171
+When set for the `npm init` command, this may be set to the folder of a
172
+workspace which does not yet exist, to create the folder and set it up as a
173
+brand new workspace within the project.
174
+
175
+This value is not exported to the environment for child processes.
176
+
177
+#### `workspaces`
178
+
179
+* Default: null
180
+* Type: null or Boolean
181
+
182
+Set to true to run the command in the context of **all** configured
183
+workspaces.
184
+
185
+Explicitly setting this to false will cause commands like `install` to
186
+ignore workspaces altogether. When not set explicitly:
187
+
188
+- Commands that operate on the `node_modules` tree (install, update, etc.)
189
+will link workspaces into the `node_modules` folder. - Commands that do
190
+other things (test, exec, publish, etc.) will operate on the root project,
191
+_unless_ one or more workspaces are specified in the `workspace` config.
192
+
193
+This value is not exported to the environment for child processes.
194
+
195
+#### `include-workspace-root`
196
+
197
+* Default: false
198
+* Type: Boolean
199
+
200
+Include the workspace root when workspaces are enabled for a command.
201
+
202
+When false, specifying individual workspaces via the `workspace` config, or
203
+all workspaces via the `workspaces` flag, will cause npm to operate only on
204
+the specified workspaces, and not on the root project.
205
+
206
+This value is not exported to the environment for child processes.
207
+
208
+#### `if-present`
209
+
210
+* Default: false
211
+* Type: Boolean
212
+
213
+If true, npm will not exit with an error code when `run-script` is invoked
214
+for a script that isn't defined in the `scripts` section of `package.json`.
215
+This option can be used when it's desirable to optionally run a script when
216
+it's present and fail if the script fails. This is useful, for example, when
217
+running scripts that may only apply for some builds in an otherwise generic
218
+CI setup.
219
+
220
+This value is not exported to the environment for child processes.
221
+
222
+#### `ignore-scripts`
223
+
224
+* Default: false
225
+* Type: Boolean
226
+
227
+If true, npm does not run scripts specified in package.json files.
228
+
229
+Note that commands explicitly intended to run a particular script, such as
230
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
231
+will still run their intended script if `ignore-scripts` is set, but they
232
+will *not* run any pre- or post-scripts.
233
+
234
+
235
+
236
+#### `foreground-scripts`
237
+
238
+* Default: false
239
+* Type: Boolean
240
+
241
+Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)
242
+scripts for installed packages in the foreground process, sharing standard
243
+input, output, and error with the main npm process.
244
+
245
+Note that this will generally make installs run slower, and be much noisier,
246
+but can be useful for debugging.
247
+
248
+
249
+
250
+#### `script-shell`
251
+
252
+* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
253
+* Type: null or String
254
+
255
+The shell to use for scripts run with the `npm exec`, `npm run` and `npm
256
+init <package-spec>` commands.
257
+
258
+
259
+
260
+### See Also
261
+
262
+* [npm scripts](/cli/v10/using-npm/scripts)
263
+* [npm test](/cli/v10/commands/npm-test)
264
+* [npm start](/cli/v10/commands/npm-start)
265
+* [npm restart](/cli/v10/commands/npm-restart)
266
+* [npm stop](/cli/v10/commands/npm-stop)
267
+* [npm config](/cli/v10/commands/npm-config)
268
+* [npm workspaces](/cli/v10/using-npm/workspaces)
content/cli/v10/commands/npm-search.md
new
+174
@@ -0,0 +1,174 @@
1
+---
2
+title: npm-search
3
+section: 1
4
+description: Search for packages
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-search.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-search
10
+ - /cli-documentation/v10/cli-commands/search
11
+ - /cli-documentation/v10/commands/npm-search
12
+ - /cli-documentation/v10/commands/search
13
+ - /cli-documentation/v10/npm-search
14
+ - /cli-documentation/v10/search
15
+ - /cli/v10/cli-commands/npm-search
16
+ - /cli/v10/cli-commands/search
17
+ - /cli/v10/commands/search
18
+ - /cli/v10/npm-search
19
+ - /cli/v10/search
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm search [search terms ...]
26
+
27
+aliases: find, s, se
28
+```
29
+
30
+Note: This command is unaware of workspaces.
31
+
32
+### Description
33
+
34
+Search the registry for packages matching the search terms. `npm search`
35
+performs a linear, incremental, lexically-ordered search through package
36
+metadata for all files in the registry. If your terminal has color
37
+support, it will further highlight the matches in the results. This can
38
+be disabled with the config item `color`
39
+
40
+Additionally, using the `--searchopts` and `--searchexclude` options
41
+paired with more search terms will include and exclude further patterns.
42
+The main difference between `--searchopts` and the standard search terms
43
+is that the former does not highlight results in the output and you can
44
+use them more fine-grained filtering. Additionally, you can add both of
45
+these to your config to change default search filtering behavior.
46
+
47
+Search also allows targeting of maintainers in search results, by prefixing
48
+their npm username with `=`.
49
+
50
+If a term starts with `/`, then it's interpreted as a regular expression
51
+and supports standard JavaScript RegExp syntax. In this case search will
52
+ignore a trailing `/` . (Note you must escape or quote many regular
53
+expression characters in most shells.)
54
+
55
+### Configuration
56
+
57
+#### `long`
58
+
59
+* Default: false
60
+* Type: Boolean
61
+
62
+Show extended information in `ls`, `search`, and `help-search`.
63
+
64
+
65
+
66
+#### `json`
67
+
68
+* Default: false
69
+* Type: Boolean
70
+
71
+Whether or not to output JSON data, rather than the normal output.
72
+
73
+* In `npm pkg set` it enables parsing set values with JSON.parse() before
74
+ saving them to your `package.json`.
75
+
76
+Not supported by all npm commands.
77
+
78
+
79
+
80
+#### `color`
81
+
82
+* Default: true unless the NO_COLOR environ is set to something other than '0'
83
+* Type: "always" or Boolean
84
+
85
+If false, never shows colors. If `"always"` then always shows colors. If
86
+true, then only prints color codes for tty file descriptors.
87
+
88
+
89
+
90
+#### `parseable`
91
+
92
+* Default: false
93
+* Type: Boolean
94
+
95
+Output parseable results from commands that write to standard output. For
96
+`npm search`, this will be tab-separated table format.
97
+
98
+
99
+
100
+#### `description`
101
+
102
+* Default: true
103
+* Type: Boolean
104
+
105
+Show the description in `npm search`
106
+
107
+
108
+
109
+#### `searchopts`
110
+
111
+* Default: ""
112
+* Type: String
113
+
114
+Space-separated options that are always passed to search.
115
+
116
+
117
+
118
+#### `searchexclude`
119
+
120
+* Default: ""
121
+* Type: String
122
+
123
+Space-separated options that limit the results from search.
124
+
125
+
126
+
127
+#### `registry`
128
+
129
+* Default: "https://registry.npmjs.org/"
130
+* Type: URL
131
+
132
+The base URL of the npm registry.
133
+
134
+
135
+
136
+#### `prefer-online`
137
+
138
+* Default: false
139
+* Type: Boolean
140
+
141
+If true, staleness checks for cached data will be forced, making the CLI
142
+look for updates immediately even for fresh package data.
143
+
144
+
145
+
146
+#### `prefer-offline`
147
+
148
+* Default: false
149
+* Type: Boolean
150
+
151
+If true, staleness checks for cached data will be bypassed, but missing data
152
+will be requested from the server. To force full offline mode, use
153
+`--offline`.
154
+
155
+
156
+
157
+#### `offline`
158
+
159
+* Default: false
160
+* Type: Boolean
161
+
162
+Force offline mode: no network requests will be done during install. To
163
+allow the CLI to fill in missing cache data, see `--prefer-offline`.
164
+
165
+
166
+
167
+### See Also
168
+
169
+* [npm registry](/cli/v10/using-npm/registry)
170
+* [npm config](/cli/v10/commands/npm-config)
171
+* [npmrc](/cli/v10/configuring-npm/npmrc)
172
+* [npm view](/cli/v10/commands/npm-view)
173
+* [npm cache](/cli/v10/commands/npm-cache)
174
+* https://npm.im/npm-registry-fetch
content/cli/v10/commands/npm-shrinkwrap.md
new
+47
@@ -0,0 +1,47 @@
1
+---
2
+title: npm-shrinkwrap
3
+section: 1
4
+description: Lock down dependency versions for publication
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-shrinkwrap.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-shrinkwrap
10
+ - /cli-documentation/v10/cli-commands/shrinkwrap
11
+ - /cli-documentation/v10/commands/npm-shrinkwrap
12
+ - /cli-documentation/v10/commands/shrinkwrap
13
+ - /cli-documentation/v10/npm-shrinkwrap
14
+ - /cli-documentation/v10/shrinkwrap
15
+ - /cli/v10/cli-commands/npm-shrinkwrap
16
+ - /cli/v10/cli-commands/shrinkwrap
17
+ - /cli/v10/commands/shrinkwrap
18
+ - /cli/v10/npm-shrinkwrap
19
+ - /cli/v10/shrinkwrap
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm shrinkwrap
26
+```
27
+
28
+Note: This command is unaware of workspaces.
29
+
30
+### Description
31
+
32
+This command repurposes `package-lock.json` into a publishable
33
+`npm-shrinkwrap.json` or simply creates a new one. The file created and
34
+updated by this command will then take precedence over any other existing
35
+or future `package-lock.json` files. For a detailed explanation of the
36
+design and purpose of package locks in npm, see
37
+[package-lock-json](/cli/v10/configuring-npm/package-lock-json).
38
+
39
+### See Also
40
+
41
+* [npm install](/cli/v10/commands/npm-install)
42
+* [npm run-script](/cli/v10/commands/npm-run-script)
43
+* [npm scripts](/cli/v10/using-npm/scripts)
44
+* [package.json](/cli/v10/configuring-npm/package-json)
45
+* [package-lock.json](/cli/v10/configuring-npm/package-lock-json)
46
+* [npm-shrinkwrap.json](/cli/v10/configuring-npm/npm-shrinkwrap-json)
47
+* [npm ls](/cli/v10/commands/npm-ls)
content/cli/v10/commands/npm-star.md
new
+93
@@ -0,0 +1,93 @@
1
+---
2
+title: npm-star
3
+section: 1
4
+description: Mark your favorite packages
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-star.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-star
10
+ - /cli-documentation/v10/cli-commands/star
11
+ - /cli-documentation/v10/commands/npm-star
12
+ - /cli-documentation/v10/commands/star
13
+ - /cli-documentation/v10/npm-star
14
+ - /cli-documentation/v10/star
15
+ - /cli/v10/cli-commands/npm-star
16
+ - /cli/v10/cli-commands/star
17
+ - /cli/v10/commands/star
18
+ - /cli/v10/npm-star
19
+ - /cli/v10/star
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm star [<package-spec>...]
26
+```
27
+
28
+Note: This command is unaware of workspaces.
29
+
30
+### Description
31
+
32
+"Starring" a package means that you have some interest in it. It's
33
+a vaguely positive way to show that you care.
34
+
35
+It's a boolean thing. Starring repeatedly has no additional effect.
36
+
37
+### More
38
+
39
+There's also these extra commands to help you manage your favorite packages:
40
+
41
+#### Unstar
42
+
43
+You can also "unstar" a package using [`npm unstar`](/cli/v10/commands/npm-unstar)
44
+
45
+"Unstarring" is the same thing, but in reverse.
46
+
47
+#### Listing stars
48
+
49
+You can see all your starred packages using [`npm stars`](/cli/v10/commands/npm-stars)
50
+
51
+### Configuration
52
+
53
+#### `registry`
54
+
55
+* Default: "https://registry.npmjs.org/"
56
+* Type: URL
57
+
58
+The base URL of the npm registry.
59
+
60
+
61
+
62
+#### `unicode`
63
+
64
+* Default: false on windows, true on mac/unix systems with a unicode locale,
65
+ as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables.
66
+* Type: Boolean
67
+
68
+When set to true, npm uses unicode characters in the tree output. When
69
+false, it uses ascii characters instead of unicode glyphs.
70
+
71
+
72
+
73
+#### `otp`
74
+
75
+* Default: null
76
+* Type: null or String
77
+
78
+This is a one-time password from a two-factor authenticator. It's needed
79
+when publishing or changing package permissions with `npm access`.
80
+
81
+If not set, and a registry response fails with a challenge for a one-time
82
+password, npm will prompt on the command line for one.
83
+
84
+
85
+
86
+### See Also
87
+
88
+* [package spec](/cli/v10/using-npm/package-spec)
89
+* [npm unstar](/cli/v10/commands/npm-unstar)
90
+* [npm stars](/cli/v10/commands/npm-stars)
91
+* [npm view](/cli/v10/commands/npm-view)
92
+* [npm whoami](/cli/v10/commands/npm-whoami)
93
+* [npm adduser](/cli/v10/commands/npm-adduser)
content/cli/v10/commands/npm-stars.md
new
+55
@@ -0,0 +1,55 @@
1
+---
2
+title: npm-stars
3
+section: 1
4
+description: View packages marked as favorites
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-stars.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-stars
10
+ - /cli-documentation/v10/cli-commands/stars
11
+ - /cli-documentation/v10/commands/npm-stars
12
+ - /cli-documentation/v10/commands/stars
13
+ - /cli-documentation/v10/npm-stars
14
+ - /cli-documentation/v10/stars
15
+ - /cli/v10/cli-commands/npm-stars
16
+ - /cli/v10/cli-commands/stars
17
+ - /cli/v10/commands/stars
18
+ - /cli/v10/npm-stars
19
+ - /cli/v10/stars
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm stars [<user>]
26
+```
27
+
28
+Note: This command is unaware of workspaces.
29
+
30
+### Description
31
+
32
+If you have starred a lot of neat things and want to find them again
33
+quickly this command lets you do just that.
34
+
35
+You may also want to see your friend's favorite packages, in this case
36
+you will most certainly enjoy this command.
37
+
38
+### Configuration
39
+
40
+#### `registry`
41
+
42
+* Default: "https://registry.npmjs.org/"
43
+* Type: URL
44
+
45
+The base URL of the npm registry.
46
+
47
+
48
+
49
+### See Also
50
+
51
+* [npm star](/cli/v10/commands/npm-star)
52
+* [npm unstar](/cli/v10/commands/npm-unstar)
53
+* [npm view](/cli/v10/commands/npm-view)
54
+* [npm whoami](/cli/v10/commands/npm-whoami)
55
+* [npm adduser](/cli/v10/commands/npm-adduser)
content/cli/v10/commands/npm-start.md
new
+95
@@ -0,0 +1,95 @@
1
+---
2
+title: npm-start
3
+section: 1
4
+description: Start a package
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-start.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-start
10
+ - /cli-documentation/v10/cli-commands/start
11
+ - /cli-documentation/v10/commands/npm-start
12
+ - /cli-documentation/v10/commands/start
13
+ - /cli-documentation/v10/npm-start
14
+ - /cli-documentation/v10/start
15
+ - /cli/v10/cli-commands/npm-start
16
+ - /cli/v10/cli-commands/start
17
+ - /cli/v10/commands/start
18
+ - /cli/v10/npm-start
19
+ - /cli/v10/start
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm start [-- <args>]
26
+```
27
+
28
+### Description
29
+
30
+This runs a predefined command specified in the `"start"` property of
31
+a package's `"scripts"` object.
32
+
33
+If the `"scripts"` object does not define a `"start"` property, npm
34
+will run `node server.js`.
35
+
36
+Note that this is different from the default node behavior of running
37
+the file specified in a package's `"main"` attribute when evoking with
38
+`node .`
39
+
40
+As of [`npm@2.0.0`](https://blog.npmjs.org/post/98131109725/npm-2-0-0), you can
41
+use custom arguments when executing scripts. Refer to [`npm run-script`](/cli/v10/commands/npm-run-script) for more details.
42
+
43
+### Example
44
+
45
+```json
46
+{
47
+ "scripts": {
48
+ "start": "node foo.js"
49
+ }
50
+}
51
+```
52
+
53
+```bash
54
+npm start
55
+
56
+> npm@x.x.x start
57
+> node foo.js
58
+
59
+(foo.js output would be here)
60
+
61
+```
62
+
63
+### Configuration
64
+
65
+#### `ignore-scripts`
66
+
67
+* Default: false
68
+* Type: Boolean
69
+
70
+If true, npm does not run scripts specified in package.json files.
71
+
72
+Note that commands explicitly intended to run a particular script, such as
73
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
74
+will still run their intended script if `ignore-scripts` is set, but they
75
+will *not* run any pre- or post-scripts.
76
+
77
+
78
+
79
+#### `script-shell`
80
+
81
+* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
82
+* Type: null or String
83
+
84
+The shell to use for scripts run with the `npm exec`, `npm run` and `npm
85
+init <package-spec>` commands.
86
+
87
+
88
+
89
+### See Also
90
+
91
+* [npm run-script](/cli/v10/commands/npm-run-script)
92
+* [npm scripts](/cli/v10/using-npm/scripts)
93
+* [npm test](/cli/v10/commands/npm-test)
94
+* [npm restart](/cli/v10/commands/npm-restart)
95
+* [npm stop](/cli/v10/commands/npm-stop)
content/cli/v10/commands/npm-stop.md
new
+88
@@ -0,0 +1,88 @@
1
+---
2
+title: npm-stop
3
+section: 1
4
+description: Stop a package
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-stop.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-stop
10
+ - /cli-documentation/v10/cli-commands/stop
11
+ - /cli-documentation/v10/commands/npm-stop
12
+ - /cli-documentation/v10/commands/stop
13
+ - /cli-documentation/v10/npm-stop
14
+ - /cli-documentation/v10/stop
15
+ - /cli/v10/cli-commands/npm-stop
16
+ - /cli/v10/cli-commands/stop
17
+ - /cli/v10/commands/stop
18
+ - /cli/v10/npm-stop
19
+ - /cli/v10/stop
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm stop [-- <args>]
26
+```
27
+
28
+### Description
29
+
30
+This runs a predefined command specified in the "stop" property of a
31
+package's "scripts" object.
32
+
33
+Unlike with [npm start](/cli/v10/commands/npm-start), there is no default script
34
+that will run if the `"stop"` property is not defined.
35
+
36
+### Example
37
+
38
+```json
39
+{
40
+ "scripts": {
41
+ "stop": "node bar.js"
42
+ }
43
+}
44
+```
45
+
46
+```bash
47
+npm stop
48
+
49
+> npm@x.x.x stop
50
+> node bar.js
51
+
52
+(bar.js output would be here)
53
+
54
+```
55
+
56
+### Configuration
57
+
58
+#### `ignore-scripts`
59
+
60
+* Default: false
61
+* Type: Boolean
62
+
63
+If true, npm does not run scripts specified in package.json files.
64
+
65
+Note that commands explicitly intended to run a particular script, such as
66
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
67
+will still run their intended script if `ignore-scripts` is set, but they
68
+will *not* run any pre- or post-scripts.
69
+
70
+
71
+
72
+#### `script-shell`
73
+
74
+* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
75
+* Type: null or String
76
+
77
+The shell to use for scripts run with the `npm exec`, `npm run` and `npm
78
+init <package-spec>` commands.
79
+
80
+
81
+
82
+### See Also
83
+
84
+* [npm run-script](/cli/v10/commands/npm-run-script)
85
+* [npm scripts](/cli/v10/using-npm/scripts)
86
+* [npm test](/cli/v10/commands/npm-test)
87
+* [npm start](/cli/v10/commands/npm-start)
88
+* [npm restart](/cli/v10/commands/npm-restart)
content/cli/v10/commands/npm-team.md
new
+170
@@ -0,0 +1,170 @@
1
+---
2
+title: npm-team
3
+section: 1
4
+description: Manage organization teams and team memberships
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-team.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-team
10
+ - /cli-documentation/v10/cli-commands/team
11
+ - /cli-documentation/v10/commands/npm-team
12
+ - /cli-documentation/v10/commands/team
13
+ - /cli-documentation/v10/npm-team
14
+ - /cli-documentation/v10/team
15
+ - /cli/v10/cli-commands/npm-team
16
+ - /cli/v10/cli-commands/team
17
+ - /cli/v10/commands/team
18
+ - /cli/v10/npm-team
19
+ - /cli/v10/team
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm team create <scope:team> [--otp <otpcode>]
26
+npm team destroy <scope:team> [--otp <otpcode>]
27
+npm team add <scope:team> <user> [--otp <otpcode>]
28
+npm team rm <scope:team> <user> [--otp <otpcode>]
29
+npm team ls <scope>|<scope:team>
30
+```
31
+
32
+Note: This command is unaware of workspaces.
33
+
34
+### Description
35
+
36
+Used to manage teams in organizations, and change team memberships. Does not
37
+handle permissions for packages.
38
+
39
+Teams must always be fully qualified with the organization/scope they belong to
40
+when operating on them, separated by a colon (`:`). That is, if you have a
41
+`newteam` team in an `org` organization, you must always refer to that team
42
+as `@org:newteam` in these commands.
43
+
44
+If you have two-factor authentication enabled in `auth-and-writes` mode, then
45
+you can provide a code from your authenticator with `[--otp <otpcode>]`.
46
+If you don't include this then you will be taken through a second factor flow based
47
+on your `authtype`.
48
+
49
+* create / destroy:
50
+ Create a new team, or destroy an existing one. Note: You cannot remove the
51
+ `developers` team, <a href="https://docs.npmjs.com/about-developers-team" target="_blank">learn more.</a>
52
+
53
+ Here's how to create a new team `newteam` under the `org` org:
54
+
55
+ ```bash
56
+ npm team create @org:newteam
57
+ ```
58
+
59
+ You should see a confirming message such as: `+@org:newteam` once the new
60
+ team has been created.
61
+
62
+* add:
63
+ Add a user to an existing team.
64
+
65
+ Adding a new user `username` to a team named `newteam` under the `org` org:
66
+
67
+ ```bash
68
+ npm team add @org:newteam username
69
+ ```
70
+
71
+ On success, you should see a message: `username added to @org:newteam`
72
+
73
+* rm:
74
+ Using `npm team rm` you can also remove users from a team they belong to.
75
+
76
+ Here's an example removing user `username` from `newteam` team
77
+ in `org` organization:
78
+
79
+ ```bash
80
+ npm team rm @org:newteam username
81
+ ```
82
+
83
+ Once the user is removed a confirmation message is displayed:
84
+ `username removed from @org:newteam`
85
+
86
+* ls:
87
+ If performed on an organization name, will return a list of existing teams
88
+ under that organization. If performed on a team, it will instead return a list
89
+ of all users belonging to that particular team.
90
+
91
+ Here's an example of how to list all teams from an org named `org`:
92
+
93
+ ```bash
94
+ npm team ls @org
95
+ ```
96
+
97
+ Example listing all members of a team named `newteam`:
98
+
99
+ ```bash
100
+ npm team ls @org:newteam
101
+ ```
102
+
103
+### Details
104
+
105
+`npm team` always operates directly on the current registry, configurable from
106
+the command line using `--registry=<registry url>`.
107
+
108
+You must be a *team admin* to create teams and manage team membership, under
109
+the given organization. Listing teams and team memberships may be done by
110
+any member of the organization.
111
+
112
+Organization creation and management of team admins and *organization* members
113
+is done through the website, not the npm CLI.
114
+
115
+To use teams to manage permissions on packages belonging to your organization,
116
+use the `npm access` command to grant or revoke the appropriate permissions.
117
+
118
+### Configuration
119
+
120
+#### `registry`
121
+
122
+* Default: "https://registry.npmjs.org/"
123
+* Type: URL
124
+
125
+The base URL of the npm registry.
126
+
127
+
128
+
129
+#### `otp`
130
+
131
+* Default: null
132
+* Type: null or String
133
+
134
+This is a one-time password from a two-factor authenticator. It's needed
135
+when publishing or changing package permissions with `npm access`.
136
+
137
+If not set, and a registry response fails with a challenge for a one-time
138
+password, npm will prompt on the command line for one.
139
+
140
+
141
+
142
+#### `parseable`
143
+
144
+* Default: false
145
+* Type: Boolean
146
+
147
+Output parseable results from commands that write to standard output. For
148
+`npm search`, this will be tab-separated table format.
149
+
150
+
151
+
152
+#### `json`
153
+
154
+* Default: false
155
+* Type: Boolean
156
+
157
+Whether or not to output JSON data, rather than the normal output.
158
+
159
+* In `npm pkg set` it enables parsing set values with JSON.parse() before
160
+ saving them to your `package.json`.
161
+
162
+Not supported by all npm commands.
163
+
164
+
165
+
166
+### See Also
167
+
168
+* [npm access](/cli/v10/commands/npm-access)
169
+* [npm config](/cli/v10/commands/npm-config)
170
+* [npm registry](/cli/v10/using-npm/registry)
content/cli/v10/commands/npm-test.md
new
+85
@@ -0,0 +1,85 @@
1
+---
2
+title: npm-test
3
+section: 1
4
+description: Test a package
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-test.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-test
10
+ - /cli-documentation/v10/cli-commands/test
11
+ - /cli-documentation/v10/commands/npm-test
12
+ - /cli-documentation/v10/commands/test
13
+ - /cli-documentation/v10/npm-test
14
+ - /cli-documentation/v10/test
15
+ - /cli/v10/cli-commands/npm-test
16
+ - /cli/v10/cli-commands/test
17
+ - /cli/v10/commands/test
18
+ - /cli/v10/npm-test
19
+ - /cli/v10/test
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm test [-- <args>]
26
+
27
+aliases: tst, t
28
+```
29
+
30
+### Description
31
+
32
+This runs a predefined command specified in the `"test"` property of
33
+a package's `"scripts"` object.
34
+
35
+### Example
36
+
37
+```json
38
+{
39
+ "scripts": {
40
+ "test": "node test.js"
41
+ }
42
+}
43
+```
44
+
45
+```bash
46
+npm test
47
+> npm@x.x.x test
48
+> node test.js
49
+
50
+(test.js output would be here)
51
+```
52
+
53
+### Configuration
54
+
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
+
68
+
69
+#### `script-shell`
70
+
71
+* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
72
+* Type: null or String
73
+
74
+The shell to use for scripts run with the `npm exec`, `npm run` and `npm
75
+init <package-spec>` commands.
76
+
77
+
78
+
79
+### See Also
80
+
81
+* [npm run-script](/cli/v10/commands/npm-run-script)
82
+* [npm scripts](/cli/v10/using-npm/scripts)
83
+* [npm start](/cli/v10/commands/npm-start)
84
+* [npm restart](/cli/v10/commands/npm-restart)
85
+* [npm stop](/cli/v10/commands/npm-stop)
content/cli/v10/commands/npm-token.md
new
+145
@@ -0,0 +1,145 @@
1
+---
2
+title: npm-token
3
+section: 1
4
+description: Manage your authentication tokens
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-token.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-token
10
+ - /cli-documentation/v10/cli-commands/token
11
+ - /cli-documentation/v10/commands/npm-token
12
+ - /cli-documentation/v10/commands/token
13
+ - /cli-documentation/v10/npm-token
14
+ - /cli-documentation/v10/token
15
+ - /cli/v10/cli-commands/npm-token
16
+ - /cli/v10/cli-commands/token
17
+ - /cli/v10/commands/token
18
+ - /cli/v10/npm-token
19
+ - /cli/v10/token
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm token list
26
+npm token revoke <id|token>
27
+npm token create [--read-only] [--cidr=list]
28
+```
29
+
30
+Note: This command is unaware of workspaces.
31
+
32
+### Description
33
+
34
+This lets you list, create and revoke authentication tokens.
35
+
36
+* `npm token list`:
37
+ Shows a table of all active authentication tokens. You can request
38
+ this as JSON with `--json` or tab-separated values with `--parseable`.
39
+
40
+```bash
41
++--------+---------+------------+----------+----------------+
42
+| id | token | created | read-only | CIDR whitelist |
43
++--------+---------+------------+----------+----------------+
44
+| 7f3134 | 1fa9ba… | 2017-10-02 | yes | |
45
++--------+---------+------------+----------+----------------+
46
+| c03241 | af7aef… | 2017-10-02 | no | 192.168.0.1/24 |
47
++--------+---------+------------+----------+----------------+
48
+| e0cf92 | 3a436a… | 2017-10-02 | no | |
49
++--------+---------+------------+----------+----------------+
50
+| 63eb9d | 74ef35… | 2017-09-28 | no | |
51
++--------+---------+------------+----------+----------------+
52
+| 2daaa8 | cbad5f… | 2017-09-26 | no | |
53
++--------+---------+------------+----------+----------------+
54
+| 68c2fe | 127e51… | 2017-09-23 | no | |
55
++--------+---------+------------+----------+----------------+
56
+| 6334e1 | 1dadd1… | 2017-09-23 | no | |
57
++--------+---------+------------+----------+----------------+
58
+```
59
+
60
+* `npm token create [--read-only] [--cidr=<cidr-ranges>]`:
61
+ Create a new authentication token. It can be `--read-only`, or accept
62
+ a list of
63
+ [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
64
+ ranges with which to limit use of this token. This will prompt you for
65
+ your password, and, if you have two-factor authentication enabled, an
66
+ otp.
67
+
68
+ Currently, the cli can not generate automation tokens. Please refer to
69
+ the [docs
70
+ website](https://docs.npmjs.com/creating-and-viewing-access-tokens)
71
+ for more information on generating automation tokens.
72
+
73
+```bash
74
++----------------+--------------------------------------+
75
+| token | a73c9572-f1b9-8983-983d-ba3ac3cc913d |
76
++----------------+--------------------------------------+
77
+| cidr_whitelist | |
78
++----------------+--------------------------------------+
79
+| readonly | false |
80
++----------------+--------------------------------------+
81
+| created | 2017-10-02T07:52:24.838Z |
82
++----------------+--------------------------------------+
83
+```
84
+
85
+* `npm token revoke <token|id>`:
86
+ Immediately removes an authentication token from the registry. You
87
+ will no longer be able to use it. This can accept both complete
88
+ tokens (such as those you get back from `npm token create`, and those
89
+ found in your `.npmrc`), and ids as seen in the parseable or json
90
+ output of `npm token list`. This will NOT accept the truncated token
91
+ found in the normal `npm token list` output.
92
+
93
+### Configuration
94
+
95
+#### `read-only`
96
+
97
+* Default: false
98
+* Type: Boolean
99
+
100
+This is used to mark a token as unable to publish when configuring limited
101
+access tokens with the `npm token create` command.
102
+
103
+
104
+
105
+#### `cidr`
106
+
107
+* Default: null
108
+* Type: null or String (can be set multiple times)
109
+
110
+This is a list of CIDR address to be used when configuring limited access
111
+tokens with the `npm token create` command.
112
+
113
+
114
+
115
+#### `registry`
116
+
117
+* Default: "https://registry.npmjs.org/"
118
+* Type: URL
119
+
120
+The base URL of the npm registry.
121
+
122
+
123
+
124
+#### `otp`
125
+
126
+* Default: null
127
+* Type: null or String
128
+
129
+This is a one-time password from a two-factor authenticator. It's needed
130
+when publishing or changing package permissions with `npm access`.
131
+
132
+If not set, and a registry response fails with a challenge for a one-time
133
+password, npm will prompt on the command line for one.
134
+
135
+
136
+
137
+### See Also
138
+
139
+* [npm adduser](/cli/v10/commands/npm-adduser)
140
+* [npm registry](/cli/v10/using-npm/registry)
141
+* [npm config](/cli/v10/commands/npm-config)
142
+* [npmrc](/cli/v10/configuring-npm/npmrc)
143
+* [npm owner](/cli/v10/commands/npm-owner)
144
+* [npm whoami](/cli/v10/commands/npm-whoami)
145
+* [npm profile](/cli/v10/commands/npm-profile)
content/cli/v10/commands/npm-uninstall.md
new
+174
@@ -0,0 +1,174 @@
1
+---
2
+title: npm-uninstall
3
+section: 1
4
+description: Remove a package
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-uninstall.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-uninstall
10
+ - /cli-documentation/v10/cli-commands/uninstall
11
+ - /cli-documentation/v10/commands/npm-uninstall
12
+ - /cli-documentation/v10/commands/uninstall
13
+ - /cli-documentation/v10/npm-uninstall
14
+ - /cli-documentation/v10/uninstall
15
+ - /cli/v10/cli-commands/npm-uninstall
16
+ - /cli/v10/cli-commands/uninstall
17
+ - /cli/v10/commands/uninstall
18
+ - /cli/v10/npm-uninstall
19
+ - /cli/v10/uninstall
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm uninstall [<@scope>/]<pkg>...
26
+
27
+aliases: unlink, remove, rm, r, un
28
+```
29
+
30
+### Description
31
+
32
+This uninstalls a package, completely removing everything npm installed
33
+on its behalf.
34
+
35
+It also removes the package from the `dependencies`, `devDependencies`,
36
+`optionalDependencies`, and `peerDependencies` objects in your
37
+`package.json`.
38
+
39
+Further, if you have an `npm-shrinkwrap.json` or `package-lock.json`, npm
40
+will update those files as well.
41
+
42
+`--no-save` will tell npm not to remove the package from your
43
+`package.json`, `npm-shrinkwrap.json`, or `package-lock.json` files.
44
+
45
+`--save` or `-S` will tell npm to remove the package from your
46
+`package.json`, `npm-shrinkwrap.json`, and `package-lock.json` files.
47
+This is the default, but you may need to use this if you have for
48
+instance `save=false` in your `npmrc` file
49
+
50
+In global mode (ie, with `-g` or `--global` appended to the command),
51
+it uninstalls the current package context as a global package.
52
+`--no-save` is ignored in this case.
53
+
54
+Scope is optional and follows the usual rules for [`scope`](/cli/v10/using-npm/scope).
55
+
56
+### Examples
57
+
58
+```bash
59
+npm uninstall sax
60
+```
61
+
62
+`sax` will no longer be in your `package.json`, `npm-shrinkwrap.json`, or
63
+`package-lock.json` files.
64
+
65
+```bash
66
+npm uninstall lodash --no-save
67
+```
68
+
69
+`lodash` will not be removed from your `package.json`,
70
+`npm-shrinkwrap.json`, or `package-lock.json` files.
71
+
72
+### Configuration
73
+
74
+#### `save`
75
+
76
+* Default: `true` unless when using `npm update` where it defaults to `false`
77
+* Type: Boolean
78
+
79
+Save installed packages to a `package.json` file as dependencies.
80
+
81
+When used with the `npm rm` command, removes the dependency from
82
+`package.json`.
83
+
84
+Will also prevent writing to `package-lock.json` if set to `false`.
85
+
86
+
87
+
88
+#### `global`
89
+
90
+* Default: false
91
+* Type: Boolean
92
+
93
+Operates in "global" mode, so that packages are installed into the `prefix`
94
+folder instead of the current working directory. See
95
+[folders](/cli/v10/configuring-npm/folders) for more on the differences in behavior.
96
+
97
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
98
+ of the current working directory.
99
+* bin files are linked to `{prefix}/bin`
100
+* man pages are linked to `{prefix}/share/man`
101
+
102
+
103
+
104
+#### `workspace`
105
+
106
+* Default:
107
+* Type: String (can be set multiple times)
108
+
109
+Enable running a command in the context of the configured workspaces of the
110
+current project while filtering by running only the workspaces defined by
111
+this configuration option.
112
+
113
+Valid values for the `workspace` config are either:
114
+
115
+* Workspace names
116
+* Path to a workspace directory
117
+* Path to a parent workspace directory (will result in selecting all
118
+ workspaces within that folder)
119
+
120
+When set for the `npm init` command, this may be set to the folder of a
121
+workspace which does not yet exist, to create the folder and set it up as a
122
+brand new workspace within the project.
123
+
124
+This value is not exported to the environment for child processes.
125
+
126
+#### `workspaces`
127
+
128
+* Default: null
129
+* Type: null or Boolean
130
+
131
+Set to true to run the command in the context of **all** configured
132
+workspaces.
133
+
134
+Explicitly setting this to false will cause commands like `install` to
135
+ignore workspaces altogether. When not set explicitly:
136
+
137
+- Commands that operate on the `node_modules` tree (install, update, etc.)
138
+will link workspaces into the `node_modules` folder. - Commands that do
139
+other things (test, exec, publish, etc.) will operate on the root project,
140
+_unless_ one or more workspaces are specified in the `workspace` config.
141
+
142
+This value is not exported to the environment for child processes.
143
+
144
+#### `include-workspace-root`
145
+
146
+* Default: false
147
+* Type: Boolean
148
+
149
+Include the workspace root when workspaces are enabled for a command.
150
+
151
+When false, specifying individual workspaces via the `workspace` config, or
152
+all workspaces via the `workspaces` flag, will cause npm to operate only on
153
+the specified workspaces, and not on the root project.
154
+
155
+This value is not exported to the environment for child processes.
156
+
157
+#### `install-links`
158
+
159
+* Default: false
160
+* Type: Boolean
161
+
162
+When set file: protocol dependencies will be packed and installed as regular
163
+dependencies instead of creating a symlink. This option has no effect on
164
+workspaces.
165
+
166
+
167
+
168
+### See Also
169
+
170
+* [npm prune](/cli/v10/commands/npm-prune)
171
+* [npm install](/cli/v10/commands/npm-install)
172
+* [npm folders](/cli/v10/configuring-npm/folders)
173
+* [npm config](/cli/v10/commands/npm-config)
174
+* [npmrc](/cli/v10/configuring-npm/npmrc)
content/cli/v10/commands/npm-unpublish.md
new
+148
@@ -0,0 +1,148 @@
1
+---
2
+title: npm-unpublish
3
+section: 1
4
+description: Remove a package from the registry
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-unpublish.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-unpublish
10
+ - /cli-documentation/v10/cli-commands/unpublish
11
+ - /cli-documentation/v10/commands/npm-unpublish
12
+ - /cli-documentation/v10/commands/unpublish
13
+ - /cli-documentation/v10/npm-unpublish
14
+ - /cli-documentation/v10/unpublish
15
+ - /cli/v10/cli-commands/npm-unpublish
16
+ - /cli/v10/cli-commands/unpublish
17
+ - /cli/v10/commands/unpublish
18
+ - /cli/v10/npm-unpublish
19
+ - /cli/v10/unpublish
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm unpublish [<package-spec>]
26
+```
27
+
28
+To learn more about how the npm registry treats unpublish, see our <a
29
+href="https://docs.npmjs.com/policies/unpublish" target="_blank"
30
+rel="noopener noreferrer"> unpublish policies</a>
31
+
32
+### Warning
33
+
34
+Consider using the [`deprecate`](/cli/v10/commands/npm-deprecate) command instead,
35
+if your intent is to encourage users to upgrade, or if you no longer
36
+want to maintain a package.
37
+
38
+### Description
39
+
40
+This removes a package version from the registry, deleting its entry and
41
+removing the tarball.
42
+
43
+The npm registry will return an error if you are not [logged
44
+in](/cli/v10/commands/npm-adduser).
45
+
46
+If you do not specify a version or if you remove all of a package's
47
+versions then the registry will remove the root package entry entirely.
48
+
49
+Even if you unpublish a package version, that specific name and version
50
+combination can never be reused. In order to publish the package again,
51
+you must use a new version number. If you unpublish the entire package,
52
+you may not publish any new versions of that package until 24 hours have
53
+passed.
54
+
55
+### Configuration
56
+
57
+#### `dry-run`
58
+
59
+* Default: false
60
+* Type: Boolean
61
+
62
+Indicates that you don't want npm to make any changes and that it should
63
+only report what it would have done. This can be passed into any of the
64
+commands that modify your local installation, eg, `install`, `update`,
65
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
66
+
67
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
68
+`owner`, etc.
69
+
70
+
71
+
72
+#### `force`
73
+
74
+* Default: false
75
+* Type: Boolean
76
+
77
+Removes various protections against unfortunate side effects, common
78
+mistakes, unnecessary performance degradation, and malicious input.
79
+
80
+* Allow clobbering non-npm files in global installs.
81
+* Allow the `npm version` command to work on an unclean git repository.
82
+* Allow deleting the cache folder with `npm cache clean`.
83
+* Allow installing packages that have an `engines` declaration requiring a
84
+ different version of npm.
85
+* Allow installing packages that have an `engines` declaration requiring a
86
+ different version of `node`, even if `--engine-strict` is enabled.
87
+* Allow `npm audit fix` to install modules outside your stated dependency
88
+ range (including SemVer-major changes).
89
+* Allow unpublishing all versions of a published package.
90
+* Allow conflicting peerDependencies to be installed in the root project.
91
+* Implicitly set `--yes` during `npm init`.
92
+* Allow clobbering existing values in `npm pkg`
93
+* Allow unpublishing of entire packages (not just a single version).
94
+
95
+If you don't have a clear idea of what you want to do, it is strongly
96
+recommended that you do not use this option!
97
+
98
+
99
+
100
+#### `workspace`
101
+
102
+* Default:
103
+* Type: String (can be set multiple times)
104
+
105
+Enable running a command in the context of the configured workspaces of the
106
+current project while filtering by running only the workspaces defined by
107
+this configuration option.
108
+
109
+Valid values for the `workspace` config are either:
110
+
111
+* Workspace names
112
+* Path to a workspace directory
113
+* Path to a parent workspace directory (will result in selecting all
114
+ workspaces within that folder)
115
+
116
+When set for the `npm init` command, this may be set to the folder of a
117
+workspace which does not yet exist, to create the folder and set it up as a
118
+brand new workspace within the project.
119
+
120
+This value is not exported to the environment for child processes.
121
+
122
+#### `workspaces`
123
+
124
+* Default: null
125
+* Type: null or Boolean
126
+
127
+Set to true to run the command in the context of **all** configured
128
+workspaces.
129
+
130
+Explicitly setting this to false will cause commands like `install` to
131
+ignore workspaces altogether. When not set explicitly:
132
+
133
+- Commands that operate on the `node_modules` tree (install, update, etc.)
134
+will link workspaces into the `node_modules` folder. - Commands that do
135
+other things (test, exec, publish, etc.) will operate on the root project,
136
+_unless_ one or more workspaces are specified in the `workspace` config.
137
+
138
+This value is not exported to the environment for child processes.
139
+
140
+### See Also
141
+
142
+* [package spec](/cli/v10/using-npm/package-spec)
143
+* [npm deprecate](/cli/v10/commands/npm-deprecate)
144
+* [npm publish](/cli/v10/commands/npm-publish)
145
+* [npm registry](/cli/v10/using-npm/registry)
146
+* [npm adduser](/cli/v10/commands/npm-adduser)
147
+* [npm owner](/cli/v10/commands/npm-owner)
148
+* [npm login](/cli/v10/commands/npm-adduser)
content/cli/v10/commands/npm-unstar.md
new
+89
@@ -0,0 +1,89 @@
1
+---
2
+title: npm-unstar
3
+section: 1
4
+description: Remove an item from your favorite packages
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-unstar.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-unstar
10
+ - /cli-documentation/v10/cli-commands/unstar
11
+ - /cli-documentation/v10/commands/npm-unstar
12
+ - /cli-documentation/v10/commands/unstar
13
+ - /cli-documentation/v10/npm-unstar
14
+ - /cli-documentation/v10/unstar
15
+ - /cli/v10/cli-commands/npm-unstar
16
+ - /cli/v10/cli-commands/unstar
17
+ - /cli/v10/commands/unstar
18
+ - /cli/v10/npm-unstar
19
+ - /cli/v10/unstar
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm unstar [<package-spec>...]
26
+```
27
+
28
+Note: This command is unaware of workspaces.
29
+
30
+### Description
31
+
32
+"Unstarring" a package is the opposite of [`npm star`](/cli/v10/commands/npm-star),
33
+it removes an item from your list of favorite packages.
34
+
35
+### More
36
+
37
+There's also these extra commands to help you manage your favorite packages:
38
+
39
+#### Star
40
+
41
+You can "star" a package using [`npm star`](/cli/v10/commands/npm-star)
42
+
43
+#### Listing stars
44
+
45
+You can see all your starred packages using [`npm stars`](/cli/v10/commands/npm-stars)
46
+
47
+### Configuration
48
+
49
+#### `registry`
50
+
51
+* Default: "https://registry.npmjs.org/"
52
+* Type: URL
53
+
54
+The base URL of the npm registry.
55
+
56
+
57
+
58
+#### `unicode`
59
+
60
+* Default: false on windows, true on mac/unix systems with a unicode locale,
61
+ as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables.
62
+* Type: Boolean
63
+
64
+When set to true, npm uses unicode characters in the tree output. When
65
+false, it uses ascii characters instead of unicode glyphs.
66
+
67
+
68
+
69
+#### `otp`
70
+
71
+* Default: null
72
+* Type: null or String
73
+
74
+This is a one-time password from a two-factor authenticator. It's needed
75
+when publishing or changing package permissions with `npm access`.
76
+
77
+If not set, and a registry response fails with a challenge for a one-time
78
+password, npm will prompt on the command line for one.
79
+
80
+
81
+
82
+### See Also
83
+
84
+* [npm star](/cli/v10/commands/npm-star)
85
+* [npm stars](/cli/v10/commands/npm-stars)
86
+* [npm view](/cli/v10/commands/npm-view)
87
+* [npm whoami](/cli/v10/commands/npm-whoami)
88
+* [npm adduser](/cli/v10/commands/npm-adduser)
89
+
content/cli/v10/commands/npm-update.md
new
+447
@@ -0,0 +1,447 @@
1
+---
2
+title: npm-update
3
+section: 1
4
+description: Update packages
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-update.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-update
10
+ - /cli-documentation/v10/cli-commands/update
11
+ - /cli-documentation/v10/commands/npm-update
12
+ - /cli-documentation/v10/commands/update
13
+ - /cli-documentation/v10/npm-update
14
+ - /cli-documentation/v10/update
15
+ - /cli/v10/cli-commands/npm-update
16
+ - /cli/v10/cli-commands/update
17
+ - /cli/v10/commands/update
18
+ - /cli/v10/npm-update
19
+ - /cli/v10/update
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm update [<pkg>...]
26
+
27
+aliases: up, upgrade, udpate
28
+```
29
+
30
+### Description
31
+
32
+This command will update all the packages listed to the latest version
33
+(specified by the [`tag` config](/cli/v10/using-npm/config#tag)), respecting the semver
34
+constraints of both your package and its dependencies (if they also require the
35
+same package).
36
+
37
+It will also install missing packages.
38
+
39
+If the `-g` flag is specified, this command will update globally installed
40
+packages.
41
+
42
+If no package name is specified, all packages in the specified location (global
43
+or local) will be updated.
44
+
45
+Note that by default `npm update` will not update the semver values of direct
46
+dependencies in your project `package.json`, if you want to also update
47
+values in `package.json` you can run: `npm update --save` (or add the
48
+`save=true` option to a [configuration file](/cli/v10/configuring-npm/npmrc)
49
+to make that the default behavior).
50
+
51
+### Example
52
+
53
+For the examples below, assume that the current package is `app` and it depends
54
+on dependencies, `dep1` (`dep2`, .. etc.). The published versions of `dep1`
55
+are:
56
+
57
+```json
58
+{
59
+ "dist-tags": { "latest": "1.2.2" },
60
+ "versions": [
61
+ "1.2.2",
62
+ "1.2.1",
63
+ "1.2.0",
64
+ "1.1.2",
65
+ "1.1.1",
66
+ "1.0.0",
67
+ "0.4.1",
68
+ "0.4.0",
69
+ "0.2.0"
70
+ ]
71
+}
72
+```
73
+
74
+#### Caret Dependencies
75
+
76
+If `app`'s `package.json` contains:
77
+
78
+```json
79
+"dependencies": {
80
+ "dep1": "^1.1.1"
81
+}
82
+```
83
+
84
+Then `npm update` will install `dep1@1.2.2`, because `1.2.2` is `latest` and
85
+`1.2.2` satisfies `^1.1.1`.
86
+
87
+#### Tilde Dependencies
88
+
89
+However, if `app`'s `package.json` contains:
90
+
91
+```json
92
+"dependencies": {
93
+ "dep1": "~1.1.1"
94
+}
95
+```
96
+
97
+In this case, running `npm update` will install `dep1@1.1.2`. Even though the
98
+`latest` tag points to `1.2.2`, this version do not satisfy `~1.1.1`, which is
99
+equivalent to `>=1.1.1 <1.2.0`. So the highest-sorting version that satisfies
100
+`~1.1.1` is used, which is `1.1.2`.
101
+
102
+#### Caret Dependencies below 1.0.0
103
+
104
+Suppose `app` has a caret dependency on a version below `1.0.0`, for example:
105
+
106
+```json
107
+"dependencies": {
108
+ "dep1": "^0.2.0"
109
+}
110
+```
111
+
112
+`npm update` will install `dep1@0.2.0`, because there are no other
113
+versions which satisfy `^0.2.0`.
114
+
115
+If the dependence were on `^0.4.0`:
116
+
117
+```json
118
+"dependencies": {
119
+ "dep1": "^0.4.0"
120
+}
121
+```
122
+
123
+Then `npm update` will install `dep1@0.4.1`, because that is the highest-sorting
124
+version that satisfies `^0.4.0` (`>= 0.4.0 <0.5.0`)
125
+
126
+
127
+#### Subdependencies
128
+
129
+Suppose your app now also has a dependency on `dep2`
130
+
131
+```json
132
+{
133
+ "name": "my-app",
134
+ "dependencies": {
135
+ "dep1": "^1.0.0",
136
+ "dep2": "1.0.0"
137
+ }
138
+}
139
+```
140
+
141
+and `dep2` itself depends on this limited range of `dep1`
142
+
143
+```json
144
+{
145
+"name": "dep2",
146
+ "dependencies": {
147
+ "dep1": "~1.1.1"
148
+ }
149
+}
150
+```
151
+
152
+Then `npm update` will install `dep1@1.1.2` because that is the highest
153
+version that `dep2` allows. npm will prioritize having a single version
154
+of `dep1` in your tree rather than two when that single version can
155
+satisfy the semver requirements of multiple dependencies in your tree.
156
+In this case if you really did need your package to use a newer version
157
+you would need to use `npm install`.
158
+
159
+
160
+#### Updating Globally-Installed Packages
161
+
162
+`npm update -g` will apply the `update` action to each globally installed
163
+package that is `outdated` -- that is, has a version that is different from
164
+`wanted`.
165
+
166
+Note: Globally installed packages are treated as if they are installed with a
167
+caret semver range specified. So if you require to update to `latest` you may
168
+need to run `npm install -g [<pkg>...]`
169
+
170
+NOTE: If a package has been upgraded to a version newer than `latest`, it will
171
+be _downgraded_.
172
+
173
+### Configuration
174
+
175
+#### `save`
176
+
177
+* Default: `true` unless when using `npm update` where it defaults to `false`
178
+* Type: Boolean
179
+
180
+Save installed packages to a `package.json` file as dependencies.
181
+
182
+When used with the `npm rm` command, removes the dependency from
183
+`package.json`.
184
+
185
+Will also prevent writing to `package-lock.json` if set to `false`.
186
+
187
+
188
+
189
+#### `global`
190
+
191
+* Default: false
192
+* Type: Boolean
193
+
194
+Operates in "global" mode, so that packages are installed into the `prefix`
195
+folder instead of the current working directory. See
196
+[folders](/cli/v10/configuring-npm/folders) for more on the differences in behavior.
197
+
198
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
199
+ of the current working directory.
200
+* bin files are linked to `{prefix}/bin`
201
+* man pages are linked to `{prefix}/share/man`
202
+
203
+
204
+
205
+#### `install-strategy`
206
+
207
+* Default: "hoisted"
208
+* Type: "hoisted", "nested", "shallow", or "linked"
209
+
210
+Sets the strategy for installing packages in node_modules. hoisted
211
+(default): Install non-duplicated in top-level, and duplicated as necessary
212
+within directory structure. nested: (formerly --legacy-bundling) install in
213
+place, no hoisting. shallow (formerly --global-style) only install direct
214
+deps at top-level. linked: (experimental) install in node_modules/.store,
215
+link in place, unhoisted.
216
+
217
+
218
+
219
+#### `legacy-bundling`
220
+
221
+* Default: false
222
+* Type: Boolean
223
+* DEPRECATED: This option has been deprecated in favor of
224
+ `--install-strategy=nested`
225
+
226
+Instead of hoisting package installs in `node_modules`, install packages in
227
+the same manner that they are depended on. This may cause very deep
228
+directory structures and duplicate package installs as there is no
229
+de-duplicating. Sets `--install-strategy=nested`.
230
+
231
+
232
+
233
+#### `global-style`
234
+
235
+* Default: false
236
+* Type: Boolean
237
+* DEPRECATED: This option has been deprecated in favor of
238
+ `--install-strategy=shallow`
239
+
240
+Only install direct dependencies in the top level `node_modules`, but hoist
241
+on deeper dependencies. Sets `--install-strategy=shallow`.
242
+
243
+
244
+
245
+#### `omit`
246
+
247
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
248
+ 'production', otherwise empty.
249
+* Type: "dev", "optional", or "peer" (can be set multiple times)
250
+
251
+Dependency types to omit from the installation tree on disk.
252
+
253
+Note that these dependencies _are_ still resolved and added to the
254
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
255
+physically installed on disk.
256
+
257
+If a package type appears in both the `--include` and `--omit` lists, then
258
+it will be included.
259
+
260
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
261
+variable will be set to `'production'` for all lifecycle scripts.
262
+
263
+
264
+
265
+#### `strict-peer-deps`
266
+
267
+* Default: false
268
+* Type: Boolean
269
+
270
+If set to `true`, and `--legacy-peer-deps` is not set, then _any_
271
+conflicting `peerDependencies` will be treated as an install failure, even
272
+if npm could reasonably guess the appropriate resolution based on non-peer
273
+dependency relationships.
274
+
275
+By default, conflicting `peerDependencies` deep in the dependency graph will
276
+be resolved using the nearest non-peer dependency specification, even if
277
+doing so will result in some packages receiving a peer dependency outside
278
+the range set in their package's `peerDependencies` object.
279
+
280
+When such an override is performed, a warning is printed, explaining the
281
+conflict and the packages involved. If `--strict-peer-deps` is set, then
282
+this warning is treated as a failure.
283
+
284
+
285
+
286
+#### `package-lock`
287
+
288
+* Default: true
289
+* Type: Boolean
290
+
291
+If set to false, then ignore `package-lock.json` files when installing. This
292
+will also prevent _writing_ `package-lock.json` if `save` is true.
293
+
294
+
295
+
296
+#### `foreground-scripts`
297
+
298
+* Default: false
299
+* Type: Boolean
300
+
301
+Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)
302
+scripts for installed packages in the foreground process, sharing standard
303
+input, output, and error with the main npm process.
304
+
305
+Note that this will generally make installs run slower, and be much noisier,
306
+but can be useful for debugging.
307
+
308
+
309
+
310
+#### `ignore-scripts`
311
+
312
+* Default: false
313
+* Type: Boolean
314
+
315
+If true, npm does not run scripts specified in package.json files.
316
+
317
+Note that commands explicitly intended to run a particular script, such as
318
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
319
+will still run their intended script if `ignore-scripts` is set, but they
320
+will *not* run any pre- or post-scripts.
321
+
322
+
323
+
324
+#### `audit`
325
+
326
+* Default: true
327
+* Type: Boolean
328
+
329
+When "true" submit audit reports alongside the current npm command to the
330
+default registry and all registries configured for scopes. See the
331
+documentation for [`npm audit`](/cli/v10/commands/npm-audit) for details on what is
332
+submitted.
333
+
334
+
335
+
336
+#### `bin-links`
337
+
338
+* Default: true
339
+* Type: Boolean
340
+
341
+Tells npm to create symlinks (or `.cmd` shims on Windows) for package
342
+executables.
343
+
344
+Set to false to have it not do this. This can be used to work around the
345
+fact that some file systems don't support symlinks, even on ostensibly Unix
346
+systems.
347
+
348
+
349
+
350
+#### `fund`
351
+
352
+* Default: true
353
+* Type: Boolean
354
+
355
+When "true" displays the message at the end of each `npm install`
356
+acknowledging the number of dependencies looking for funding. See [`npm
357
+fund`](/cli/v10/commands/npm-fund) for details.
358
+
359
+
360
+
361
+#### `dry-run`
362
+
363
+* Default: false
364
+* Type: Boolean
365
+
366
+Indicates that you don't want npm to make any changes and that it should
367
+only report what it would have done. This can be passed into any of the
368
+commands that modify your local installation, eg, `install`, `update`,
369
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
370
+
371
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
372
+`owner`, etc.
373
+
374
+
375
+
376
+#### `workspace`
377
+
378
+* Default:
379
+* Type: String (can be set multiple times)
380
+
381
+Enable running a command in the context of the configured workspaces of the
382
+current project while filtering by running only the workspaces defined by
383
+this configuration option.
384
+
385
+Valid values for the `workspace` config are either:
386
+
387
+* Workspace names
388
+* Path to a workspace directory
389
+* Path to a parent workspace directory (will result in selecting all
390
+ workspaces within that folder)
391
+
392
+When set for the `npm init` command, this may be set to the folder of a
393
+workspace which does not yet exist, to create the folder and set it up as a
394
+brand new workspace within the project.
395
+
396
+This value is not exported to the environment for child processes.
397
+
398
+#### `workspaces`
399
+
400
+* Default: null
401
+* Type: null or Boolean
402
+
403
+Set to true to run the command in the context of **all** configured
404
+workspaces.
405
+
406
+Explicitly setting this to false will cause commands like `install` to
407
+ignore workspaces altogether. When not set explicitly:
408
+
409
+- Commands that operate on the `node_modules` tree (install, update, etc.)
410
+will link workspaces into the `node_modules` folder. - Commands that do
411
+other things (test, exec, publish, etc.) will operate on the root project,
412
+_unless_ one or more workspaces are specified in the `workspace` config.
413
+
414
+This value is not exported to the environment for child processes.
415
+
416
+#### `include-workspace-root`
417
+
418
+* Default: false
419
+* Type: Boolean
420
+
421
+Include the workspace root when workspaces are enabled for a command.
422
+
423
+When false, specifying individual workspaces via the `workspace` config, or
424
+all workspaces via the `workspaces` flag, will cause npm to operate only on
425
+the specified workspaces, and not on the root project.
426
+
427
+This value is not exported to the environment for child processes.
428
+
429
+#### `install-links`
430
+
431
+* Default: false
432
+* Type: Boolean
433
+
434
+When set file: protocol dependencies will be packed and installed as regular
435
+dependencies instead of creating a symlink. This option has no effect on
436
+workspaces.
437
+
438
+
439
+
440
+### See Also
441
+
442
+* [npm install](/cli/v10/commands/npm-install)
443
+* [npm outdated](/cli/v10/commands/npm-outdated)
444
+* [npm shrinkwrap](/cli/v10/commands/npm-shrinkwrap)
445
+* [npm registry](/cli/v10/using-npm/registry)
446
+* [npm folders](/cli/v10/configuring-npm/folders)
447
+* [npm ls](/cli/v10/commands/npm-ls)
content/cli/v10/commands/npm-version.md
new
+250
@@ -0,0 +1,250 @@
1
+---
2
+title: npm-version
3
+section: 1
4
+description: Bump a package version
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-version.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-version
10
+ - /cli-documentation/v10/cli-commands/version
11
+ - /cli-documentation/v10/commands/npm-version
12
+ - /cli-documentation/v10/commands/version
13
+ - /cli-documentation/v10/npm-version
14
+ - /cli-documentation/v10/version
15
+ - /cli/v10/cli-commands/npm-version
16
+ - /cli/v10/cli-commands/version
17
+ - /cli/v10/commands/version
18
+ - /cli/v10/npm-version
19
+ - /cli/v10/version
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git]
26
+
27
+alias: verison
28
+```
29
+
30
+### Configuration
31
+
32
+#### `allow-same-version`
33
+
34
+* Default: false
35
+* Type: Boolean
36
+
37
+Prevents throwing an error when `npm version` is used to set the new version
38
+to the same value as the current version.
39
+
40
+
41
+
42
+#### `commit-hooks`
43
+
44
+* Default: true
45
+* Type: Boolean
46
+
47
+Run git commit hooks when using the `npm version` command.
48
+
49
+
50
+
51
+#### `git-tag-version`
52
+
53
+* Default: true
54
+* Type: Boolean
55
+
56
+Tag the commit when using the `npm version` command. Setting this to false
57
+results in no commit being made at all.
58
+
59
+
60
+
61
+#### `json`
62
+
63
+* Default: false
64
+* Type: Boolean
65
+
66
+Whether or not to output JSON data, rather than the normal output.
67
+
68
+* In `npm pkg set` it enables parsing set values with JSON.parse() before
69
+ saving them to your `package.json`.
70
+
71
+Not supported by all npm commands.
72
+
73
+
74
+
75
+#### `preid`
76
+
77
+* Default: ""
78
+* Type: String
79
+
80
+The "prerelease identifier" to use as a prefix for the "prerelease" part of
81
+a semver. Like the `rc` in `1.2.0-rc.8`.
82
+
83
+
84
+
85
+#### `sign-git-tag`
86
+
87
+* Default: false
88
+* Type: Boolean
89
+
90
+If set to true, then the `npm version` command will tag the version using
91
+`-s` to add a signature.
92
+
93
+Note that git requires you to have set up GPG keys in your git configs for
94
+this to work properly.
95
+
96
+
97
+
98
+#### `workspace`
99
+
100
+* Default:
101
+* Type: String (can be set multiple times)
102
+
103
+Enable running a command in the context of the configured workspaces of the
104
+current project while filtering by running only the workspaces defined by
105
+this configuration option.
106
+
107
+Valid values for the `workspace` config are either:
108
+
109
+* Workspace names
110
+* Path to a workspace directory
111
+* Path to a parent workspace directory (will result in selecting all
112
+ workspaces within that folder)
113
+
114
+When set for the `npm init` command, this may be set to the folder of a
115
+workspace which does not yet exist, to create the folder and set it up as a
116
+brand new workspace within the project.
117
+
118
+This value is not exported to the environment for child processes.
119
+
120
+#### `workspaces`
121
+
122
+* Default: null
123
+* Type: null or Boolean
124
+
125
+Set to true to run the command in the context of **all** configured
126
+workspaces.
127
+
128
+Explicitly setting this to false will cause commands like `install` to
129
+ignore workspaces altogether. When not set explicitly:
130
+
131
+- Commands that operate on the `node_modules` tree (install, update, etc.)
132
+will link workspaces into the `node_modules` folder. - Commands that do
133
+other things (test, exec, publish, etc.) will operate on the root project,
134
+_unless_ one or more workspaces are specified in the `workspace` config.
135
+
136
+This value is not exported to the environment for child processes.
137
+
138
+#### `workspaces-update`
139
+
140
+* Default: true
141
+* Type: Boolean
142
+
143
+If set to true, the npm cli will run an update after operations that may
144
+possibly change the workspaces installed to the `node_modules` folder.
145
+
146
+
147
+
148
+#### `include-workspace-root`
149
+
150
+* Default: false
151
+* Type: Boolean
152
+
153
+Include the workspace root when workspaces are enabled for a command.
154
+
155
+When false, specifying individual workspaces via the `workspace` config, or
156
+all workspaces via the `workspaces` flag, will cause npm to operate only on
157
+the specified workspaces, and not on the root project.
158
+
159
+This value is not exported to the environment for child processes.
160
+
161
+### Description
162
+
163
+Run this in a package directory to bump the version and write the new data
164
+back to `package.json`, `package-lock.json`, and, if present,
165
+`npm-shrinkwrap.json`.
166
+
167
+The `newversion` argument should be a valid semver string, a valid second
168
+argument to [semver.inc](https://github.com/npm/node-semver#functions) (one
169
+of `patch`, `minor`, `major`, `prepatch`, `preminor`, `premajor`,
170
+`prerelease`), or `from-git`. In the second case, the existing version will
171
+be incremented by 1 in the specified field. `from-git` will try to read
172
+the latest git tag, and use that as the new npm version.
173
+
174
+If run in a git repo, it will also create a version commit and tag. This
175
+behavior is controlled by `git-tag-version` (see below), and can be
176
+disabled on the command line by running `npm --no-git-tag-version version`.
177
+It will fail if the working directory is not clean, unless the `-f` or
178
+`--force` flag is set.
179
+
180
+If supplied with `-m` or [`--message` config](/cli/v10/using-npm/config#message) option,
181
+npm will use it as a commit message when creating a version commit. If the
182
+`message` config contains `%s` then that will be replaced with the resulting
183
+version number. For example:
184
+
185
+```bash
186
+npm version patch -m "Upgrade to %s for reasons"
187
+```
188
+
189
+If the [`sign-git-tag` config](/cli/v10/using-npm/config#sign-git-tag) is set, then the
190
+tag will be signed using the `-s` flag to git. Note that you must have a default
191
+GPG key set up in your git config for this to work properly. For example:
192
+
193
+```bash
194
+$ npm config set sign-git-tag true
195
+$ npm version patch
196
+
197
+You need a passphrase to unlock the secret key for
198
+user: "isaacs (http://blog.izs.me/) <i@izs.me>"
199
+2048-bit RSA key, ID 6C481CF6, created 2010-08-31
200
+
201
+Enter passphrase:
202
+```
203
+
204
+If `preversion`, `version`, or `postversion` are in the `scripts` property
205
+of the package.json, they will be executed as part of running `npm
206
+version`.
207
+
208
+The exact order of execution is as follows:
209
+
210
+1. Check to make sure the git working directory is clean before we get
211
+ started. Your scripts may add files to the commit in future steps.
212
+ This step is skipped if the `--force` flag is set.
213
+2. Run the `preversion` script. These scripts have access to the old
214
+ `version` in package.json. A typical use would be running your full
215
+ test suite before deploying. Any files you want added to the commit
216
+ should be explicitly added using `git add`.
217
+3. Bump `version` in `package.json` as requested (`patch`, `minor`,
218
+ `major`, etc).
219
+4. Run the `version` script. These scripts have access to the new `version`
220
+ in package.json (so they can incorporate it into file headers in
221
+ generated files for example). Again, scripts should explicitly add
222
+ generated files to the commit using `git add`.
223
+5. Commit and tag.
224
+6. Run the `postversion` script. Use it to clean up the file system or
225
+ automatically push the commit and/or tag.
226
+
227
+Take the following example:
228
+
229
+```json
230
+{
231
+ "scripts": {
232
+ "preversion": "npm test",
233
+ "version": "npm run build && git add -A dist",
234
+ "postversion": "git push && git push --tags && rm -rf build/temp"
235
+ }
236
+}
237
+```
238
+
239
+This runs all your tests and proceeds only if they pass. Then runs your
240
+`build` script, and adds everything in the `dist` directory to the commit.
241
+After the commit, it pushes the new commit and tag up to the server, and
242
+deletes the `build/temp` directory.
243
+
244
+### See Also
245
+
246
+* [npm init](/cli/v10/commands/npm-init)
247
+* [npm run-script](/cli/v10/commands/npm-run-script)
248
+* [npm scripts](/cli/v10/using-npm/scripts)
249
+* [package.json](/cli/v10/configuring-npm/package-json)
250
+* [config](/cli/v10/using-npm/config)
content/cli/v10/commands/npm-view.md
new
+208
@@ -0,0 +1,208 @@
1
+---
2
+title: npm-view
3
+section: 1
4
+description: View registry info
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-view.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-view
10
+ - /cli-documentation/v10/cli-commands/view
11
+ - /cli-documentation/v10/commands/npm-view
12
+ - /cli-documentation/v10/commands/view
13
+ - /cli-documentation/v10/npm-view
14
+ - /cli-documentation/v10/view
15
+ - /cli/v10/cli-commands/npm-view
16
+ - /cli/v10/cli-commands/view
17
+ - /cli/v10/commands/view
18
+ - /cli/v10/npm-view
19
+ - /cli/v10/view
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm view [<package-spec>] [<field>[.subfield]...]
26
+
27
+aliases: info, show, v
28
+```
29
+
30
+### Description
31
+
32
+This command shows data about a package and prints it to stdout.
33
+
34
+As an example, to view information about the `connect` package from the registry, you would run:
35
+
36
+```bash
37
+npm view connect
38
+```
39
+
40
+The default version is `"latest"` if unspecified.
41
+
42
+Field names can be specified after the package descriptor.
43
+For example, to show the dependencies of the `ronn` package at version
44
+`0.3.5`, you could do the following:
45
+
46
+```bash
47
+npm view ronn@0.3.5 dependencies
48
+```
49
+
50
+You can view child fields by separating them with a period.
51
+To view the git repository URL for the latest version of `npm`, you would run the following command:
52
+
53
+```bash
54
+npm view npm repository.url
55
+```
56
+
57
+This makes it easy to view information about a dependency with a bit of
58
+shell scripting. For example, to view all the data about the version of
59
+`opts` that `ronn` depends on, you could write the following:
60
+
61
+```bash
62
+npm view opts@$(npm view ronn dependencies.opts)
63
+```
64
+
65
+For fields that are arrays, requesting a non-numeric field will return
66
+all of the values from the objects in the list. For example, to get all
67
+the contributor email addresses for the `express` package, you would run:
68
+
69
+```bash
70
+npm view express contributors.email
71
+```
72
+
73
+You may also use numeric indices in square braces to specifically select
74
+an item in an array field. To just get the email address of the first
75
+contributor in the list, you can run:
76
+
77
+```bash
78
+npm view express contributors[0].email
79
+```
80
+
81
+If the field value you are querying for is a property of an object, you should run:
82
+
83
+```bash
84
+npm view express time'[4.8.0]'
85
+```
86
+
87
+Multiple fields may be specified, and will be printed one after another.
88
+For example, to get all the contributor names and email addresses, you
89
+can do this:
90
+
91
+```bash
92
+npm view express contributors.name contributors.email
93
+```
94
+
95
+"Person" fields are shown as a string if they would be shown as an
96
+object. So, for example, this will show the list of `npm` contributors in
97
+the shortened string format. (See [`package.json`](/cli/v10/configuring-npm/package-json) for more on this.)
98
+
99
+```bash
100
+npm view npm contributors
101
+```
102
+
103
+If a version range is provided, then data will be printed for every
104
+matching version of the package. This will show which version of `jsdom`
105
+was required by each matching version of `yui3`:
106
+
107
+```bash
108
+npm view yui3@'>0.5.4' dependencies.jsdom
109
+```
110
+
111
+To show the `connect` package version history, you can do
112
+this:
113
+
114
+```bash
115
+npm view connect versions
116
+```
117
+
118
+### Configuration
119
+
120
+#### `json`
121
+
122
+* Default: false
123
+* Type: Boolean
124
+
125
+Whether or not to output JSON data, rather than the normal output.
126
+
127
+* In `npm pkg set` it enables parsing set values with JSON.parse() before
128
+ saving them to your `package.json`.
129
+
130
+Not supported by all npm commands.
131
+
132
+
133
+
134
+#### `workspace`
135
+
136
+* Default:
137
+* Type: String (can be set multiple times)
138
+
139
+Enable running a command in the context of the configured workspaces of the
140
+current project while filtering by running only the workspaces defined by
141
+this configuration option.
142
+
143
+Valid values for the `workspace` config are either:
144
+
145
+* Workspace names
146
+* Path to a workspace directory
147
+* Path to a parent workspace directory (will result in selecting all
148
+ workspaces within that folder)
149
+
150
+When set for the `npm init` command, this may be set to the folder of a
151
+workspace which does not yet exist, to create the folder and set it up as a
152
+brand new workspace within the project.
153
+
154
+This value is not exported to the environment for child processes.
155
+
156
+#### `workspaces`
157
+
158
+* Default: null
159
+* Type: null or Boolean
160
+
161
+Set to true to run the command in the context of **all** configured
162
+workspaces.
163
+
164
+Explicitly setting this to false will cause commands like `install` to
165
+ignore workspaces altogether. When not set explicitly:
166
+
167
+- Commands that operate on the `node_modules` tree (install, update, etc.)
168
+will link workspaces into the `node_modules` folder. - Commands that do
169
+other things (test, exec, publish, etc.) will operate on the root project,
170
+_unless_ one or more workspaces are specified in the `workspace` config.
171
+
172
+This value is not exported to the environment for child processes.
173
+
174
+#### `include-workspace-root`
175
+
176
+* Default: false
177
+* Type: Boolean
178
+
179
+Include the workspace root when workspaces are enabled for a command.
180
+
181
+When false, specifying individual workspaces via the `workspace` config, or
182
+all workspaces via the `workspaces` flag, will cause npm to operate only on
183
+the specified workspaces, and not on the root project.
184
+
185
+This value is not exported to the environment for child processes.
186
+
187
+### Output
188
+
189
+If only a single string field for a single version is output, then it
190
+will not be colorized or quoted, to enable piping the output to
191
+another command. If the field is an object, it will be output as a JavaScript object literal.
192
+
193
+If the `--json` flag is given, the outputted fields will be JSON.
194
+
195
+If the version range matches multiple versions then each printed value
196
+will be prefixed with the version it applies to.
197
+
198
+If multiple fields are requested, then each of them is prefixed with
199
+the field name.
200
+
201
+### See Also
202
+
203
+* [package spec](/cli/v10/using-npm/package-spec)
204
+* [npm search](/cli/v10/commands/npm-search)
205
+* [npm registry](/cli/v10/using-npm/registry)
206
+* [npm config](/cli/v10/commands/npm-config)
207
+* [npmrc](/cli/v10/configuring-npm/npmrc)
208
+* [npm docs](/cli/v10/commands/npm-docs)
content/cli/v10/commands/npm-whoami.md
new
+56
@@ -0,0 +1,56 @@
1
+---
2
+title: npm-whoami
3
+section: 1
4
+description: Display npm username
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm-whoami.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm-whoami
10
+ - /cli-documentation/v10/cli-commands/whoami
11
+ - /cli-documentation/v10/commands/npm-whoami
12
+ - /cli-documentation/v10/commands/whoami
13
+ - /cli-documentation/v10/npm-whoami
14
+ - /cli-documentation/v10/whoami
15
+ - /cli/v10/cli-commands/npm-whoami
16
+ - /cli/v10/cli-commands/whoami
17
+ - /cli/v10/commands/whoami
18
+ - /cli/v10/npm-whoami
19
+ - /cli/v10/whoami
20
+---
21
+
22
+### Synopsis
23
+
24
+```bash
25
+npm whoami
26
+```
27
+
28
+Note: This command is unaware of workspaces.
29
+
30
+### Description
31
+
32
+Display the npm username of the currently logged-in user.
33
+
34
+If logged into a registry that provides token-based authentication, then
35
+connect to the `/-/whoami` registry endpoint to find the username
36
+associated with the token, and print to standard output.
37
+
38
+If logged into a registry that uses Basic Auth, then simply print the
39
+`username` portion of the authentication string.
40
+
41
+### Configuration
42
+
43
+#### `registry`
44
+
45
+* Default: "https://registry.npmjs.org/"
46
+* Type: URL
47
+
48
+The base URL of the npm registry.
49
+
50
+
51
+
52
+### See Also
53
+
54
+* [npm config](/cli/v10/commands/npm-config)
55
+* [npmrc](/cli/v10/configuring-npm/npmrc)
56
+* [npm adduser](/cli/v10/commands/npm-adduser)
content/cli/v10/commands/npm.md
new
+184
@@ -0,0 +1,184 @@
1
+---
2
+title: npm
3
+section: 1
4
+description: javascript package manager
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npm.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npm
10
+ - /cli-documentation/v10/commands/npm
11
+ - /cli-documentation/v10/npm
12
+ - /cli/v10/cli-commands/npm
13
+ - /cli/v10/npm
14
+---
15
+
16
+### Synopsis
17
+
18
+```bash
19
+npm
20
+```
21
+
22
+Note: This command is unaware of workspaces.
23
+
24
+### Version
25
+
26
+10.0.0
27
+
28
+### Description
29
+
30
+npm is the package manager for the Node JavaScript platform. It puts
31
+modules in place so that node can find them, and manages dependency
32
+conflicts intelligently.
33
+
34
+It is extremely configurable to support a variety of use cases. Most
35
+commonly, you use it to publish, discover, install, and develop node
36
+programs.
37
+
38
+Run `npm help` to get a list of available commands.
39
+
40
+### Important
41
+
42
+npm comes preconfigured to use npm's public registry at
43
+https://registry.npmjs.org by default. Use of the npm public registry is
44
+subject to terms of use available at
45
+https://docs.npmjs.com/policies/terms.
46
+
47
+You can configure npm to use any compatible registry you like, and even
48
+run your own registry. Use of someone else's registry is governed by
49
+their terms of use.
50
+
51
+### Introduction
52
+
53
+You probably got npm because you want to install stuff.
54
+
55
+The very first thing you will most likely want to run in any node
56
+program is `npm install` to install its dependencies.
57
+
58
+You can also run `npm install blerg` to install the latest version of
59
+"blerg". Check out [`npm install`](/cli/v10/commands/npm-install) for more
60
+info. It can do a lot of stuff.
61
+
62
+Use the `npm search` command to show everything that's available in the
63
+public registry. Use `npm ls` to show everything you've installed.
64
+
65
+### Dependencies
66
+
67
+If a package lists a dependency using a git URL, npm will install that
68
+dependency using the [`git`](https://github.com/git-guides/install-git)
69
+command and will generate an error if it is not installed.
70
+
71
+If one of the packages npm tries to install is a native node module and
72
+requires compiling of C++ Code, npm will use
73
+[node-gyp](https://github.com/nodejs/node-gyp) for that task.
74
+For a Unix system, [node-gyp](https://github.com/nodejs/node-gyp)
75
+needs Python, make and a buildchain like GCC. On Windows,
76
+Python and Microsoft Visual Studio C++ are needed. For more information
77
+visit [the node-gyp repository](https://github.com/nodejs/node-gyp) and
78
+the [node-gyp Wiki](https://github.com/nodejs/node-gyp/wiki).
79
+
80
+### Directories
81
+
82
+See [`folders`](/cli/v10/configuring-npm/folders) to learn about where npm puts
83
+stuff.
84
+
85
+In particular, npm has two modes of operation:
86
+
87
+* local mode:
88
+ npm installs packages into the current project directory, which
89
+ defaults to the current working directory. Packages install to
90
+ `./node_modules`, and bins to `./node_modules/.bin`.
91
+* global mode:
92
+ npm installs packages into the install prefix at
93
+ `$npm_config_prefix/lib/node_modules` and bins to
94
+ `$npm_config_prefix/bin`.
95
+
96
+Local mode is the default. Use `-g` or `--global` on any command to
97
+run in global mode instead.
98
+
99
+### Developer Usage
100
+
101
+If you're using npm to develop and publish your code, check out the
102
+following help topics:
103
+
104
+* json:
105
+ Make a package.json file. See
106
+ [`package.json`](/cli/v10/configuring-npm/package-json).
107
+* link:
108
+ Links your current working code into Node's path, so that you don't
109
+ have to reinstall every time you make a change. Use [`npm
110
+ link`](/cli/v10/commands/npm-link) to do this.
111
+* install:
112
+ It's a good idea to install things if you don't need the symbolic
113
+ link. Especially, installing other peoples code from the registry is
114
+ done via [`npm install`](/cli/v10/commands/npm-install)
115
+* adduser:
116
+ Create an account or log in. When you do this, npm will store
117
+ credentials in the user config file.
118
+* publish:
119
+ Use the [`npm publish`](/cli/v10/commands/npm-publish) command to upload your
120
+ code to the registry.
121
+
122
+#### Configuration
123
+
124
+npm is extremely configurable. It reads its configuration options from
125
+5 places.
126
+
127
+* Command line switches:
128
+ Set a config with `--key val`. All keys take a value, even if they
129
+ are booleans (the config parser doesn't know what the options are at
130
+ the time of parsing). If you do not provide a value (`--key`) then
131
+ the option is set to boolean `true`.
132
+* Environment Variables:
133
+ Set any config by prefixing the name in an environment variable with
134
+ `npm_config_`. For example, `export npm_config_key=val`.
135
+* User Configs:
136
+ The file at `$HOME/.npmrc` is an ini-formatted list of configs. If
137
+ present, it is parsed. If the `userconfig` option is set in the cli
138
+ or env, that file will be used instead.
139
+* Global Configs:
140
+ The file found at `./etc/npmrc` (relative to the global prefix will be
141
+ parsed if it is found. See [`npm prefix`](/cli/v10/commands/npm-prefix) for
142
+ more info on the global prefix. If the `globalconfig` option is set
143
+ in the cli, env, or user config, then that file is parsed instead.
144
+* Defaults:
145
+ npm's default configuration options are defined in
146
+ `lib/utils/config/definitions.js`. These must not be changed.
147
+
148
+See [`config`](/cli/v10/using-npm/config) for much much more information.
149
+
150
+### Contributions
151
+
152
+Patches welcome!
153
+
154
+If you would like to help, but don't know what to work on, read the
155
+[contributing
156
+guidelines](https://github.com/npm/cli/blob/latest/CONTRIBUTING.md) and
157
+check the issues list.
158
+
159
+### Bugs
160
+
161
+When you find issues, please report them:
162
+<https://github.com/npm/cli/issues>
163
+
164
+Please be sure to follow the template and bug reporting guidelines.
165
+
166
+### Feature Requests
167
+
168
+Discuss new feature ideas on our discussion forum:
169
+
170
+* <https://github.com/npm/feedback>
171
+
172
+Or suggest formal RFC proposals:
173
+
174
+* <https://github.com/npm/rfcs>
175
+
176
+### See Also
177
+
178
+* [npm help](/cli/v10/commands/npm-help)
179
+* [package.json](/cli/v10/configuring-npm/package-json)
180
+* [npmrc](/cli/v10/configuring-npm/npmrc)
181
+* [npm config](/cli/v10/commands/npm-config)
182
+* [npm install](/cli/v10/commands/npm-install)
183
+* [npm prefix](/cli/v10/commands/npm-prefix)
184
+* [npm publish](/cli/v10/commands/npm-publish)
content/cli/v10/commands/npx.md
new
+176
@@ -0,0 +1,176 @@
1
+---
2
+title: npx
3
+section: 1
4
+description: Run a command from a local or remote npm package
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/commands/npx.md
8
+redirect_from:
9
+ - /cli-documentation/v10/cli-commands/npx
10
+ - /cli-documentation/v10/commands/npx
11
+ - /cli-documentation/v10/npx
12
+ - /cli/v10/cli-commands/npx
13
+ - /cli/v10/npx
14
+---
15
+
16
+### Synopsis
17
+
18
+```bash
19
+npx -- <pkg>[@<version>] [args...]
20
+npx --package=<pkg>[@<version>] -- <cmd> [args...]
21
+npx -c '<cmd> [args...]'
22
+npx --package=foo -c '<cmd> [args...]'
23
+```
24
+
25
+### Description
26
+
27
+This command allows you to run an arbitrary command from an npm package
28
+(either one installed locally, or fetched remotely), in a similar context
29
+as running it via `npm run`.
30
+
31
+Whatever packages are specified by the `--package` option will be
32
+provided in the `PATH` of the executed command, along with any locally
33
+installed package executables. The `--package` option may be
34
+specified multiple times, to execute the supplied command in an environment
35
+where all specified packages are available.
36
+
37
+If any requested packages are not present in the local project
38
+dependencies, then they are installed to a folder in the npm cache, which
39
+is added to the `PATH` environment variable in the executed process. A
40
+prompt is printed (which can be suppressed by providing either `--yes` or
41
+`--no`).
42
+
43
+Package names provided without a specifier will be matched with whatever
44
+version exists in the local project. Package names with a specifier will
45
+only be considered a match if they have the exact same name and version as
46
+the local dependency.
47
+
48
+If no `-c` or `--call` option is provided, then the positional arguments
49
+are used to generate the command string. If no `--package` options
50
+are provided, then npm will attempt to determine the executable name from
51
+the package specifier provided as the first positional argument according
52
+to the following heuristic:
53
+
54
+- If the package has a single entry in its `bin` field in `package.json`,
55
+ or if all entries are aliases of the same command, then that command
56
+ will be used.
57
+- If the package has multiple `bin` entries, and one of them matches the
58
+ unscoped portion of the `name` field, then that command will be used.
59
+- If this does not result in exactly one option (either because there are
60
+ no bin entries, or none of them match the `name` of the package), then
61
+ `npm exec` exits with an error.
62
+
63
+To run a binary _other than_ the named binary, specify one or more
64
+`--package` options, which will prevent npm from inferring the package from
65
+the first command argument.
66
+
67
+### `npx` vs `npm exec`
68
+
69
+When run via the `npx` binary, all flags and options *must* be set prior to
70
+any positional arguments. When run via `npm exec`, a double-hyphen `--`
71
+flag can be used to suppress npm's parsing of switches and options that
72
+should be sent to the executed command.
73
+
74
+For example:
75
+
76
+```
77
+$ npx foo@latest bar --package=@npmcli/foo
78
+```
79
+
80
+In this case, npm will resolve the `foo` package name, and run the
81
+following command:
82
+
83
+```
84
+$ foo bar --package=@npmcli/foo
85
+```
86
+
87
+Since the `--package` option comes _after_ the positional arguments, it is
88
+treated as an argument to the executed command.
89
+
90
+In contrast, due to npm's argument parsing logic, running this command is
91
+different:
92
+
93
+```
94
+$ npm exec foo@latest bar --package=@npmcli/foo
95
+```
96
+
97
+In this case, npm will parse the `--package` option first, resolving the
98
+`@npmcli/foo` package. Then, it will execute the following command in that
99
+context:
100
+
101
+```
102
+$ foo@latest bar
103
+```
104
+
105
+The double-hyphen character is recommended to explicitly tell npm to stop
106
+parsing command line options and switches. The following command would
107
+thus be equivalent to the `npx` command above:
108
+
109
+```
110
+$ npm exec -- foo@latest bar --package=@npmcli/foo
111
+```
112
+
113
+### Examples
114
+
115
+Run the version of `tap` in the local dependencies, with the provided
116
+arguments:
117
+
118
+```
119
+$ npm exec -- tap --bail test/foo.js
120
+$ npx tap --bail test/foo.js
121
+```
122
+
123
+Run a command _other than_ the command whose name matches the package name
124
+by specifying a `--package` option:
125
+
126
+```
127
+$ npm exec --package=foo -- bar --bar-argument
128
+# ~ or ~
129
+$ npx --package=foo bar --bar-argument
130
+```
131
+
132
+Run an arbitrary shell script, in the context of the current project:
133
+
134
+```
135
+$ npm x -c 'eslint && say "hooray, lint passed"'
136
+$ npx -c 'eslint && say "hooray, lint passed"'
137
+```
138
+
139
+### Compatibility with Older npx Versions
140
+
141
+The `npx` binary was rewritten in npm v7.0.0, and the standalone `npx`
142
+package deprecated at that time. `npx` uses the `npm exec`
143
+command instead of a separate argument parser and install process, with
144
+some affordances to maintain backwards compatibility with the arguments it
145
+accepted in previous versions.
146
+
147
+This resulted in some shifts in its functionality:
148
+
149
+- Any `npm` config value may be provided.
150
+- To prevent security and user-experience problems from mistyping package
151
+ names, `npx` prompts before installing anything. Suppress this
152
+ prompt with the `-y` or `--yes` option.
153
+- The `--no-install` option is deprecated, and will be converted to `--no`.
154
+- Shell fallback functionality is removed, as it is not advisable.
155
+- The `-p` argument is a shorthand for `--parseable` in npm, but shorthand
156
+ for `--package` in npx. This is maintained, but only for the `npx`
157
+ executable.
158
+- The `--ignore-existing` option is removed. Locally installed bins are
159
+ always present in the executed process `PATH`.
160
+- The `--npm` option is removed. `npx` will always use the `npm` it ships
161
+ with.
162
+- The `--node-arg` and `-n` options are removed.
163
+- The `--always-spawn` option is redundant, and thus removed.
164
+- The `--shell` option is replaced with `--script-shell`, but maintained
165
+ in the `npx` executable for backwards compatibility.
166
+
167
+### See Also
168
+
169
+* [npm run-script](/cli/v10/commands/npm-run-script)
170
+* [npm scripts](/cli/v10/using-npm/scripts)
171
+* [npm test](/cli/v10/commands/npm-test)
172
+* [npm start](/cli/v10/commands/npm-start)
173
+* [npm restart](/cli/v10/commands/npm-restart)
174
+* [npm stop](/cli/v10/commands/npm-stop)
175
+* [npm config](/cli/v10/commands/npm-config)
176
+* [npm exec](/cli/v10/commands/npm-exec)
content/cli/v10/configuring-npm/folders.md
new
+226
@@ -0,0 +1,226 @@
1
+---
2
+title: folders
3
+section: 5
4
+description: Folder Structures Used by npm
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/configuring-npm/folders.md
8
+redirect_from:
9
+ - /cli-documentation/v10/configuring-npm/folders
10
+ - /cli-documentation/v10/files/folders
11
+ - /cli/v10/files/folders
12
+---
13
+
14
+### Description
15
+
16
+npm puts various things on your computer. That's its job.
17
+
18
+This document will tell you what it puts where.
19
+
20
+#### tl;dr
21
+
22
+* Local install (default): puts stuff in `./node_modules` of the current
23
+ package root.
24
+* Global install (with `-g`): puts stuff in /usr/local or wherever node
25
+ is installed.
26
+* Install it **locally** if you're going to `require()` it.
27
+* Install it **globally** if you're going to run it on the command line.
28
+* If you need both, then install it in both places, or use `npm link`.
29
+
30
+#### prefix Configuration
31
+
32
+The [`prefix` config](/cli/v10/using-npm/config#prefix) defaults to the location where
33
+node is installed. On most systems, this is `/usr/local`. On Windows, it's
34
+`%AppData%\npm`. On Unix systems, it's one level up, since node is typically
35
+installed at `{prefix}/bin/node` rather than `{prefix}/node.exe`.
36
+
37
+When the `global` flag is set, npm installs things into this prefix.
38
+When it is not set, it uses the root of the current package, or the
39
+current working directory if not in a package already.
40
+
41
+#### Node Modules
42
+
43
+Packages are dropped into the `node_modules` folder under the `prefix`.
44
+When installing locally, this means that you can
45
+`require("packagename")` to load its main module, or
46
+`require("packagename/lib/path/to/sub/module")` to load other modules.
47
+
48
+Global installs on Unix systems go to `{prefix}/lib/node_modules`.
49
+Global installs on Windows go to `{prefix}/node_modules` (that is, no
50
+`lib` folder.)
51
+
52
+Scoped packages are installed the same way, except they are grouped together
53
+in a sub-folder of the relevant `node_modules` folder with the name of that
54
+scope prefix by the @ symbol, e.g. `npm install @myorg/package` would place
55
+the package in `{prefix}/node_modules/@myorg/package`. See
56
+[`scope`](/cli/v10/using-npm/scope) for more details.
57
+
58
+If you wish to `require()` a package, then install it locally.
59
+
60
+#### Executables
61
+
62
+When in global mode, executables are linked into `{prefix}/bin` on Unix,
63
+or directly into `{prefix}` on Windows. Ensure that path is in your
64
+terminal's `PATH` environment to run them.
65
+
66
+When in local mode, executables are linked into
67
+`./node_modules/.bin` so that they can be made available to scripts run
68
+through npm. (For example, so that a test runner will be in the path
69
+when you run `npm test`.)
70
+
71
+#### Man Pages
72
+
73
+When in global mode, man pages are linked into `{prefix}/share/man`.
74
+
75
+When in local mode, man pages are not installed.
76
+
77
+Man pages are not installed on Windows systems.
78
+
79
+#### Cache
80
+
81
+See [`npm cache`](/cli/v10/commands/npm-cache). Cache files are stored in `~/.npm` on Posix, or
82
+`%LocalAppData%/npm-cache` on Windows.
83
+
84
+This is controlled by the [`cache` config](/cli/v10/using-npm/config#cache) param.
85
+
86
+#### Temp Files
87
+
88
+Temporary files are stored by default in the folder specified by the
89
+[`tmp` config](/cli/v10/using-npm/config#tmp), which defaults to the TMPDIR, TMP, or
90
+TEMP environment variables, or `/tmp` on Unix and `c:\windows\temp` on Windows.
91
+
92
+Temp files are given a unique folder under this root for each run of the
93
+program, and are deleted upon successful exit.
94
+
95
+### More Information
96
+
97
+When installing locally, npm first tries to find an appropriate
98
+`prefix` folder. This is so that `npm install foo@1.2.3` will install
99
+to the sensible root of your package, even if you happen to have `cd`ed
100
+into some other folder.
101
+
102
+Starting at the $PWD, npm will walk up the folder tree checking for a
103
+folder that contains either a `package.json` file, or a `node_modules`
104
+folder. If such a thing is found, then that is treated as the effective
105
+"current directory" for the purpose of running npm commands. (This
106
+behavior is inspired by and similar to git's .git-folder seeking
107
+logic when running git commands in a working dir.)
108
+
109
+If no package root is found, then the current folder is used.
110
+
111
+When you run `npm install foo@1.2.3`, then the package is loaded into
112
+the cache, and then unpacked into `./node_modules/foo`. Then, any of
113
+foo's dependencies are similarly unpacked into
114
+`./node_modules/foo/node_modules/...`.
115
+
116
+Any bin files are symlinked to `./node_modules/.bin/`, so that they may
117
+be found by npm scripts when necessary.
118
+
119
+#### Global Installation
120
+
121
+If the [`global` config](/cli/v10/using-npm/config#global) is set to true, then npm will
122
+install packages "globally".
123
+
124
+For global installation, packages are installed roughly the same way,
125
+but using the folders described above.
126
+
127
+#### Cycles, Conflicts, and Folder Parsimony
128
+
129
+Cycles are handled using the property of node's module system that it
130
+walks up the directories looking for `node_modules` folders. So, at every
131
+stage, if a package is already installed in an ancestor `node_modules`
132
+folder, then it is not installed at the current location.
133
+
134
+Consider the case above, where `foo -> bar -> baz`. Imagine if, in
135
+addition to that, baz depended on bar, so you'd have:
136
+`foo -> bar -> baz -> bar -> baz ...`. However, since the folder
137
+structure is: `foo/node_modules/bar/node_modules/baz`, there's no need to
138
+put another copy of bar into `.../baz/node_modules`, since when baz calls
139
+`require("bar")`, it will get the copy that is installed in
140
+`foo/node_modules/bar`.
141
+
142
+This shortcut is only used if the exact same
143
+version would be installed in multiple nested `node_modules` folders. It
144
+is still possible to have `a/node_modules/b/node_modules/a` if the two
145
+"a" packages are different versions. However, without repeating the
146
+exact same package multiple times, an infinite regress will always be
147
+prevented.
148
+
149
+Another optimization can be made by installing dependencies at the
150
+highest level possible, below the localized "target" folder (hoisting).
151
+Since version 3, npm hoists dependencies by default.
152
+
153
+#### Example
154
+
155
+Consider this dependency graph:
156
+
157
+```bash
158
+foo
159
++-- blerg@1.2.5
160
++-- bar@1.2.3
161
+| +-- blerg@1.x (latest=1.3.7)
162
+| +-- baz@2.x
163
+| | `-- quux@3.x
164
+| | `-- bar@1.2.3 (cycle)
165
+| `-- asdf@*
166
+`-- baz@1.2.3
167
+ `-- quux@3.x
168
+ `-- bar
169
+```
170
+
171
+In this case, we might expect a folder structure like this
172
+(with all dependencies hoisted to the highest level possible):
173
+
174
+```bash
175
+foo
176
++-- node_modules
177
+ +-- blerg (1.2.5) <---[A]
178
+ +-- bar (1.2.3) <---[B]
179
+ | +-- node_modules
180
+ | +-- baz (2.0.2) <---[C]
181
+ +-- asdf (2.3.4)
182
+ +-- baz (1.2.3) <---[D]
183
+ +-- quux (3.2.0) <---[E]
184
+```
185
+
186
+Since foo depends directly on `bar@1.2.3` and `baz@1.2.3`, those are
187
+installed in foo's `node_modules` folder.
188
+
189
+Even though the latest copy of blerg is 1.3.7, foo has a specific
190
+dependency on version 1.2.5. So, that gets installed at [A]. Since the
191
+parent installation of blerg satisfies bar's dependency on `blerg@1.x`,
192
+it does not install another copy under [B].
193
+
194
+Bar [B] also has dependencies on baz and asdf. Because it depends on `baz@2.x`, it cannot
195
+re-use the `baz@1.2.3` installed in the parent `node_modules` folder [D],
196
+and must install its own copy [C]. In order to minimize duplication, npm hoists
197
+dependencies to the top level by default, so asdf is installed under [A].
198
+
199
+Underneath bar, the `baz -> quux -> bar` dependency creates a cycle.
200
+However, because bar is already in quux's ancestry [B], it does not
201
+unpack another copy of bar into that folder. Likewise, quux's [E]
202
+folder tree is empty, because its dependency on bar is satisfied
203
+by the parent folder copy installed at [B].
204
+
205
+For a graphical breakdown of what is installed where, use `npm ls`.
206
+
207
+#### Publishing
208
+
209
+Upon publishing, npm will look in the `node_modules` folder. If any of
210
+the items there are not in the `bundleDependencies` array, then they will
211
+not be included in the package tarball.
212
+
213
+This allows a package maintainer to install all of their dependencies
214
+(and dev dependencies) locally, but only re-publish those items that
215
+cannot be found elsewhere. See [`package.json`](/cli/v10/configuring-npm/package-json) for more information.
216
+
217
+### See also
218
+
219
+* [package.json](/cli/v10/configuring-npm/package-json)
220
+* [npm install](/cli/v10/commands/npm-install)
221
+* [npm pack](/cli/v10/commands/npm-pack)
222
+* [npm cache](/cli/v10/commands/npm-cache)
223
+* [npm config](/cli/v10/commands/npm-config)
224
+* [npmrc](/cli/v10/configuring-npm/npmrc)
225
+* [config](/cli/v10/using-npm/config)
226
+* [npm publish](/cli/v10/commands/npm-publish)
content/cli/v10/configuring-npm/index.mdx
new
+17
@@ -0,0 +1,17 @@
1
+---
2
+title: Configuring npm
3
+shortName: Configuring
4
+github_repo: npm/cli
5
+github_branch: latest
6
+github_path: docs/lib/content/nav.yml
7
+redirect_from:
8
+ - /cli-documentation/v10/configuring-npm
9
+ - /cli-documentation/v10/configuring-npm/index
10
+ - /cli-documentation/v10/files
11
+ - /cli-documentation/v10/files/index
12
+ - /cli/v10/configuring-npm/index
13
+ - /cli/v10/files
14
+ - /cli/v10/files/index
15
+---
16
+
17
+<Index depth="1" />
content/cli/v10/configuring-npm/install.md
new
+85
@@ -0,0 +1,85 @@
1
+---
2
+title: install
3
+section: 5
4
+description: Download and install node and npm
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/configuring-npm/install.md
8
+redirect_from:
9
+ - /cli-documentation/v10/configuring-npm/install
10
+ - /cli-documentation/v10/files/install
11
+ - /cli/v10/files/install
12
+---
13
+
14
+### Description
15
+
16
+To publish and install packages to and from the public npm registry, you
17
+must install Node.js and the npm command line interface using either a Node
18
+version manager or a Node installer. **We strongly recommend using a Node
19
+version manager to install Node.js and npm.** We do not recommend using a
20
+Node installer, since the Node installation process installs npm in a
21
+directory with local permissions and can cause permissions errors when you
22
+run npm packages globally.
23
+
24
+### Overview
25
+
26
+- [Checking your version of npm and
27
+ Node.js](#checking-your-version-of-npm-and-nodejs)
28
+- [Using a Node version manager to install Node.js and
29
+ npm](#using-a-node-version-manager-to-install-nodejs-and-npm)
30
+- [Using a Node installer to install Node.js and
31
+ npm](#using-a-node-installer-to-install-nodejs-and-npm)
32
+
33
+### Checking your version of npm and Node.js
34
+
35
+To see if you already have Node.js and npm installed and check the
36
+installed version, run the following commands:
37
+
38
+```
39
+node -v
40
+npm -v
41
+```
42
+
43
+### Using a Node version manager to install Node.js and npm
44
+
45
+Node version managers allow you to install and switch between multiple
46
+versions of Node.js and npm on your system so you can test your
47
+applications on multiple versions of npm to ensure they work for users on
48
+different versions. You can
49
+[search for them on GitHub](https://github.com/search?q=node+version+manager+archived%3Afalse&type=repositories&ref=advsearch).
50
+
51
+### Using a Node installer to install Node.js and npm
52
+
53
+If you are unable to use a Node version manager, you can use a Node
54
+installer to install both Node.js and npm on your system.
55
+
56
+* [Node.js installer](https://nodejs.org/en/download/)
57
+* [NodeSource installer](https://github.com/nodesource/distributions). If
58
+ you use Linux, we recommend that you use a NodeSource installer.
59
+
60
+#### OS X or Windows Node installers
61
+
62
+If you're using OS X or Windows, use one of the installers from the
63
+[Node.js download page](https://nodejs.org/en/download/). Be sure to
64
+install the version labeled **LTS**. Other versions have not yet been
65
+tested with npm.
66
+
67
+#### Linux or other operating systems Node installers
68
+
69
+If you're using Linux or another operating system, use one of the following
70
+installers:
71
+
72
+- [NodeSource installer](https://github.com/nodesource/distributions)
73
+ (recommended)
74
+- One of the installers on the [Node.js download
75
+ page](https://nodejs.org/en/download/)
76
+
77
+Or see [this page](https://nodejs.org/en/download/package-manager/) to
78
+install npm for Linux in the way many Linux developers prefer.
79
+
80
+#### Less-common operating systems
81
+
82
+For more information on installing Node.js on a variety of operating
83
+systems, see [this page][pkg-mgr].
84
+
85
+[pkg-mgr]: https://nodejs.org/en/download/package-manager/
content/cli/v10/configuring-npm/npm-shrinkwrap-json.md
new
+45
@@ -0,0 +1,45 @@
1
+---
2
+title: npm-shrinkwrap.json
3
+section: 5
4
+description: A publishable lockfile
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/configuring-npm/npm-shrinkwrap-json.md
8
+redirect_from:
9
+ - /cli-documentation/v10/configuring-npm/npm-shrinkwrap-json
10
+ - /cli-documentation/v10/configuring-npm/npm-shrinkwrap.json
11
+ - /cli-documentation/v10/files/npm-shrinkwrap-json
12
+ - /cli-documentation/v10/files/npm-shrinkwrap.json
13
+ - /cli/v10/configuring-npm/npm-shrinkwrap.json
14
+ - /cli/v10/files/npm-shrinkwrap-json
15
+ - /cli/v10/files/npm-shrinkwrap.json
16
+---
17
+
18
+### Description
19
+
20
+`npm-shrinkwrap.json` is a file created by [`npm
21
+shrinkwrap`](/cli/v10/commands/npm-shrinkwrap). It is identical to
22
+`package-lock.json`, with one major caveat: Unlike `package-lock.json`,
23
+`npm-shrinkwrap.json` may be included when publishing a package.
24
+
25
+The recommended use-case for `npm-shrinkwrap.json` is applications deployed
26
+through the publishing process on the registry: for example, daemons and
27
+command-line tools intended as global installs or `devDependencies`. It's
28
+strongly discouraged for library authors to publish this file, since that
29
+would prevent end users from having control over transitive dependency
30
+updates.
31
+
32
+If both `package-lock.json` and `npm-shrinkwrap.json` are present in a
33
+package root, `npm-shrinkwrap.json` will be preferred over the
34
+`package-lock.json` file.
35
+
36
+For full details and description of the `npm-shrinkwrap.json` file format,
37
+refer to the manual page for
38
+[package-lock.json](/cli/v10/configuring-npm/package-lock-json).
39
+
40
+### See also
41
+
42
+* [npm shrinkwrap](/cli/v10/commands/npm-shrinkwrap)
43
+* [package-lock.json](/cli/v10/configuring-npm/package-lock-json)
44
+* [package.json](/cli/v10/configuring-npm/package-json)
45
+* [npm install](/cli/v10/commands/npm-install)
content/cli/v10/configuring-npm/npmrc.md
new
+144
@@ -0,0 +1,144 @@
1
+---
2
+title: npmrc
3
+section: 5
4
+description: The npm config files
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/configuring-npm/npmrc.md
8
+redirect_from:
9
+ - /cli-documentation/v10/configuring-npm/npmrc
10
+ - /cli-documentation/v10/files/npmrc
11
+ - /cli/v10/files/npmrc
12
+---
13
+
14
+### Description
15
+
16
+npm gets its config settings from the command line, environment variables,
17
+and `npmrc` files.
18
+
19
+The `npm config` command can be used to update and edit the contents of the
20
+user and global npmrc files.
21
+
22
+For a list of available configuration options, see
23
+[config](/cli/v10/using-npm/config).
24
+
25
+### Files
26
+
27
+The four relevant files are:
28
+
29
+* per-project config file (/path/to/my/project/.npmrc)
30
+* per-user config file (~/.npmrc)
31
+* global config file ($PREFIX/etc/npmrc)
32
+* npm builtin config file (/path/to/npm/npmrc)
33
+
34
+All npm config files are an ini-formatted list of `key = value` parameters.
35
+Environment variables can be replaced using `${VARIABLE_NAME}`. For
36
+example:
37
+
38
+```bash
39
+prefix = ${HOME}/.npm-packages
40
+```
41
+
42
+Each of these files is loaded, and config options are resolved in priority
43
+order. For example, a setting in the userconfig file would override the
44
+setting in the globalconfig file.
45
+
46
+Array values are specified by adding "[]" after the key name. For example:
47
+
48
+```bash
49
+key[] = "first value"
50
+key[] = "second value"
51
+```
52
+
53
+#### Comments
54
+
55
+Lines in `.npmrc` files are interpreted as comments when they begin with a
56
+`;` or `#` character. `.npmrc` files are parsed by
57
+[npm/ini](https://github.com/npm/ini), which specifies this comment syntax.
58
+
59
+For example:
60
+
61
+```bash
62
+# last modified: 01 Jan 2016
63
+; Set a new registry for a scoped package
64
+@myscope:registry=https://mycustomregistry.example.org
65
+```
66
+
67
+#### Per-project config file
68
+
69
+When working locally in a project, a `.npmrc` file in the root of the
70
+project (ie, a sibling of `node_modules` and `package.json`) will set
71
+config values specific to this project.
72
+
73
+Note that this only applies to the root of the project that you're running
74
+npm in. It has no effect when your module is published. For example, you
75
+can't publish a module that forces itself to install globally, or in a
76
+different location.
77
+
78
+Additionally, this file is not read in global mode, such as when running
79
+`npm install -g`.
80
+
81
+#### Per-user config file
82
+
83
+`$HOME/.npmrc` (or the `userconfig` param, if set in the environment or on
84
+the command line)
85
+
86
+#### Global config file
87
+
88
+`$PREFIX/etc/npmrc` (or the `globalconfig` param, if set above): This file
89
+is an ini-file formatted list of `key = value` parameters. Environment
90
+variables can be replaced as above.
91
+
92
+#### Built-in config file
93
+
94
+`path/to/npm/itself/npmrc`
95
+
96
+This is an unchangeable "builtin" configuration file that npm keeps
97
+consistent across updates. Set fields in here using the `./configure`
98
+script that comes with npm. This is primarily for distribution maintainers
99
+to override default configs in a standard and consistent manner.
100
+
101
+### Auth related configuration
102
+
103
+The settings `_auth`, `_authToken`, `username` and `_password` must all be
104
+scoped to a specific registry. This ensures that `npm` will never send
105
+credentials to the wrong host.
106
+
107
+The full list is:
108
+ - `_auth` (base64 authentication string)
109
+ - `_authToken` (authentication token)
110
+ - `username`
111
+ - `_password`
112
+ - `email`
113
+ - `certfile` (path to certificate file)
114
+ - `keyfile` (path to key file)
115
+
116
+In order to scope these values, they must be prefixed by a URI fragment.
117
+If the credential is meant for any request to a registry on a single host,
118
+the scope may look like `//registry.npmjs.org/:`. If it must be scoped to a
119
+specific path on the host that path may also be provided, such as
120
+`//my-custom-registry.org/unique/path:`.
121
+
122
+```
123
+; bad config
124
+_authToken=MYTOKEN
125
+
126
+; good config
127
+@myorg:registry=https://somewhere-else.com/myorg
128
+@another:registry=https://somewhere-else.com/another
129
+//registry.npmjs.org/:_authToken=MYTOKEN
130
+; would apply to both @myorg and @another
131
+; //somewhere-else.com/:_authToken=MYTOKEN
132
+; would apply only to @myorg
133
+//somewhere-else.com/myorg/:_authToken=MYTOKEN1
134
+; would apply only to @another
135
+//somewhere-else.com/another/:_authToken=MYTOKEN2
136
+```
137
+
138
+### See also
139
+
140
+* [npm folders](/cli/v10/configuring-npm/folders)
141
+* [npm config](/cli/v10/commands/npm-config)
142
+* [config](/cli/v10/using-npm/config)
143
+* [package.json](/cli/v10/configuring-npm/package-json)
144
+* [npm](/cli/v10/commands/npm)
content/cli/v10/configuring-npm/package-json.md
new
+1186
@@ -0,0 +1,1186 @@
1
+---
2
+title: package.json
3
+section: 5
4
+description: Specifics of npm's package.json handling
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/configuring-npm/package-json.md
8
+redirect_from:
9
+ - /cli-documentation/v10/configuring-npm/package-json
10
+ - /cli-documentation/v10/configuring-npm/package.json
11
+ - /cli-documentation/v10/files/package-json
12
+ - /cli-documentation/v10/files/package.json
13
+ - /cli/v10/configuring-npm/package.json
14
+ - /cli/v10/files/package-json
15
+ - /cli/v10/files/package.json
16
+---
17
+
18
+### Description
19
+
20
+This document is all you need to know about what's required in your
21
+package.json file. It must be actual JSON, not just a JavaScript object
22
+literal.
23
+
24
+A lot of the behavior described in this document is affected by the config
25
+settings described in [`config`](/cli/v10/using-npm/config).
26
+
27
+### name
28
+
29
+If you plan to publish your package, the *most* important things in your
30
+package.json are the name and version fields as they will be required. The
31
+name and version together form an identifier that is assumed to be
32
+completely unique. Changes to the package should come along with changes
33
+to the version. If you don't plan to publish your package, the name and
34
+version fields are optional.
35
+
36
+The name is what your thing is called.
37
+
38
+Some rules:
39
+
40
+* The name must be less than or equal to 214 characters. This includes the
41
+ scope for scoped packages.
42
+* The names of scoped packages can begin with a dot or an underscore. This
43
+ is not permitted without a scope.
44
+* New packages must not have uppercase letters in the name.
45
+* The name ends up being part of a URL, an argument on the command line,
46
+ and a folder name. Therefore, the name can't contain any non-URL-safe
47
+ characters.
48
+
49
+Some tips:
50
+
51
+* Don't use the same name as a core Node module.
52
+* Don't put "js" or "node" in the name. It's assumed that it's js, since
53
+ you're writing a package.json file, and you can specify the engine using
54
+ the "engines" field. (See below.)
55
+* The name will probably be passed as an argument to require(), so it
56
+ should be something short, but also reasonably descriptive.
57
+* You may want to check the npm registry to see if there's something by
58
+ that name already, before you get too attached to it.
59
+ <https://www.npmjs.com/>
60
+
61
+A name can be optionally prefixed by a scope, e.g. `@myorg/mypackage`. See
62
+[`scope`](/cli/v10/using-npm/scope) for more detail.
63
+
64
+### version
65
+
66
+If you plan to publish your package, the *most* important things in your
67
+package.json are the name and version fields as they will be required. The
68
+name and version together form an identifier that is assumed to be
69
+completely unique. Changes to the package should come along with changes
70
+to the version. If you don't plan to publish your package, the name and
71
+version fields are optional.
72
+
73
+Version must be parseable by
74
+[node-semver](https://github.com/npm/node-semver), which is bundled with
75
+npm as a dependency. (`npm install semver` to use it yourself.)
76
+
77
+### description
78
+
79
+Put a description in it. It's a string. This helps people discover your
80
+package, as it's listed in `npm search`.
81
+
82
+### keywords
83
+
84
+Put keywords in it. It's an array of strings. This helps people discover
85
+your package as it's listed in `npm search`.
86
+
87
+### homepage
88
+
89
+The url to the project homepage.
90
+
91
+Example:
92
+
93
+```json
94
+"homepage": "https://github.com/owner/project#readme"
95
+```
96
+
97
+### bugs
98
+
99
+The url to your project's issue tracker and / or the email address to which
100
+issues should be reported. These are helpful for people who encounter
101
+issues with your package.
102
+
103
+It should look like this:
104
+
105
+```json
106
+{
107
+ "bugs": {
108
+ "url": "https://github.com/owner/project/issues",
109
+ "email": "project@hostname.com"
110
+ }
111
+}
112
+```
113
+
114
+You can specify either one or both values. If you want to provide only a
115
+url, you can specify the value for "bugs" as a simple string instead of an
116
+object.
117
+
118
+If a url is provided, it will be used by the `npm bugs` command.
119
+
120
+### license
121
+
122
+You should specify a license for your package so that people know how they
123
+are permitted to use it, and any restrictions you're placing on it.
124
+
125
+If you're using a common license such as BSD-2-Clause or MIT, add a current
126
+SPDX license identifier for the license you're using, like this:
127
+
128
+```json
129
+{
130
+ "license" : "BSD-3-Clause"
131
+}
132
+```
133
+
134
+You can check [the full list of SPDX license
135
+IDs](https://spdx.org/licenses/). Ideally you should pick one that is
136
+[OSI](https://opensource.org/licenses/) approved.
137
+
138
+If your package is licensed under multiple common licenses, use an [SPDX
139
+license expression syntax version 2.0
140
+string](https://spdx.dev/specifications/), like this:
141
+
142
+```json
143
+{
144
+ "license" : "(ISC OR GPL-3.0)"
145
+}
146
+```
147
+If you are using a license that hasn't been assigned an SPDX identifier, or if
148
+you are using a custom license, use a string value like this one:
149
+
150
+```json
151
+{
152
+ "license" : "SEE LICENSE IN <filename>"
153
+}
154
+```
155
+Then include a file named `<filename>` at the top level of the package.
156
+
157
+Some old packages used license objects or a "licenses" property containing
158
+an array of license objects:
159
+
160
+```json
161
+// Not valid metadata
162
+{
163
+ "license" : {
164
+ "type" : "ISC",
165
+ "url" : "https://opensource.org/licenses/ISC"
166
+ }
167
+}
168
+
169
+// Not valid metadata
170
+{
171
+ "licenses" : [
172
+ {
173
+ "type": "MIT",
174
+ "url": "https://www.opensource.org/licenses/mit-license.php"
175
+ },
176
+ {
177
+ "type": "Apache-2.0",
178
+ "url": "https://opensource.org/licenses/apache2.0.php"
179
+ }
180
+ ]
181
+}
182
+```
183
+
184
+Those styles are now deprecated. Instead, use SPDX expressions, like this:
185
+
186
+```json
187
+{
188
+ "license": "ISC"
189
+}
190
+```
191
+
192
+```json
193
+{
194
+ "license": "(MIT OR Apache-2.0)"
195
+}
196
+```
197
+
198
+Finally, if you do not wish to grant others the right to use a private or
199
+unpublished package under any terms:
200
+
201
+```json
202
+{
203
+ "license": "UNLICENSED"
204
+}
205
+```
206
+
207
+Consider also setting `"private": true` to prevent accidental publication.
208
+
209
+### people fields: author, contributors
210
+
211
+The "author" is one person. "contributors" is an array of people. A
212
+"person" is an object with a "name" field and optionally "url" and "email",
213
+like this:
214
+
215
+```json
216
+{
217
+ "name" : "Barney Rubble",
218
+ "email" : "b@rubble.com",
219
+ "url" : "http://barnyrubble.tumblr.com/"
220
+}
221
+```
222
+
223
+Or you can shorten that all into a single string, and npm will parse it for
224
+you:
225
+
226
+```json
227
+{
228
+ "author": "Barney Rubble <b@rubble.com> (http://barnyrubble.tumblr.com/)"
229
+}
230
+```
231
+
232
+Both email and url are optional either way.
233
+
234
+npm also sets a top-level "maintainers" field with your npm user info.
235
+
236
+### funding
237
+
238
+You can specify an object containing a URL that provides up-to-date
239
+information about ways to help fund development of your package, or a
240
+string URL, or an array of these:
241
+
242
+```json
243
+{
244
+ "funding": {
245
+ "type" : "individual",
246
+ "url" : "http://example.com/donate"
247
+ },
248
+
249
+ "funding": {
250
+ "type" : "patreon",
251
+ "url" : "https://www.patreon.com/my-account"
252
+ },
253
+
254
+ "funding": "http://example.com/donate",
255
+
256
+ "funding": [
257
+ {
258
+ "type" : "individual",
259
+ "url" : "http://example.com/donate"
260
+ },
261
+ "http://example.com/donateAlso",
262
+ {
263
+ "type" : "patreon",
264
+ "url" : "https://www.patreon.com/my-account"
265
+ }
266
+ ]
267
+}
268
+```
269
+
270
+Users can use the `npm fund` subcommand to list the `funding` URLs of all
271
+dependencies of their project, direct and indirect. A shortcut to visit
272
+each funding url is also available when providing the project name such as:
273
+`npm fund <projectname>` (when there are multiple URLs, the first one will
274
+be visited)
275
+
276
+### files
277
+
278
+The optional `files` field is an array of file patterns that describes the
279
+entries to be included when your package is installed as a dependency. File
280
+patterns follow a similar syntax to `.gitignore`, but reversed: including a
281
+file, directory, or glob pattern (`*`, `**/*`, and such) will make it so
282
+that file is included in the tarball when it's packed. Omitting the field
283
+will make it default to `["*"]`, which means it will include all files.
284
+
285
+Some special files and directories are also included or excluded regardless
286
+of whether they exist in the `files` array (see below).
287
+
288
+You can also provide a `.npmignore` file in the root of your package or in
289
+subdirectories, which will keep files from being included. At the root of
290
+your package it will not override the "files" field, but in subdirectories
291
+it will. The `.npmignore` file works just like a `.gitignore`. If there is
292
+a `.gitignore` file, and `.npmignore` is missing, `.gitignore`'s contents
293
+will be used instead.
294
+
295
+Certain files are always included, regardless of settings:
296
+
297
+* `package.json`
298
+* `README`
299
+* `LICENSE` / `LICENCE`
300
+* The file in the "main" field
301
+* The file(s) in the "bin" field
302
+
303
+`README` & `LICENSE` can have any case and extension.
304
+
305
+Conversely, some files are always ignored:
306
+
307
+* `.git`
308
+* `CVS`
309
+* `.svn`
310
+* `.hg`
311
+* `.lock-wscript`
312
+* `.wafpickle-N`
313
+* `.*.swp`
314
+* `.DS_Store`
315
+* `._*`
316
+* `npm-debug.log`
317
+* `.npmrc`
318
+* `node_modules`
319
+* `config.gypi`
320
+* `*.orig`
321
+* `package-lock.json` (use
322
+ [`npm-shrinkwrap.json`](/cli/v10/configuring-npm/npm-shrinkwrap-json) if you wish
323
+ it to be published)
324
+
325
+### main
326
+
327
+The main field is a module ID that is the primary entry point to your
328
+program. That is, if your package is named `foo`, and a user installs it,
329
+and then does `require("foo")`, then your main module's exports object will
330
+be returned.
331
+
332
+This should be a module relative to the root of your package folder.
333
+
334
+For most modules, it makes the most sense to have a main script and often
335
+not much else.
336
+
337
+If `main` is not set, it defaults to `index.js` in the package's root folder.
338
+
339
+### browser
340
+
341
+If your module is meant to be used client-side the browser field should be
342
+used instead of the main field. This is helpful to hint users that it might
343
+rely on primitives that aren't available in Node.js modules. (e.g.
344
+`window`)
345
+
346
+### bin
347
+
348
+A lot of packages have one or more executable files that they'd like to
349
+install into the PATH. npm makes this pretty easy (in fact, it uses this
350
+feature to install the "npm" executable.)
351
+
352
+To use this, supply a `bin` field in your package.json which is a map of
353
+command name to local file name. When this package is installed globally,
354
+that file will be either linked inside the global bins directory or
355
+a cmd (Windows Command File) will be created which executes the specified
356
+file in the `bin` field, so it is available to run by `name` or `name.cmd` (on
357
+Windows PowerShell). When this package is installed as a dependency in another
358
+package, the file will be linked where it will be available to that package
359
+either directly by `npm exec` or by name in other scripts when invoking them
360
+via `npm run-script`.
361
+
362
+
363
+For example, myapp could have this:
364
+
365
+```json
366
+{
367
+ "bin": {
368
+ "myapp": "./cli.js"
369
+ }
370
+}
371
+```
372
+
373
+So, when you install myapp, in case of unix-like OS it'll create a symlink
374
+from the `cli.js` script to `/usr/local/bin/myapp` and in case of windows it
375
+will create a cmd file usually at `C:\Users\{Username}\AppData\Roaming\npm\myapp.cmd`
376
+which runs the `cli.js` script.
377
+
378
+If you have a single executable, and its name should be the name of the
379
+package, then you can just supply it as a string. For example:
380
+
381
+```json
382
+{
383
+ "name": "my-program",
384
+ "version": "1.2.5",
385
+ "bin": "./path/to/program"
386
+}
387
+```
388
+
389
+would be the same as this:
390
+
391
+```json
392
+{
393
+ "name": "my-program",
394
+ "version": "1.2.5",
395
+ "bin": {
396
+ "my-program": "./path/to/program"
397
+ }
398
+}
399
+```
400
+
401
+Please make sure that your file(s) referenced in `bin` starts with
402
+`#!/usr/bin/env node`, otherwise the scripts are started without the node
403
+executable!
404
+
405
+Note that you can also set the executable files using [directories.bin](#directoriesbin).
406
+
407
+See [folders](/cli/v10/configuring-npm/folders#executables) for more info on
408
+executables.
409
+
410
+### man
411
+
412
+Specify either a single file or an array of filenames to put in place for
413
+the `man` program to find.
414
+
415
+If only a single file is provided, then it's installed such that it is the
416
+result from `man <pkgname>`, regardless of its actual filename. For
417
+example:
418
+
419
+```json
420
+{
421
+ "name": "foo",
422
+ "version": "1.2.3",
423
+ "description": "A packaged foo fooer for fooing foos",
424
+ "main": "foo.js",
425
+ "man": "./man/doc.1"
426
+}
427
+```
428
+
429
+would link the `./man/doc.1` file in such that it is the target for `man
430
+foo`
431
+
432
+If the filename doesn't start with the package name, then it's prefixed.
433
+So, this:
434
+
435
+```json
436
+{
437
+ "name": "foo",
438
+ "version": "1.2.3",
439
+ "description": "A packaged foo fooer for fooing foos",
440
+ "main": "foo.js",
441
+ "man": [
442
+ "./man/foo.1",
443
+ "./man/bar.1"
444
+ ]
445
+}
446
+```
447
+
448
+will create files to do `man foo` and `man foo-bar`.
449
+
450
+Man files must end with a number, and optionally a `.gz` suffix if they are
451
+compressed. The number dictates which man section the file is installed
452
+into.
453
+
454
+```json
455
+{
456
+ "name": "foo",
457
+ "version": "1.2.3",
458
+ "description": "A packaged foo fooer for fooing foos",
459
+ "main": "foo.js",
460
+ "man": [
461
+ "./man/foo.1",
462
+ "./man/foo.2"
463
+ ]
464
+}
465
+```
466
+
467
+will create entries for `man foo` and `man 2 foo`
468
+
469
+### directories
470
+
471
+The CommonJS [Packages](http://wiki.commonjs.org/wiki/Packages/1.0) spec
472
+details a few ways that you can indicate the structure of your package
473
+using a `directories` object. If you look at [npm's
474
+package.json](https://registry.npmjs.org/npm/latest), you'll see that it
475
+has directories for doc, lib, and man.
476
+
477
+In the future, this information may be used in other creative ways.
478
+
479
+#### directories.bin
480
+
481
+If you specify a `bin` directory in `directories.bin`, all the files in
482
+that folder will be added.
483
+
484
+Because of the way the `bin` directive works, specifying both a `bin` path
485
+and setting `directories.bin` is an error. If you want to specify
486
+individual files, use `bin`, and for all the files in an existing `bin`
487
+directory, use `directories.bin`.
488
+
489
+#### directories.man
490
+
491
+A folder that is full of man pages. Sugar to generate a "man" array by
492
+walking the folder.
493
+
494
+### repository
495
+
496
+Specify the place where your code lives. This is helpful for people who
497
+want to contribute. If the git repo is on GitHub, then the `npm docs`
498
+command will be able to find you.
499
+
500
+Do it like this:
501
+
502
+```json
503
+{
504
+ "repository": {
505
+ "type": "git",
506
+ "url": "https://github.com/npm/cli.git"
507
+ }
508
+}
509
+```
510
+
511
+The URL should be a publicly available (perhaps read-only) url that can be
512
+handed directly to a VCS program without any modification. It should not
513
+be a url to an html project page that you put in your browser. It's for
514
+computers.
515
+
516
+For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the
517
+same shortcut syntax you use for `npm install`:
518
+
519
+```json
520
+{
521
+ "repository": "npm/npm",
522
+
523
+ "repository": "github:user/repo",
524
+
525
+ "repository": "gist:11081aaa281",
526
+
527
+ "repository": "bitbucket:user/repo",
528
+
529
+ "repository": "gitlab:user/repo"
530
+}
531
+```
532
+
533
+If the `package.json` for your package is not in the root directory (for
534
+example if it is part of a monorepo), you can specify the directory in
535
+which it lives:
536
+
537
+```json
538
+{
539
+ "repository": {
540
+ "type": "git",
541
+ "url": "https://github.com/facebook/react.git",
542
+ "directory": "packages/react-dom"
543
+ }
544
+}
545
+```
546
+
547
+### scripts
548
+
549
+The "scripts" property is a dictionary containing script commands that are
550
+run at various times in the lifecycle of your package. The key is the
551
+lifecycle event, and the value is the command to run at that point.
552
+
553
+See [`scripts`](/cli/v10/using-npm/scripts) to find out more about writing package
554
+scripts.
555
+
556
+### config
557
+
558
+A "config" object can be used to set configuration parameters used in
559
+package scripts that persist across upgrades. For instance, if a package
560
+had the following:
561
+
562
+```json
563
+{
564
+ "name": "foo",
565
+ "config": {
566
+ "port": "8080"
567
+ }
568
+}
569
+```
570
+
571
+It could also have a "start" command that referenced the
572
+`npm_package_config_port` environment variable.
573
+
574
+### dependencies
575
+
576
+Dependencies are specified in a simple object that maps a package name to a
577
+version range. The version range is a string which has one or more
578
+space-separated descriptors. Dependencies can also be identified with a
579
+tarball or git URL.
580
+
581
+**Please do not put test harnesses or transpilers or other "development"
582
+time tools in your `dependencies` object.** See `devDependencies`, below.
583
+
584
+See [semver](https://github.com/npm/node-semver#versions) for more details about specifying version ranges.
585
+
586
+* `version` Must match `version` exactly
587
+* `>version` Must be greater than `version`
588
+* `>=version` etc
589
+* `<version`
590
+* `<=version`
591
+* `~version` "Approximately equivalent to version" See
592
+ [semver](https://github.com/npm/node-semver#versions)
593
+* `^version` "Compatible with version" See [semver](https://github.com/npm/node-semver#versions)
594
+* `1.2.x` 1.2.0, 1.2.1, etc., but not 1.3.0
595
+* `http://...` See 'URLs as Dependencies' below
596
+* `*` Matches any version
597
+* `""` (just an empty string) Same as `*`
598
+* `version1 - version2` Same as `>=version1 <=version2`.
599
+* `range1 || range2` Passes if either range1 or range2 are satisfied.
600
+* `git...` See 'Git URLs as Dependencies' below
601
+* `user/repo` See 'GitHub URLs' below
602
+* `tag` A specific version tagged and published as `tag` See [`npm
603
+ dist-tag`](/cli/v10/commands/npm-dist-tag)
604
+* `path/path/path` See [Local Paths](#local-paths) below
605
+
606
+For example, these are all valid:
607
+
608
+```json
609
+{
610
+ "dependencies": {
611
+ "foo": "1.0.0 - 2.9999.9999",
612
+ "bar": ">=1.0.2 <2.1.2",
613
+ "baz": ">1.0.2 <=2.3.4",
614
+ "boo": "2.0.1",
615
+ "qux": "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0",
616
+ "asd": "http://asdf.com/asdf.tar.gz",
617
+ "til": "~1.2",
618
+ "elf": "~1.2.3",
619
+ "two": "2.x",
620
+ "thr": "3.3.x",
621
+ "lat": "latest",
622
+ "dyl": "file:../dyl"
623
+ }
624
+}
625
+```
626
+
627
+#### URLs as Dependencies
628
+
629
+You may specify a tarball URL in place of a version range.
630
+
631
+This tarball will be downloaded and installed locally to your package at
632
+install time.
633
+
634
+#### Git URLs as Dependencies
635
+
636
+Git urls are of the form:
637
+
638
+```bash
639
+<protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>[#<commit-ish> | #semver:<semver>]
640
+```
641
+
642
+`<protocol>` is one of `git`, `git+ssh`, `git+http`, `git+https`, or
643
+`git+file`.
644
+
645
+If `#<commit-ish>` is provided, it will be used to clone exactly that
646
+commit. If the commit-ish has the format `#semver:<semver>`, `<semver>` can
647
+be any valid semver range or exact version, and npm will look for any tags
648
+or refs matching that range in the remote repository, much as it would for
649
+a registry dependency. If neither `#<commit-ish>` or `#semver:<semver>` is
650
+specified, then the default branch is used.
651
+
652
+Examples:
653
+
654
+```bash
655
+git+ssh://git@github.com:npm/cli.git#v1.0.27
656
+git+ssh://git@github.com:npm/cli#semver:^5.0
657
+git+https://isaacs@github.com/npm/cli.git
658
+git://github.com/npm/cli.git#v1.0.27
659
+```
660
+
661
+When installing from a `git` repository, the presence of certain fields in the
662
+`package.json` will cause npm to believe it needs to perform a build. To do so
663
+your repository will be cloned into a temporary directory, all of its deps
664
+installed, relevant scripts run, and the resulting directory packed and
665
+installed.
666
+
667
+This flow will occur if your git dependency uses `workspaces`, or if any of the
668
+following scripts are present:
669
+
670
+* `build`
671
+* `prepare`
672
+* `prepack`
673
+* `preinstall`
674
+* `install`
675
+* `postinstall`
676
+
677
+If your git repository includes pre-built artifacts, you will likely want to
678
+make sure that none of the above scripts are defined, or your dependency
679
+will be rebuilt for every installation.
680
+
681
+#### GitHub URLs
682
+
683
+As of version 1.1.65, you can refer to GitHub urls as just "foo":
684
+"user/foo-project". Just as with git URLs, a `commit-ish` suffix can be
685
+included. For example:
686
+
687
+```json
688
+{
689
+ "name": "foo",
690
+ "version": "0.0.0",
691
+ "dependencies": {
692
+ "express": "expressjs/express",
693
+ "mocha": "mochajs/mocha#4727d357ea",
694
+ "module": "user/repo#feature\/branch"
695
+ }
696
+}
697
+```
698
+
699
+#### Local Paths
700
+
701
+As of version 2.0.0 you can provide a path to a local directory that
702
+contains a package. Local paths can be saved using `npm install -S` or `npm
703
+install --save`, using any of these forms:
704
+
705
+```bash
706
+../foo/bar
707
+~/foo/bar
708
+./foo/bar
709
+/foo/bar
710
+```
711
+
712
+in which case they will be normalized to a relative path and added to your
713
+`package.json`. For example:
714
+
715
+```json
716
+{
717
+ "name": "baz",
718
+ "dependencies": {
719
+ "bar": "file:../foo/bar"
720
+ }
721
+}
722
+```
723
+
724
+This feature is helpful for local offline development and creating tests
725
+that require npm installing where you don't want to hit an external server,
726
+but should not be used when publishing packages to the public registry.
727
+
728
+*note*: Packages linked by local path will not have their own
729
+dependencies installed when `npm install` is ran in this case. You must
730
+run `npm install` from inside the local path itself.
731
+
732
+### devDependencies
733
+
734
+If someone is planning on downloading and using your module in their
735
+program, then they probably don't want or need to download and build the
736
+external test or documentation framework that you use.
737
+
738
+In this case, it's best to map these additional items in a
739
+`devDependencies` object.
740
+
741
+These things will be installed when doing `npm link` or `npm install` from
742
+the root of a package, and can be managed like any other npm configuration
743
+param. See [`config`](/cli/v10/using-npm/config) for more on the topic.
744
+
745
+For build steps that are not platform-specific, such as compiling
746
+CoffeeScript or other languages to JavaScript, use the `prepare` script to
747
+do this, and make the required package a devDependency.
748
+
749
+For example:
750
+
751
+```json
752
+{
753
+ "name": "ethopia-waza",
754
+ "description": "a delightfully fruity coffee varietal",
755
+ "version": "1.2.3",
756
+ "devDependencies": {
757
+ "coffee-script": "~1.6.3"
758
+ },
759
+ "scripts": {
760
+ "prepare": "coffee -o lib/ -c src/waza.coffee"
761
+ },
762
+ "main": "lib/waza.js"
763
+}
764
+```
765
+
766
+The `prepare` script will be run before publishing, so that users can
767
+consume the functionality without requiring them to compile it themselves.
768
+In dev mode (ie, locally running `npm install`), it'll run this script as
769
+well, so that you can test it easily.
770
+
771
+### peerDependencies
772
+
773
+In some cases, you want to express the compatibility of your package with a
774
+host tool or library, while not necessarily doing a `require` of this host.
775
+This is usually referred to as a *plugin*. Notably, your module may be
776
+exposing a specific interface, expected and specified by the host
777
+documentation.
778
+
779
+For example:
780
+
781
+```json
782
+{
783
+ "name": "tea-latte",
784
+ "version": "1.3.5",
785
+ "peerDependencies": {
786
+ "tea": "2.x"
787
+ }
788
+}
789
+```
790
+
791
+This ensures your package `tea-latte` can be installed *along* with the
792
+second major version of the host package `tea` only. `npm install
793
+tea-latte` could possibly yield the following dependency graph:
794
+
795
+```bash
796
+├── tea-latte@1.3.5
797
+└── tea@2.2.0
798
+```
799
+
800
+In npm versions 3 through 6, `peerDependencies` were not automatically
801
+installed, and would raise a warning if an invalid version of the peer
802
+dependency was found in the tree. As of npm v7, peerDependencies _are_
803
+installed by default.
804
+
805
+Trying to install another plugin with a conflicting requirement may cause
806
+an error if the tree cannot be resolved correctly. For this reason, make
807
+sure your plugin requirement is as broad as possible, and not to lock it
808
+down to specific patch versions.
809
+
810
+Assuming the host complies with [semver](https://semver.org/), only changes
811
+in the host package's major version will break your plugin. Thus, if you've
812
+worked with every 1.x version of the host package, use `"^1.0"` or `"1.x"`
813
+to express this. If you depend on features introduced in 1.5.2, use
814
+`"^1.5.2"`.
815
+
816
+### peerDependenciesMeta
817
+
818
+When a user installs your package, npm will emit warnings if packages
819
+specified in `peerDependencies` are not already installed. The
820
+`peerDependenciesMeta` field serves to provide npm more information on how
821
+your peer dependencies are to be used. Specifically, it allows peer
822
+dependencies to be marked as optional.
823
+
824
+For example:
825
+
826
+```json
827
+{
828
+ "name": "tea-latte",
829
+ "version": "1.3.5",
830
+ "peerDependencies": {
831
+ "tea": "2.x",
832
+ "soy-milk": "1.2"
833
+ },
834
+ "peerDependenciesMeta": {
835
+ "soy-milk": {
836
+ "optional": true
837
+ }
838
+ }
839
+}
840
+```
841
+
842
+Marking a peer dependency as optional ensures npm will not emit a warning
843
+if the `soy-milk` package is not installed on the host. This allows you to
844
+integrate and interact with a variety of host packages without requiring
845
+all of them to be installed.
846
+
847
+### bundleDependencies
848
+
849
+This defines an array of package names that will be bundled when publishing
850
+the package.
851
+
852
+In cases where you need to preserve npm packages locally or have them
853
+available through a single file download, you can bundle the packages in a
854
+tarball file by specifying the package names in the `bundleDependencies`
855
+array and executing `npm pack`.
856
+
857
+For example:
858
+
859
+If we define a package.json like this:
860
+
861
+```json
862
+{
863
+ "name": "awesome-web-framework",
864
+ "version": "1.0.0",
865
+ "bundleDependencies": [
866
+ "renderized",
867
+ "super-streams"
868
+ ]
869
+}
870
+```
871
+
872
+we can obtain `awesome-web-framework-1.0.0.tgz` file by running `npm pack`.
873
+This file contains the dependencies `renderized` and `super-streams` which
874
+can be installed in a new project by executing `npm install
875
+awesome-web-framework-1.0.0.tgz`. Note that the package names do not
876
+include any versions, as that information is specified in `dependencies`.
877
+
878
+If this is spelled `"bundledDependencies"`, then that is also honored.
879
+
880
+Alternatively, `"bundleDependencies"` can be defined as a boolean value. A
881
+value of `true` will bundle all dependencies, a value of `false` will bundle
882
+none.
883
+
884
+### optionalDependencies
885
+
886
+If a dependency can be used, but you would like npm to proceed if it cannot
887
+be found or fails to install, then you may put it in the
888
+`optionalDependencies` object. This is a map of package name to version or
889
+url, just like the `dependencies` object. The difference is that build
890
+failures do not cause installation to fail. Running `npm install
891
+--omit=optional` will prevent these dependencies from being installed.
892
+
893
+It is still your program's responsibility to handle the lack of the
894
+dependency. For example, something like this:
895
+
896
+```js
897
+try {
898
+ var foo = require('foo')
899
+ var fooVersion = require('foo/package.json').version
900
+} catch (er) {
901
+ foo = null
902
+}
903
+if ( notGoodFooVersion(fooVersion) ) {
904
+ foo = null
905
+}
906
+
907
+// .. then later in your program ..
908
+
909
+if (foo) {
910
+ foo.doFooThings()
911
+}
912
+```
913
+
914
+Entries in `optionalDependencies` will override entries of the same name in
915
+`dependencies`, so it's usually best to only put in one place.
916
+
917
+### overrides
918
+
919
+If you need to make specific changes to dependencies of your dependencies, for
920
+example replacing the version of a dependency with a known security issue,
921
+replacing an existing dependency with a fork, or making sure that the same
922
+version of a package is used everywhere, then you may add an override.
923
+
924
+Overrides provide a way to replace a package in your dependency tree with
925
+another version, or another package entirely. These changes can be scoped as
926
+specific or as vague as desired.
927
+
928
+To make sure the package `foo` is always installed as version `1.0.0` no matter
929
+what version your dependencies rely on:
930
+
931
+```json
932
+{
933
+ "overrides": {
934
+ "foo": "1.0.0"
935
+ }
936
+}
937
+```
938
+
939
+The above is a short hand notation, the full object form can be used to allow
940
+overriding a package itself as well as a child of the package. This will cause
941
+`foo` to always be `1.0.0` while also making `bar` at any depth beyond `foo`
942
+also `1.0.0`:
943
+
944
+```json
945
+{
946
+ "overrides": {
947
+ "foo": {
948
+ ".": "1.0.0",
949
+ "bar": "1.0.0"
950
+ }
951
+ }
952
+}
953
+```
954
+
955
+To only override `foo` to be `1.0.0` when it's a child (or grandchild, or great
956
+grandchild, etc) of the package `bar`:
957
+
958
+```json
959
+{
960
+ "overrides": {
961
+ "bar": {
962
+ "foo": "1.0.0"
963
+ }
964
+ }
965
+}
966
+```
967
+
968
+Keys can be nested to any arbitrary length. To override `foo` only when it's a
969
+child of `bar` and only when `bar` is a child of `baz`:
970
+
971
+```json
972
+{
973
+ "overrides": {
974
+ "baz": {
975
+ "bar": {
976
+ "foo": "1.0.0"
977
+ }
978
+ }
979
+ }
980
+}
981
+```
982
+
983
+The key of an override can also include a version, or range of versions.
984
+To override `foo` to `1.0.0`, but only when it's a child of `bar@2.0.0`:
985
+
986
+```json
987
+{
988
+ "overrides": {
989
+ "bar@2.0.0": {
990
+ "foo": "1.0.0"
991
+ }
992
+ }
993
+}
994
+```
995
+
996
+You may not set an override for a package that you directly depend on unless
997
+both the dependency and the override itself share the exact same spec. To make
998
+this limitation easier to deal with, overrides may also be defined as a
999
+reference to a spec for a direct dependency by prefixing the name of the
1000
+package you wish the version to match with a `$`.
1001
+
1002
+```json
1003
+{
1004
+ "dependencies": {
1005
+ "foo": "^1.0.0"
1006
+ },
1007
+ "overrides": {
1008
+ // BAD, will throw an EOVERRIDE error
1009
+ // "foo": "^2.0.0"
1010
+ // GOOD, specs match so override is allowed
1011
+ // "foo": "^1.0.0"
1012
+ // BEST, the override is defined as a reference to the dependency
1013
+ "foo": "$foo",
1014
+ // the referenced package does not need to match the overridden one
1015
+ "bar": "$foo"
1016
+ }
1017
+}
1018
+```
1019
+
1020
+### engines
1021
+
1022
+You can specify the version of node that your stuff works on:
1023
+
1024
+```json
1025
+{
1026
+ "engines": {
1027
+ "node": ">=0.10.3 <15"
1028
+ }
1029
+}
1030
+```
1031
+
1032
+And, like with dependencies, if you don't specify the version (or if you
1033
+specify "\*" as the version), then any version of node will do.
1034
+
1035
+You can also use the "engines" field to specify which versions of npm are
1036
+capable of properly installing your program. For example:
1037
+
1038
+```json
1039
+{
1040
+ "engines": {
1041
+ "npm": "~1.0.20"
1042
+ }
1043
+}
1044
+```
1045
+
1046
+Unless the user has set the
1047
+[`engine-strict` config](/cli/v10/using-npm/config#engine-strict) flag, this field is
1048
+advisory only and will only produce warnings when your package is installed as a
1049
+dependency.
1050
+
1051
+### os
1052
+
1053
+You can specify which operating systems your
1054
+module will run on:
1055
+
1056
+```json
1057
+{
1058
+ "os": [
1059
+ "darwin",
1060
+ "linux"
1061
+ ]
1062
+}
1063
+```
1064
+
1065
+You can also block instead of allowing operating systems, just prepend the
1066
+blocked os with a '!':
1067
+
1068
+```json
1069
+{
1070
+ "os": [
1071
+ "!win32"
1072
+ ]
1073
+}
1074
+```
1075
+
1076
+The host operating system is determined by `process.platform`
1077
+
1078
+It is allowed to both block and allow an item, although there isn't any
1079
+good reason to do this.
1080
+
1081
+### cpu
1082
+
1083
+If your code only runs on certain cpu architectures,
1084
+you can specify which ones.
1085
+
1086
+```json
1087
+{
1088
+ "cpu": [
1089
+ "x64",
1090
+ "ia32"
1091
+ ]
1092
+}
1093
+```
1094
+
1095
+Like the `os` option, you can also block architectures:
1096
+
1097
+```json
1098
+{
1099
+ "cpu": [
1100
+ "!arm",
1101
+ "!mips"
1102
+ ]
1103
+}
1104
+```
1105
+
1106
+The host architecture is determined by `process.arch`
1107
+
1108
+### private
1109
+
1110
+If you set `"private": true` in your package.json, then npm will refuse to
1111
+publish it.
1112
+
1113
+This is a way to prevent accidental publication of private repositories.
1114
+If you would like to ensure that a given package is only ever published to
1115
+a specific registry (for example, an internal registry), then use the
1116
+`publishConfig` dictionary described below to override the `registry`
1117
+config param at publish-time.
1118
+
1119
+### publishConfig
1120
+
1121
+This is a set of config values that will be used at publish-time. It's
1122
+especially handy if you want to set the tag, registry or access, so that
1123
+you can ensure that a given package is not tagged with "latest", published
1124
+to the global public registry or that a scoped module is private by
1125
+default.
1126
+
1127
+See [`config`](/cli/v10/using-npm/config) to see the list of config options that
1128
+can be overridden.
1129
+
1130
+### workspaces
1131
+
1132
+The optional `workspaces` field is an array of file patterns that describes
1133
+locations within the local file system that the install client should look
1134
+up to find each [workspace](/cli/v10/using-npm/workspaces) that needs to be
1135
+symlinked to the top level `node_modules` folder.
1136
+
1137
+It can describe either the direct paths of the folders to be used as
1138
+workspaces or it can define globs that will resolve to these same folders.
1139
+
1140
+In the following example, all folders located inside the folder
1141
+`./packages` will be treated as workspaces as long as they have valid
1142
+`package.json` files inside them:
1143
+
1144
+```json
1145
+{
1146
+ "name": "workspace-example",
1147
+ "workspaces": [
1148
+ "./packages/*"
1149
+ ]
1150
+}
1151
+```
1152
+
1153
+See [`workspaces`](/cli/v10/using-npm/workspaces) for more examples.
1154
+
1155
+### DEFAULT VALUES
1156
+
1157
+npm will default some values based on package contents.
1158
+
1159
+* `"scripts": {"start": "node server.js"}`
1160
+
1161
+ If there is a `server.js` file in the root of your package, then npm will
1162
+ default the `start` command to `node server.js`.
1163
+
1164
+* `"scripts":{"install": "node-gyp rebuild"}`
1165
+
1166
+ If there is a `binding.gyp` file in the root of your package and you have
1167
+ not defined an `install` or `preinstall` script, npm will default the
1168
+ `install` command to compile using node-gyp.
1169
+
1170
+* `"contributors": [...]`
1171
+
1172
+ If there is an `AUTHORS` file in the root of your package, npm will treat
1173
+ each line as a `Name <email> (url)` format, where email and url are
1174
+ optional. Lines which start with a `#` or are blank, will be ignored.
1175
+
1176
+### SEE ALSO
1177
+
1178
+* [semver](https://github.com/npm/node-semver#versions)
1179
+* [workspaces](/cli/v10/using-npm/workspaces)
1180
+* [npm init](/cli/v10/commands/npm-init)
1181
+* [npm version](/cli/v10/commands/npm-version)
1182
+* [npm config](/cli/v10/commands/npm-config)
1183
+* [npm help](/cli/v10/commands/npm-help)
1184
+* [npm install](/cli/v10/commands/npm-install)
1185
+* [npm publish](/cli/v10/commands/npm-publish)
1186
+* [npm uninstall](/cli/v10/commands/npm-uninstall)
content/cli/v10/configuring-npm/package-lock-json.md
new
+246
@@ -0,0 +1,246 @@
1
+---
2
+title: package-lock.json
3
+section: 5
4
+description: A manifestation of the manifest
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/configuring-npm/package-lock-json.md
8
+redirect_from:
9
+ - /cli-documentation/v10/configuring-npm/package-lock-json
10
+ - /cli-documentation/v10/configuring-npm/package-lock.json
11
+ - /cli-documentation/v10/files/package-lock-json
12
+ - /cli-documentation/v10/files/package-lock.json
13
+ - /cli/v10/configuring-npm/package-lock.json
14
+ - /cli/v10/files/package-lock-json
15
+ - /cli/v10/files/package-lock.json
16
+---
17
+
18
+### Description
19
+
20
+`package-lock.json` is automatically generated for any operations where npm
21
+modifies either the `node_modules` tree, or `package.json`. It describes the
22
+exact tree that was generated, such that subsequent installs are able to
23
+generate identical trees, regardless of intermediate dependency updates.
24
+
25
+This file is intended to be committed into source repositories, and serves
26
+various purposes:
27
+
28
+* Describe a single representation of a dependency tree such that
29
+ teammates, deployments, and continuous integration are guaranteed to
30
+ install exactly the same dependencies.
31
+
32
+* Provide a facility for users to "time-travel" to previous states of
33
+ `node_modules` without having to commit the directory itself.
34
+
35
+* Facilitate greater visibility of tree changes through readable source
36
+ control diffs.
37
+
38
+* Optimize the installation process by allowing npm to skip repeated
39
+ metadata resolutions for previously-installed packages.
40
+
41
+* As of npm v7, lockfiles include enough information to gain a complete
42
+ picture of the package tree, reducing the need to read `package.json`
43
+ files, and allowing for significant performance improvements.
44
+
45
+### `package-lock.json` vs `npm-shrinkwrap.json`
46
+
47
+Both of these files have the same format, and perform similar functions in
48
+the root of a project.
49
+
50
+The difference is that `package-lock.json` cannot be published, and it will
51
+be ignored if found in any place other than the root project.
52
+
53
+In contrast, [npm-shrinkwrap.json](/cli/v10/configuring-npm/npm-shrinkwrap-json) allows
54
+publication, and defines the dependency tree from the point encountered.
55
+This is not recommended unless deploying a CLI tool or otherwise using the
56
+publication process for producing production packages.
57
+
58
+If both `package-lock.json` and `npm-shrinkwrap.json` are present in the
59
+root of a project, `npm-shrinkwrap.json` will take precedence and
60
+`package-lock.json` will be ignored.
61
+
62
+### Hidden Lockfiles
63
+
64
+In order to avoid processing the `node_modules` folder repeatedly, npm as
65
+of v7 uses a "hidden" lockfile present in
66
+`node_modules/.package-lock.json`. This contains information about the
67
+tree, and is used in lieu of reading the entire `node_modules` hierarchy
68
+provided that the following conditions are met:
69
+
70
+- All package folders it references exist in the `node_modules` hierarchy.
71
+- No package folders exist in the `node_modules` hierarchy that are not
72
+ listed in the lockfile.
73
+- The modified time of the file is at least as recent as all of the package
74
+ folders it references.
75
+
76
+That is, the hidden lockfile will only be relevant if it was created as
77
+part of the most recent update to the package tree. If another CLI mutates
78
+the tree in any way, this will be detected, and the hidden lockfile will be
79
+ignored.
80
+
81
+Note that it _is_ possible to manually change the _contents_ of a package
82
+in such a way that the modified time of the package folder is unaffected.
83
+For example, if you add a file to `node_modules/foo/lib/bar.js`, then the
84
+modified time on `node_modules/foo` will not reflect this change. If you
85
+are manually editing files in `node_modules`, it is generally best to
86
+delete the file at `node_modules/.package-lock.json`.
87
+
88
+As the hidden lockfile is ignored by older npm versions, it does not
89
+contain the backwards compatibility affordances present in "normal"
90
+lockfiles. That is, it is `lockfileVersion: 3`, rather than
91
+`lockfileVersion: 2`.
92
+
93
+### Handling Old Lockfiles
94
+
95
+When npm detects a lockfile from npm v6 or before during the package
96
+installation process, it is automatically updated to fetch missing
97
+information from either the `node_modules` tree or (in the case of empty
98
+`node_modules` trees or very old lockfile formats) the npm registry.
99
+
100
+### File Format
101
+
102
+#### `name`
103
+
104
+The name of the package this is a package-lock for. This will match what's
105
+in `package.json`.
106
+
107
+#### `version`
108
+
109
+The version of the package this is a package-lock for. This will match
110
+what's in `package.json`.
111
+
112
+#### `lockfileVersion`
113
+
114
+An integer version, starting at `1` with the version number of this
115
+document whose semantics were used when generating this
116
+`package-lock.json`.
117
+
118
+Note that the file format changed significantly in npm v7 to track
119
+information that would have otherwise required looking in `node_modules` or
120
+the npm registry. Lockfiles generated by npm v7 will contain
121
+`lockfileVersion: 2`.
122
+
123
+* No version provided: an "ancient" shrinkwrap file from a version of npm
124
+ prior to npm v5.
125
+* `1`: The lockfile version used by npm v5 and v6.
126
+* `2`: The lockfile version used by npm v7 and v8. Backwards compatible to v1
127
+ lockfiles.
128
+* `3`: The lockfile version used by npm v9. Backwards compatible to npm v7.
129
+
130
+npm will always attempt to get whatever data it can out of a lockfile, even
131
+if it is not a version that it was designed to support.
132
+
133
+#### `packages`
134
+
135
+This is an object that maps package locations to an object containing the
136
+information about that package.
137
+
138
+The root project is typically listed with a key of `""`, and all other
139
+packages are listed with their relative paths from the root project folder.
140
+
141
+Package descriptors have the following fields:
142
+
143
+* version: The version found in `package.json`
144
+
145
+* resolved: The place where the package was actually resolved from. In
146
+ the case of packages fetched from the registry, this will be a url to a
147
+ tarball. In the case of git dependencies, this will be the full git url
148
+ with commit sha. In the case of link dependencies, this will be the
149
+ location of the link target. `registry.npmjs.org` is a magic value meaning
150
+ "the currently configured registry".
151
+
152
+* integrity: A `sha512` or `sha1` [Standard Subresource
153
+ Integrity](https://w3c.github.io/webappsec/specs/subresourceintegrity/)
154
+ string for the artifact that was unpacked in this location.
155
+
156
+* link: A flag to indicate that this is a symbolic link. If this is
157
+ present, no other fields are specified, since the link target will also
158
+ be included in the lockfile.
159
+
160
+* dev, optional, devOptional: If the package is strictly part of the
161
+ `devDependencies` tree, then `dev` will be true. If it is strictly part
162
+ of the `optionalDependencies` tree, then `optional` will be set. If it
163
+ is both a `dev` dependency _and_ an `optional` dependency of a non-dev
164
+ dependency, then `devOptional` will be set. (An `optional` dependency of
165
+ a `dev` dependency will have both `dev` and `optional` set.)
166
+
167
+* inBundle: A flag to indicate that the package is a bundled dependency.
168
+
169
+* hasInstallScript: A flag to indicate that the package has a `preinstall`,
170
+ `install`, or `postinstall` script.
171
+
172
+* hasShrinkwrap: A flag to indicate that the package has an
173
+ `npm-shrinkwrap.json` file.
174
+
175
+* bin, license, engines, dependencies, optionalDependencies: fields from
176
+ `package.json`
177
+
178
+#### dependencies
179
+
180
+Legacy data for supporting versions of npm that use `lockfileVersion: 1`.
181
+This is a mapping of package names to dependency objects. Because the
182
+object structure is strictly hierarchical, symbolic link dependencies are
183
+somewhat challenging to represent in some cases.
184
+
185
+npm v7 ignores this section entirely if a `packages` section is present,
186
+but does keep it up to date in order to support switching between npm v6
187
+and npm v7.
188
+
189
+Dependency objects have the following fields:
190
+
191
+* version: a specifier that varies depending on the nature of the package,
192
+ and is usable in fetching a new copy of it.
193
+
194
+ * bundled dependencies: Regardless of source, this is a version number
195
+ that is purely for informational purposes.
196
+ * registry sources: This is a version number. (eg, `1.2.3`)
197
+ * git sources: This is a git specifier with resolved committish. (eg,
198
+ `git+https://example.com/foo/bar#115311855adb0789a0466714ed48a1499ffea97e`)
199
+ * http tarball sources: This is the URL of the tarball. (eg,
200
+ `https://example.com/example-1.3.0.tgz`)
201
+ * local tarball sources: This is the file URL of the tarball. (eg
202
+ `file:///opt/storage/example-1.3.0.tgz`)
203
+ * local link sources: This is the file URL of the link. (eg
204
+ `file:libs/our-module`)
205
+
206
+* integrity: A `sha512` or `sha1` [Standard Subresource
207
+ Integrity](https://w3c.github.io/webappsec/specs/subresourceintegrity/)
208
+ string for the artifact that was unpacked in this location. For git
209
+ dependencies, this is the commit sha.
210
+
211
+* resolved: For registry sources this is path of the tarball relative to
212
+ the registry URL. If the tarball URL isn't on the same server as the
213
+ registry URL then this is a complete URL. `registry.npmjs.org` is a magic
214
+ value meaning "the currently configured registry".
215
+
216
+* bundled: If true, this is the bundled dependency and will be installed
217
+ by the parent module. When installing, this module will be extracted
218
+ from the parent module during the extract phase, not installed as a
219
+ separate dependency.
220
+
221
+* dev: If true then this dependency is either a development dependency ONLY
222
+ of the top level module or a transitive dependency of one. This is false
223
+ for dependencies that are both a development dependency of the top level
224
+ and a transitive dependency of a non-development dependency of the top
225
+ level.
226
+
227
+* optional: If true then this dependency is either an optional dependency
228
+ ONLY of the top level module or a transitive dependency of one. This is
229
+ false for dependencies that are both an optional dependency of the top
230
+ level and a transitive dependency of a non-optional dependency of the top
231
+ level.
232
+
233
+* requires: This is a mapping of module name to version. This is a list of
234
+ everything this module requires, regardless of where it will be
235
+ installed. The version should match via normal matching rules a
236
+ dependency either in our `dependencies` or in a level higher than us.
237
+
238
+* dependencies: The dependencies of this dependency, exactly as at the top
239
+ level.
240
+
241
+### See also
242
+
243
+* [npm shrinkwrap](/cli/v10/commands/npm-shrinkwrap)
244
+* [npm-shrinkwrap.json](/cli/v10/configuring-npm/npm-shrinkwrap-json)
245
+* [package.json](/cli/v10/configuring-npm/package-json)
246
+* [npm install](/cli/v10/commands/npm-install)
content/cli/v10/index.mdx
new
+13
@@ -0,0 +1,13 @@
1
+---
2
+title: npm CLI
3
+shortName: CLI
4
+github_repo: npm/cli
5
+github_branch: latest
6
+github_path: docs/lib/content/nav.yml
7
+redirect_from:
8
+ - /cli-documentation/v10
9
+ - /cli-documentation/v10/index
10
+ - /cli/v10/index
11
+---
12
+
13
+<Index depth="1" />
content/cli/v10/using-npm/changelog.md
new
+1086
@@ -0,0 +1,1086 @@
1
+---
2
+title: Changelog
3
+github_repo: npm/cli
4
+github_branch: latest
5
+github_path: CHANGELOG.md
6
+redirect_from:
7
+ - /cli-documentation/v10/misc/changelog
8
+ - /cli-documentation/v10/using-npm/changelog
9
+ - /cli/v10/misc/changelog
10
+---
11
+
12
+# Changelog
13
+
14
+## [10.0.0](https://github.com/npm/cli/compare/v10.0.0-pre.1...v10.0.0) (2023-08-31)
15
+
16
+### Features
17
+
18
+* [`48a7b07`](https://github.com/npm/cli/commit/48a7b077d70cbe5bc808db6aae2c734aa202938a) remove prerelease flags (@lukekarrys)
19
+
20
+### Dependencies
21
+
22
+* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v7.0.0): `@npmcli/arborist@7.0.0`
23
+* [Workspace](https://github.com/npm/cli/releases/tag/config-v7.1.0): `@npmcli/config@7.1.0`
24
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmaccess-v8.0.0): `libnpmaccess@8.0.0`
25
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v6.0.0): `libnpmdiff@6.0.0`
26
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v7.0.0): `libnpmexec@7.0.0`
27
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.1.0): `libnpmfund@4.1.0`
28
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmhook-v10.0.0): `libnpmhook@10.0.0`
29
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmorg-v6.0.0): `libnpmorg@6.0.0`
30
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v6.0.0): `libnpmpack@6.0.0`
31
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v9.0.0): `libnpmpublish@9.0.0`
32
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmsearch-v7.0.0): `libnpmsearch@7.0.0`
33
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmteam-v6.0.0): `libnpmteam@6.0.0`
34
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmversion-v5.0.0): `libnpmversion@5.0.0`
35
+
36
+## [10.0.0-pre.1](https://github.com/npm/cli/compare/v10.0.0-pre.0...v10.0.0-pre.1) (2023-08-31)
37
+
38
+### ⚠️ BREAKING CHANGES
39
+
40
+* support for node <=16.13 has been removed
41
+* support for node 14 has been removed
42
+* support for node 14 has been removed
43
+* support for node 14 has been removed
44
+* support for node 14 has been removed
45
+* support for node 14 has been removed
46
+* support for node 14 has been removed
47
+* support for node 14 has been removed
48
+* support for node 14 has been removed
49
+* support for node 14 has been removed
50
+* support for node 14 has been removed
51
+
52
+### Bug Fixes
53
+
54
+* [`b34ee65`](https://github.com/npm/cli/commit/b34ee65ad1c82b53d5b5b28595203e18163fe4df) [#6706](https://github.com/npm/cli/pull/6706) set objectMode for search filter stream (@lukekarrys)
55
+* [`6b251b1`](https://github.com/npm/cli/commit/6b251b1009648b36d49b83a2cc407c348fa225e0) [#6706](https://github.com/npm/cli/pull/6706) drop node 16.13.x support (@lukekarrys)
56
+* [`d857c4a`](https://github.com/npm/cli/commit/d857c4ac7321211848076d148a4bea46af7058fd) [#6706](https://github.com/npm/cli/pull/6706) drop node14 support (@lukekarrys)
57
+* [`37a99eb`](https://github.com/npm/cli/commit/37a99eb98b8846ab9481cc4ebd7a7278a8bc89bd) [#6706](https://github.com/npm/cli/pull/6706) drop node14 support (@lukekarrys)
58
+* [`ee7292e`](https://github.com/npm/cli/commit/ee7292ed78c362927736471e0584217b2000f493) [#6706](https://github.com/npm/cli/pull/6706) drop node14 support (@lukekarrys)
59
+* [`8b0e755`](https://github.com/npm/cli/commit/8b0e755b78098d9c0800e69f0cc2f6a457ce28a6) [#6706](https://github.com/npm/cli/pull/6706) drop node14 support (@lukekarrys)
60
+* [`5c8c6cc`](https://github.com/npm/cli/commit/5c8c6ccc0be6e544f6884ecc1189de02450b7dfc) [#6706](https://github.com/npm/cli/pull/6706) drop node14 support (@lukekarrys)
61
+* [`d431647`](https://github.com/npm/cli/commit/d4316479a7894290586718e412d7c670316a36f2) [#6706](https://github.com/npm/cli/pull/6706) drop node14 support (@lukekarrys)
62
+* [`b6f2205`](https://github.com/npm/cli/commit/b6f220569791d655ab3c423990356cee47ca5218) [#6706](https://github.com/npm/cli/pull/6706) drop node14 support (@lukekarrys)
63
+* [`4caedd0`](https://github.com/npm/cli/commit/4caedd0e49641e9f1757f5622e5845b5b49c56c1) [#6706](https://github.com/npm/cli/pull/6706) drop node14 support (@lukekarrys)
64
+* [`355bac8`](https://github.com/npm/cli/commit/355bac87eb66b105c9f0c2338ae37fed5f973b66) [#6706](https://github.com/npm/cli/pull/6706) drop node14 support (@lukekarrys)
65
+* [`e3a377d`](https://github.com/npm/cli/commit/e3a377d3b047c0436e05096d70cc5697714e413d) [#6706](https://github.com/npm/cli/pull/6706) drop node14 support (@lukekarrys)
66
+* [`f916d33`](https://github.com/npm/cli/commit/f916d333c16b4f0433d8a304e856b73ed4f949cd) [#6715](https://github.com/npm/cli/pull/6715) allow searching packages with no description (@lukekarrys)
67
+
68
+### Documentation
69
+
70
+* [`c736b62`](https://github.com/npm/cli/commit/c736b622b8504b07f5a19f631ade42dd40063269) [#6686](https://github.com/npm/cli/pull/6686) add missing bugs key in package-json.md (#6686) (@airscripts)
71
+* [`c1e01d9`](https://github.com/npm/cli/commit/c1e01d97da3b775edf104de158ee5db5cf027d0d) [#6680](https://github.com/npm/cli/pull/6680) Update package-json.md (#6680) (@p-chan, @ljharb)
72
+
73
+### Dependencies
74
+
75
+* [`5ab3f7e`](https://github.com/npm/cli/commit/5ab3f7e944b12481cb1164175c7a79d24d5e3ac5) [#6706](https://github.com/npm/cli/pull/6706) `@npmcli/git@5.0.3`
76
+* [`eb41977`](https://github.com/npm/cli/commit/eb41977c56cbac88fa7d02f88dbf630cc652471a) [#6706](https://github.com/npm/cli/pull/6706) `@npmcli/run-script@7.0.1`
77
+* [`f30c9e3`](https://github.com/npm/cli/commit/f30c9e30c2a6d777ea31157a90fddadc81fd11d0) [#6706](https://github.com/npm/cli/pull/6706) `@npmcli/git@5.0.2`
78
+* [`f334466`](https://github.com/npm/cli/commit/f334466c53669e7debd4b9c67eafca74955509ee) [#6706](https://github.com/npm/cli/pull/6706) `pacote@17.0.4`
79
+* [`bb63bf9`](https://github.com/npm/cli/commit/bb63bf945b2db8f3074e7429aff6343721c55cd1) [#6706](https://github.com/npm/cli/pull/6706) `@npmcli/run-script@7.0.0`
80
+* [`75642c6`](https://github.com/npm/cli/commit/75642c6041195e093ef15ee2a42e1fc6a381c572) [#6706](https://github.com/npm/cli/pull/6706) `@npmcli/promise-spawn@7.0.0`
81
+* [`dbb18f4`](https://github.com/npm/cli/commit/dbb18f4778a97915cd8bbb737a807f3db51c4619) [#6706](https://github.com/npm/cli/pull/6706) `@npmcli/agent@2.1.0`
82
+* [`812aa6d`](https://github.com/npm/cli/commit/812aa6d2027ed42453b86b22f4cf8de25f6e0180) [#6706](https://github.com/npm/cli/pull/6706) `sigstore@2.1.0`
83
+* [`7fab9d3`](https://github.com/npm/cli/commit/7fab9d3d2efd71f505658216dc44d802bc3203a6) [#6706](https://github.com/npm/cli/pull/6706) `@sigstore/tuf@2.1.0`
84
+* [`12337cc`](https://github.com/npm/cli/commit/12337cc9d43bae2c5ad75e295b6a4d70e15a39cf) [#6706](https://github.com/npm/cli/pull/6706) `which@4.0.0`
85
+* [`b1ad3ad`](https://github.com/npm/cli/commit/b1ad3ad194d046aa6209a4efad961429b379393c) [#6706](https://github.com/npm/cli/pull/6706) `npm-packlist@8.0.0`
86
+* [`43831d0`](https://github.com/npm/cli/commit/43831d0fe4b02cb18d1c533f2831aaeedf5102e1) [#6706](https://github.com/npm/cli/pull/6706) `pacote@17.0.3`
87
+* [`44e8fec`](https://github.com/npm/cli/commit/44e8fec3f28ce3bdd0500b92cbcf8f211da3c866) [#6706](https://github.com/npm/cli/pull/6706) `pacote@17.0.2`
88
+* [`0d2e2c9`](https://github.com/npm/cli/commit/0d2e2c9d09ff760d8db09774fcd7ad417a88c4c7) [#6706](https://github.com/npm/cli/pull/6706) bump sigstore from 1.7.0 to 2.0.0
89
+* [`dbd5885`](https://github.com/npm/cli/commit/dbd5885364648d3f2fe1c7b672e8aeadcd06edd1) [#6706](https://github.com/npm/cli/pull/6706) `npm-profile@9.0.0`
90
+* [`2ee0fb3`](https://github.com/npm/cli/commit/2ee0fb3ac0c5e49f9eba545d6b05e20be1352414) [#6706](https://github.com/npm/cli/pull/6706) `npm-registry-fetch@16.0.0`
91
+* [`81ff4df`](https://github.com/npm/cli/commit/81ff4dfd17024efb068816c9b0824ffc709a7cc4) [#6706](https://github.com/npm/cli/pull/6706) `pacote@17.0.1`
92
+* [`2b23d44`](https://github.com/npm/cli/commit/2b23d44a9f0f01370d4999853aedecec4f1d8dd3) [#6706](https://github.com/npm/cli/pull/6706) hoist `read-package-json@7.0.0`
93
+* [`325ed05`](https://github.com/npm/cli/commit/325ed05be53b57096727fb962925bf362edf9730) [#6706](https://github.com/npm/cli/pull/6706) hoist `normalize-package-data@6.0.0`
94
+* [`c3a1a02`](https://github.com/npm/cli/commit/c3a1a021780d948a3023b622700b98aabb0df2f4) [#6706](https://github.com/npm/cli/pull/6706) `@npmcli/metavuln-calculator@7.0.0`
95
+* [`f1dd130`](https://github.com/npm/cli/commit/f1dd1305fdcba0b7f5496223b5a65f0fe7e29975) [#6706](https://github.com/npm/cli/pull/6706) `@npmcli/git@5.0.1`
96
+* [`10792ea`](https://github.com/npm/cli/commit/10792ea951a3ef8fc138f82d7b81484006213ce9) [#6706](https://github.com/npm/cli/pull/6706) `init-package-json@6.0.0`
97
+* [`cac0725`](https://github.com/npm/cli/commit/cac07256e7234d0782a4833dae207732c71fef95) [#6706](https://github.com/npm/cli/pull/6706) `pacote@17.0.0`
98
+* [`fd8beaf`](https://github.com/npm/cli/commit/fd8beaf4de23b8fbd9d5b968e10a5034d1a8f7bd) [#6706](https://github.com/npm/cli/pull/6706) `npm-pick-manifest@9.0.0`
99
+* [`65f435e`](https://github.com/npm/cli/commit/65f435ee0a088d6593d8e985c2519cdd783f9a6d) [#6706](https://github.com/npm/cli/pull/6706) hoist `lru-cache@10.0.1`
100
+* [`c784b57`](https://github.com/npm/cli/commit/c784b57b654d25e8d932e6fe415b87e75dcf9026) [#6706](https://github.com/npm/cli/pull/6706) `npm-package-arg@11.0.0`
101
+* [`d6b1790`](https://github.com/npm/cli/commit/d6b1790492d9bc96c196d85d8fc9fd98d62d0087) [#6706](https://github.com/npm/cli/pull/6706) `normalize-package-data@6.0.0`
102
+* [`2f03fb9`](https://github.com/npm/cli/commit/2f03fb9d8f25fd2b047d46edb608eb75f1f36017) [#6706](https://github.com/npm/cli/pull/6706) `make-fetch-happen@13.0.0`
103
+* [`729e893`](https://github.com/npm/cli/commit/729e893cf610de725142f72cc344d1c11f42d7af) [#6706](https://github.com/npm/cli/pull/6706) `hosted-git-info@7.0.0`
104
+* [`7af81c7`](https://github.com/npm/cli/commit/7af81c7360a6df31cdb0a8f18104b42656166378) [#6706](https://github.com/npm/cli/pull/6706) `cacache@18.0.0`
105
+* [`b0849ab`](https://github.com/npm/cli/commit/b0849ab6feb62bf307ee362389bfcaf0e85653be) [#6706](https://github.com/npm/cli/pull/6706) `@npmcli/package-json@5.0.0`
106
+* [`c9587d7`](https://github.com/npm/cli/commit/c9587d79c7c02aff4f53b093bf6702026ecea53a) [#6706](https://github.com/npm/cli/pull/6706) `@npmcli/git@5.0.0`
107
+* [`e28d426`](https://github.com/npm/cli/commit/e28d42674deb791d862e07756bb453190773e6ec) [#6706](https://github.com/npm/cli/pull/6706) `minipass-fetch@3.0.4`
108
+* [`61e9b00`](https://github.com/npm/cli/commit/61e9b00e096ce2e3122f1b21d22f3073ff22f2ce) [#6706](https://github.com/npm/cli/pull/6706) `@npmcli/metavuln-calculator@6.0.1`
109
+* [`2c5542d`](https://github.com/npm/cli/commit/2c5542d29ba207e7c5c4337ac9ad7f296188508a) [#6706](https://github.com/npm/cli/pull/6706) `minipass@7.0.3`
110
+* [`ede7f5e`](https://github.com/npm/cli/commit/ede7f5e74ad4d88559fec2532ddba2facbd7af7f) [#6706](https://github.com/npm/cli/pull/6706) `glob@10.3.3`
111
+* [`4c9eb17`](https://github.com/npm/cli/commit/4c9eb1703bd41555e4ef7c2fc087a349b90c9b4c) [#6706](https://github.com/npm/cli/pull/6706) `npm-install-checks@6.2.0`
112
+* [`88ece81`](https://github.com/npm/cli/commit/88ece8161021997cb5c22040b34d0dffff55fcf1) [#6706](https://github.com/npm/cli/pull/6706) `npm-pick-manifest@8.0.2`
113
+* [`9117a4f`](https://github.com/npm/cli/commit/9117a4fcf05291ce7609bcad5bb810df9a5158e7) [#6706](https://github.com/npm/cli/pull/6706) `ssri@10.0.5`
114
+* [`45f8d6f`](https://github.com/npm/cli/commit/45f8d6f15f82067f27d56357159a7f965b857f5d) [#6706](https://github.com/npm/cli/pull/6706) `make-fetch-happen@12.0.0`
115
+* [`f6f6a18`](https://github.com/npm/cli/commit/f6f6a18120b31626259cdd4da834524a034aa4cb) [#6706](https://github.com/npm/cli/pull/6706) `fs-minipass@3.0.3`
116
+* [`5eea975`](https://github.com/npm/cli/commit/5eea975437ab27d02afa2aaee59b2d4f98831df3) [#6706](https://github.com/npm/cli/pull/6706) `cacache@17.1.4`
117
+* [`ca33c98`](https://github.com/npm/cli/commit/ca33c9840533435bda634adefb61757f30fad5ab) [#6706](https://github.com/npm/cli/pull/6706) `@npmcli/metavuln-calculator@6.0.0`
118
+* [`7be541a`](https://github.com/npm/cli/commit/7be541a7a82cf1fb0de58953605b69c058f7efe0) [#6706](https://github.com/npm/cli/pull/6706) `npm-profile@8.0.0`
119
+* [`edbc25a`](https://github.com/npm/cli/commit/edbc25a5980c34e0d28aac7503475cd33e07f7d2) [#6706](https://github.com/npm/cli/pull/6706) `pacote@16.0.0`
120
+* [`5d0d859`](https://github.com/npm/cli/commit/5d0d8592cbf3b816d9fe44c36d390200ec15e87a) [#6706](https://github.com/npm/cli/pull/6706) `npm-registry-fetch@15.0.0`
121
+* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v7.0.0-pre.0): `@npmcli/arborist@7.0.0-pre.0`
122
+* [Workspace](https://github.com/npm/cli/releases/tag/config-v7.0.1): `@npmcli/config@7.0.1`
123
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmaccess-v8.0.0-pre.0): `libnpmaccess@8.0.0-pre.0`
124
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v6.0.0-pre.0): `libnpmdiff@6.0.0-pre.0`
125
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v7.0.0-pre.0): `libnpmexec@7.0.0-pre.0`
126
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.20): `libnpmfund@4.0.20`
127
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmhook-v10.0.0-pre.0): `libnpmhook@10.0.0-pre.0`
128
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmorg-v6.0.0-pre.0): `libnpmorg@6.0.0-pre.0`
129
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v6.0.0-pre.0): `libnpmpack@6.0.0-pre.0`
130
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v9.0.0-pre.0): `libnpmpublish@9.0.0-pre.0`
131
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmsearch-v7.0.0-pre.0): `libnpmsearch@7.0.0-pre.0`
132
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmteam-v6.0.0-pre.0): `libnpmteam@6.0.0-pre.0`
133
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmversion-v5.0.0-pre.0): `libnpmversion@5.0.0-pre.0`
134
+
135
+## [10.0.0-pre.0](https://github.com/npm/cli/compare/v9.8.1...v10.0.0-pre.0) (2023-07-26)
136
+
137
+### ⚠️ BREAKING CHANGES
138
+
139
+* the "ci-name" config has been removed
140
+* npm no longer treats missing scripts as a special case in workspace mode. Use `if-present` to ignore missing scripts.
141
+* npm now supports node `^18.17.0 || \>=20.5.0`
142
+
143
+### Features
144
+
145
+* [`b6cf113`](https://github.com/npm/cli/commit/b6cf113f5199d3c23f632dbe35d8020515c6c623) [#6674](https://github.com/npm/cli/pull/6674) set engines and prerelease for npm 10 (#6674) (@lukekarrys)
146
+
147
+### Bug Fixes
148
+
149
+* [`e0d3edd`](https://github.com/npm/cli/commit/e0d3edd9908f8303abb9941bdd2f6e9aa31bc9d7) [#6641](https://github.com/npm/cli/pull/6641) remove "ci-name" config (@wraithgar)
150
+* [`0318f44`](https://github.com/npm/cli/commit/0318f442fe6c18275607a5d574c383f085484e6e) [#6641](https://github.com/npm/cli/pull/6641) remove implicit if-present logic from run-script workspaces (@wraithgar)
151
+
152
+### Documentation
153
+
154
+* [`e5338af`](https://github.com/npm/cli/commit/e5338af3ca5d1aea78348f4894481eef3b1f7354) [#6672](https://github.com/npm/cli/pull/6672) remove link to deprecated `npm set-script` command (#6672) (@emmanuel-ferdman)
155
+
156
+### Dependencies
157
+
158
+* [Workspace](https://github.com/npm/cli/releases/tag/config-v7.0.0): `@npmcli/config@7.0.0`
159
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v8.0.0): `libnpmpublish@8.0.0`
160
+
161
+## [9.8.1](https://github.com/npm/cli/compare/v9.8.0...v9.8.1) (2023-07-18)
162
+
163
+### Bug Fixes
164
+
165
+* [`38351c9`](https://github.com/npm/cli/commit/38351c954040ddea56dc5db453f7f7d10964e5cd) [#6651](https://github.com/npm/cli/pull/6651) warn on autocorrected package.json entries during publish (@wraithgar)
166
+* [`02c7ddb`](https://github.com/npm/cli/commit/02c7ddb4501682c9e84b8c1325638b7db1ca7deb) [#6642](https://github.com/npm/cli/pull/6642) much clearer npx 'canceled' error (#6642) (@rahulio96, @AaronHamilton965)
167
+
168
+### Documentation
169
+
170
+* [`36bf5fe`](https://github.com/npm/cli/commit/36bf5fe2a0a2ef7f7ffc0b302eea15e227556010) [#6643](https://github.com/npm/cli/pull/6643) Added steps for using npm/npx locally to CONTRIBUTING.md (#6643) (@AaronHamilton965, @rahulio96)
171
+
172
+### Dependencies
173
+
174
+* [`a0763d3`](https://github.com/npm/cli/commit/a0763d38d8934a6769e5aac08539291c5051f36e) [#6651](https://github.com/npm/cli/pull/6651) `@npmcli/package-json@4.0.1`
175
+* [`24f5a8b`](https://github.com/npm/cli/commit/24f5a8b07909710e06f5aa3844d99c03cce0b9ca) [#6653](https://github.com/npm/cli/pull/6653) `supports-color@9.4.0`
176
+* [`f45498b`](https://github.com/npm/cli/commit/f45498b33550d3874b9602ef027f215ea2590124) [#6653](https://github.com/npm/cli/pull/6653) `chalk@5.3.0`
177
+* [`44d60eb`](https://github.com/npm/cli/commit/44d60eb0c4ee0456ee4c9f855f06348cfb4c0f9c) [#6653](https://github.com/npm/cli/pull/6653) `minimatch@9.0.3`
178
+* [`fc9a843`](https://github.com/npm/cli/commit/fc9a843f59ec4c1733d427566b9df9a4b440bb7f) [#6653](https://github.com/npm/cli/pull/6653) `bin-links@3.0.2`
179
+* [`daad9ad`](https://github.com/npm/cli/commit/daad9addc1e2587d162e06016498252cf0b6514a) [#6653](https://github.com/npm/cli/pull/6653) `semver@7.5.4`
180
+* [`c1ffd6a`](https://github.com/npm/cli/commit/c1ffd6a2f91cdb5c8d3cd7524a3136346181f67f) [#6653](https://github.com/npm/cli/pull/6653) move @npmcli/fs, @npmcli/promise-spawn into dependencies
181
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v6.0.3): `libnpmexec@6.0.3`
182
+
183
+## [9.8.0](https://github.com/npm/cli/compare/v9.7.2...v9.8.0) (2023-07-05)
184
+
185
+### Features
186
+
187
+* [`67459e7`](https://github.com/npm/cli/commit/67459e7b56a5e8d2b4f8eb3a0487183013c63b99) [#6626](https://github.com/npm/cli/pull/6626) add `pkg fix` subcommand (@wraithgar)
188
+* [`89b2741`](https://github.com/npm/cli/commit/89b27413952ca454f715fee314d37e26f371444d) [#6548](https://github.com/npm/cli/pull/6548) add ps1 scripts (#6548) (@mribbons, @lukekarrys)
189
+
190
+### Dependencies
191
+
192
+* [`b252164`](https://github.com/npm/cli/commit/b252164dd5c866bf2d25c96836ad829d4d6909ee) [#6626](https://github.com/npm/cli/pull/6626) `@npmcli/package-json@4.0.0`
193
+* [`9238682`](https://github.com/npm/cli/commit/92386822ddf0a849fd2c269b1f5ee9ee47082da0) [#6623](https://github.com/npm/cli/pull/6623) `sigstore@1.7.0` (#6623)
194
+* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.3.0): `@npmcli/arborist@6.3.0`
195
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.19): `libnpmdiff@5.0.19`
196
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v6.0.2): `libnpmexec@6.0.2`
197
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.19): `libnpmfund@4.0.19`
198
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.19): `libnpmpack@5.0.19`
199
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v7.5.0): `libnpmpublish@7.5.0`
200
+
201
+## [9.7.2](https://github.com/npm/cli/compare/v9.7.1...v9.7.2) (2023-06-21)
202
+
203
+### Bug Fixes
204
+
205
+* [`939a188`](https://github.com/npm/cli/commit/939a188bc3ab9c2bfa49ccb4837fe4ad844131ed) [#6574](https://github.com/npm/cli/pull/6574) ignore node prereleases in npm engines check (#6574) (@wraithgar)
206
+* [`d980405`](https://github.com/npm/cli/commit/d980405ffcbc80ad63fbea680ee40a57ffc4a210) [#6556](https://github.com/npm/cli/pull/6556) better color support detection (#6556) (@lukekarrys)
207
+* [`40d7e09`](https://github.com/npm/cli/commit/40d7e09aa9c038bc20e37c4fbd21d02dc82b93a7) [#6555](https://github.com/npm/cli/pull/6555) remove unnecessary package.json values (#6555) (@lukekarrys)
208
+* [`3a7378d`](https://github.com/npm/cli/commit/3a7378d889707d2a4c1f8a6397dda87825e9f5a3) [#6554](https://github.com/npm/cli/pull/6554) cleanup bin contents (@lukekarrys)
209
+* [`e722439`](https://github.com/npm/cli/commit/e722439b05bb4da691975359db58eac794f1f5d9) [#6497](https://github.com/npm/cli/pull/6497) move all definitions to @npmcli/config package (@lukekarrys)
210
+
211
+### Documentation
212
+
213
+* [`405ffbf`](https://github.com/npm/cli/commit/405ffbfa2758ec388c06120fdf5fde2a07835779) [#6557](https://github.com/npm/cli/pull/6557) remove redundant statement about files attribute (#6557) (@DaviDevMod)
214
+* [`cd1e6aa`](https://github.com/npm/cli/commit/cd1e6aa320ccc264f5027de5976bb7acc32f1ded) [#6551](https://github.com/npm/cli/pull/6551) add flag `package-lock-only` for `npm install` (#6551) (@m4rch3n1ng)
215
+
216
+### Dependencies
217
+
218
+* [`aebc523`](https://github.com/npm/cli/commit/aebc523c46f6e37c943a750e4cb6ec4b8f12ae01) [#6585](https://github.com/npm/cli/pull/6585) `safe-buffer@5.2.1` `string_decoder@1.3.0` (#6585)
219
+* [`bb6054b`](https://github.com/npm/cli/commit/bb6054b9558efd859e32ba9227453b3c84ef647d) [#6573](https://github.com/npm/cli/pull/6573) `tuf-js@1.1.7`
220
+* [`aee4a30`](https://github.com/npm/cli/commit/aee4a30bfb88ac147f5f8ac9bdb28cfc0be16e7f) [#6573](https://github.com/npm/cli/pull/6573) `strip-ansi@7.1.0`
221
+* [`6105dbc`](https://github.com/npm/cli/commit/6105dbcc1c1647c66759e73ad8699a539e8a70c3) [#6573](https://github.com/npm/cli/pull/6573) `path-scurry@1.9.2`
222
+* [`22d44e8`](https://github.com/npm/cli/commit/22d44e81d6bced4c9d5960b74023ee017df6606b) [#6573](https://github.com/npm/cli/pull/6573) `read-package-json@6.0.4`
223
+* [`fdd02fd`](https://github.com/npm/cli/commit/fdd02fde1c53ce66a3b15b55907fd7e80680b89b) [#6573](https://github.com/npm/cli/pull/6573) `jackspeak@2.2.1`
224
+* [`7797075`](https://github.com/npm/cli/commit/77970756cb2a18257a50e765617f2237abe245d6) [#6573](https://github.com/npm/cli/pull/6573) `is-core-module@2.12.1`
225
+* [`f9780cc`](https://github.com/npm/cli/commit/f9780ccbde62feb59691b5c2f19ed5f3688b1e7e) [#6573](https://github.com/npm/cli/pull/6573) `sigstore@1.6.0`
226
+* [`72d6a79`](https://github.com/npm/cli/commit/72d6a79fa28aec50dab576e93ef06a89694770a5) [#6573](https://github.com/npm/cli/pull/6573) `semver@7.5.2`
227
+* [`98f1f5f`](https://github.com/npm/cli/commit/98f1f5fd2d6890c207c77452739053a674d83990) [#6573](https://github.com/npm/cli/pull/6573) `nopt@7.2.0`
228
+* [`8710ff8`](https://github.com/npm/cli/commit/8710ff88afffb573b4f65c4a19303924935fecd2) [#6573](https://github.com/npm/cli/pull/6573) `pacote@15.2.0`
229
+* [`0cb539d`](https://github.com/npm/cli/commit/0cb539dae1311ef0f60ccf5bd47def1763c38852) [#6573](https://github.com/npm/cli/pull/6573) `node-gyp@9.4.0`
230
+* [`39ad586`](https://github.com/npm/cli/commit/39ad5862ffc99b3da365ab3dd8538b68a4352ea5) [#6573](https://github.com/npm/cli/pull/6573) `ini@4.1.1`
231
+* [`5e0070c`](https://github.com/npm/cli/commit/5e0070cf28353e94458e0d8190833595aa143314) [#6573](https://github.com/npm/cli/pull/6573) `glob@10.2.7` `minimatch@9.0.1`
232
+* [`26cf235`](https://github.com/npm/cli/commit/26cf235aa45d0d4100f061f009c1ffdf0a1fdf16) [#6573](https://github.com/npm/cli/pull/6573) `cacache@17.1.3`
233
+* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.10): `@npmcli/arborist@6.2.10`
234
+* [Workspace](https://github.com/npm/cli/releases/tag/config-v6.2.1): `@npmcli/config@6.2.1`
235
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.18): `libnpmdiff@5.0.18`
236
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v6.0.1): `libnpmexec@6.0.1`
237
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.18): `libnpmfund@4.0.18`
238
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.18): `libnpmpack@5.0.18`
239
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v7.4.0): `libnpmpublish@7.4.0`
240
+
241
+## [9.7.1](https://github.com/npm/cli/compare/v9.7.0...v9.7.1) (2023-06-06)
242
+
243
+### Dependencies
244
+
245
+* [`7467ff6`](https://github.com/npm/cli/commit/7467ff680a3fffbf6b974c5779229c2e54e8515f) [#6518](https://github.com/npm/cli/pull/6518) `@npmcli/package-json@3.1.1`, `@npmcli/git@4.1.0`
246
+
247
+## [9.7.0](https://github.com/npm/cli/compare/v9.6.7...v9.7.0) (2023-05-31)
248
+
249
+### Features
250
+
251
+* [`a63a6d8`](https://github.com/npm/cli/commit/a63a6d8d6fd339d504ab94c0364ce7ee3d4e3775) [#6490](https://github.com/npm/cli/pull/6490) add provenanceFile option for libnpmpublish (@bdehamer)
252
+* [`2a8f4f2`](https://github.com/npm/cli/commit/2a8f4f203a47f60cc96312934927419a7d83c2f1) [#6490](https://github.com/npm/cli/pull/6490) add new exclusive config item publish-file (@wraithgar)
253
+* [`361e194`](https://github.com/npm/cli/commit/361e1945b5a34230690ccf37a14687d021e1dbce) [#6483](https://github.com/npm/cli/pull/6483) implement flag --prefer-dedupe for `npm install` (#6483) (@m4rch3n1ng)
254
+
255
+### Bug Fixes
256
+
257
+* [`38eb39b`](https://github.com/npm/cli/commit/38eb39b8068ab4e3b0a544234ac5df804469e3d8) [#6514](https://github.com/npm/cli/pull/6514) strip ansi characters from search results (#6514) (@wraithgar)
258
+* [`4b5ccfc`](https://github.com/npm/cli/commit/4b5ccfce376378521cb743bfbd32a724340e75b8) [#6477](https://github.com/npm/cli/pull/6477) make usage and completion static functions (#6477) (@lukekarrys)
259
+* [`4f39e8c`](https://github.com/npm/cli/commit/4f39e8c983e652b66f9c342b93694a29dc5a0b92) [#6479](https://github.com/npm/cli/pull/6479) refactor engines validation to lint syntax (#6479) (@lukekarrys)
260
+* [`f3cfe12`](https://github.com/npm/cli/commit/f3cfe129b2602e8f454acac572a51d8adc6c1111) [#6482](https://github.com/npm/cli/pull/6482) remove unused lib/npm relics (#6482) (@lukekarrys)
261
+* [`87de0c7`](https://github.com/npm/cli/commit/87de0c79cca0788d728095cfb537447745bada13) [#6472](https://github.com/npm/cli/pull/6472) move explore command to @npmcli/package-json (@wraithgar)
262
+* [`636e29e`](https://github.com/npm/cli/commit/636e29e2c887e7f197977e3215642b6778eb59de) [#6472](https://github.com/npm/cli/pull/6472) move to @npmcli/package-json where possible (@wraithgar)
263
+* [`37cc797`](https://github.com/npm/cli/commit/37cc797341100cd0a8371e80b25b938f166c9d71) [#6418](https://github.com/npm/cli/pull/6418) retrieve registry keys via TUF (#6418) (@bdehamer)
264
+
265
+### Documentation
266
+
267
+* [`83cd5bd`](https://github.com/npm/cli/commit/83cd5bd68aa6255c598b8dd3a544f16129885aee) [#6480](https://github.com/npm/cli/pull/6480) add global option for uninstall (#6480) (@m4rch3n1ng)
268
+* [`0400ce3`](https://github.com/npm/cli/commit/0400ce3c9d7af792c9931f1ba365e25b899833b6) [#6481](https://github.com/npm/cli/pull/6481) add cli params to `npm set`, `npm get` (#6481) (@m4rch3n1ng)
269
+* [`c3638ce`](https://github.com/npm/cli/commit/c3638ce613364aff50fedb493a97f1ee60211158) [#6468](https://github.com/npm/cli/pull/6468) remove `package-lock` option for `npm ci` (#6468) (@m4rch3n1ng)
270
+
271
+### Dependencies
272
+
273
+* [`060d587`](https://github.com/npm/cli/commit/060d587f6f5a60db0c02c319c1df1a11c146442f) `chalk@5.2.0`, `npm-audit-report@5.0.0`
274
+* [`fc52ca8`](https://github.com/npm/cli/commit/fc52ca8c0bd2aeb4e3885e5395ec647628bdd87c) [#6472](https://github.com/npm/cli/pull/6472) remove read-package-json-fast
275
+* [`3238aa7`](https://github.com/npm/cli/commit/3238aa78905bc90b404dc3075ec810884f8fd1c8) [#6472](https://github.com/npm/cli/pull/6472) remove read-package-json
276
+* [Workspace](https://github.com/npm/cli/releases/tag/config-v6.2.0): `@npmcli/config@6.2.0`
277
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v6.0.0): `libnpmexec@6.0.0`
278
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v7.3.0): `libnpmpublish@7.3.0`
279
+
280
+## [9.6.7](https://github.com/npm/cli/compare/v9.6.6...v9.6.7) (2023-05-17)
281
+
282
+### Bug Fixes
283
+
284
+* [`9202c7d`](https://github.com/npm/cli/commit/9202c7d7c4058deb618e1a74fdc97b11f2845af7) [#6464](https://github.com/npm/cli/pull/6464) npm cache completion (#6464) (@m4rch3n1ng)
285
+* [`6ce99a8`](https://github.com/npm/cli/commit/6ce99a809c815934df73e002381b2b74b25ab0f8) [#6461](https://github.com/npm/cli/pull/6461) exit codes in node v20 (#6461) (@MichaelBitard)
286
+* [`23c865f`](https://github.com/npm/cli/commit/23c865fcd4bd4ee6957006c7b8f9e8cfde1db321) [#6434](https://github.com/npm/cli/pull/6434) deprecate ci-name config (#6434) (@wraithgar)
287
+
288
+### Documentation
289
+
290
+* [`7751dd4`](https://github.com/npm/cli/commit/7751dd431ca6ee4a3503fa71bda88a5cd89eb83c) [#6413](https://github.com/npm/cli/pull/6413) add a comma (#6413) (@darryltec)
291
+
292
+### Dependencies
293
+
294
+* [`afc38a5`](https://github.com/npm/cli/commit/afc38a564c55e8e7b676a3036d1438784ee6c8f0) [#6458](https://github.com/npm/cli/pull/6458) `cacache@17.1.2`
295
+* [`afb936c`](https://github.com/npm/cli/commit/afb936cc5e22d96115472cdfc16908299db5e9dd) [#6458](https://github.com/npm/cli/pull/6458) `tuf-js@1.1.6`
296
+* [`f6a0884`](https://github.com/npm/cli/commit/f6a0884e0867cf0948ddbbdc1b98e0756bf96cef) [#6458](https://github.com/npm/cli/pull/6458) `readable-stream@4.4.0`
297
+* [`858f0ca`](https://github.com/npm/cli/commit/858f0caa3add38c0a171825421693eddf59ccf40) [#6458](https://github.com/npm/cli/pull/6458) `postcss-selector-parser@6.0.13`
298
+* [`53ecb84`](https://github.com/npm/cli/commit/53ecb84bb625a16e2d0a86b1d9380384c0e7545c) [#6458](https://github.com/npm/cli/pull/6458) `path-scurry@1.9.1`
299
+* [`d93f70c`](https://github.com/npm/cli/commit/d93f70c9cd108e6dc3ce9533339dec77c359c320) [#6458](https://github.com/npm/cli/pull/6458) `signal-exit@4.0.2`
300
+* [`19214b5`](https://github.com/npm/cli/commit/19214b54828a9b4e923ea329fa5841edf0753162) [#6458](https://github.com/npm/cli/pull/6458) `@npmcli/package-json@3.1.0`
301
+* [`f53e6ff`](https://github.com/npm/cli/commit/f53e6ff22bc374a03ea6663dbad584c493f1d5b8) [#6458](https://github.com/npm/cli/pull/6458) `sigstore@1.5.2`
302
+* [`94d6ee7`](https://github.com/npm/cli/commit/94d6ee7f353265b64e51ced879915882be83aa89) [#6458](https://github.com/npm/cli/pull/6458) `glob@10.2.4`
303
+* [`902cb80`](https://github.com/npm/cli/commit/902cb80771cc440ef10e7ce7b2afa8934277e0f6) [#6458](https://github.com/npm/cli/pull/6458) `semver@7.5.1`
304
+* [`35e2e9a`](https://github.com/npm/cli/commit/35e2e9a4ce91325462d75b1774298485127762fc) [#6458](https://github.com/npm/cli/pull/6458) `@npmcli/run-script@6.0.2`
305
+* [Workspace](https://github.com/npm/cli/releases/tag/config-v6.1.7): `@npmcli/config@6.1.7`
306
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v7.2.0): `libnpmpublish@7.2.0`
307
+
308
+## [9.6.6](https://github.com/npm/cli/compare/v9.6.5...v9.6.6) (2023-05-03)
309
+
310
+### Dependencies
311
+
312
+* [`70e65b1`](https://github.com/npm/cli/commit/70e65b12ea2c834acec509645d4ba8252dcf88ff) [#6423](https://github.com/npm/cli/pull/6423) `tuf-js@1.1.5` (#6423)
313
+* [`72291f7`](https://github.com/npm/cli/commit/72291f756ad9b63e6dcaef384521f65d58793ee6) [#6416](https://github.com/npm/cli/pull/6416) `read-package-json@6.0.3`
314
+* [`e498f82`](https://github.com/npm/cli/commit/e498f82852e49f638dc661d89785df7d6112fb76) [#6416](https://github.com/npm/cli/pull/6416) `minimatch@9.0.0`
315
+* [`13aa7b7`](https://github.com/npm/cli/commit/13aa7b7a75b8fb18db3f4d86dfe780c8057c4213) [#6416](https://github.com/npm/cli/pull/6416) `minipass@5.0.0`
316
+* [`f2a5678`](https://github.com/npm/cli/commit/f2a5678e73b8e0794f41cc259ab9bd3741d4ec56) [#6416](https://github.com/npm/cli/pull/6416) `tar@6.1.14`
317
+* [`69d4dd2`](https://github.com/npm/cli/commit/69d4dd280b515cb6ba03a1cdb914ef5b106ae945) [#6416](https://github.com/npm/cli/pull/6416) npm update
318
+* [`abdca39`](https://github.com/npm/cli/commit/abdca39a78af416f82771bde69360c0b664ac63d) [#6416](https://github.com/npm/cli/pull/6416) `sigstore@1.4.0`
319
+* [`16f68fb`](https://github.com/npm/cli/commit/16f68fbfa5f250fdf8e5ed4742cc492f56c06219) [#6416](https://github.com/npm/cli/pull/6416) `glob@10.2.2`
320
+* [`67fcfb1`](https://github.com/npm/cli/commit/67fcfb165a1cde7885c1a0f13f8de98e27a1d961) [#6416](https://github.com/npm/cli/pull/6416) `ignore-walk@6.0.3`
321
+* [`bfa2ff3`](https://github.com/npm/cli/commit/bfa2ff325786ad731df82b3436d02f649a403375) [#6416](https://github.com/npm/cli/pull/6416) `make-fetch-happen@11.1.1`
322
+* [`877591a`](https://github.com/npm/cli/commit/877591af5c8430bc2a2873774b81a8fdd7c9d105) [#6416](https://github.com/npm/cli/pull/6416) `npm-registry-fetch@14.0.5`
323
+* [`7630517`](https://github.com/npm/cli/commit/7630517ae613c8d671d533c7ed027428568020ce) [#6416](https://github.com/npm/cli/pull/6416) `pacote@15.1.3`
324
+* [`c2d6e0a`](https://github.com/npm/cli/commit/c2d6e0aae02148cbc7934a5ee9a05e4e7bc45c9b) [#6416](https://github.com/npm/cli/pull/6416) `write-file-atomic@5.0.1`
325
+* [`acdf97e`](https://github.com/npm/cli/commit/acdf97e7955bdfa1a4dd2bfaec39a73e1a3c0ce9) [#6416](https://github.com/npm/cli/pull/6416) `which@3.0.1`
326
+* [`00c541a`](https://github.com/npm/cli/commit/00c541ae4080b210eaffee49a6e5e7fe9da2237d) [#6416](https://github.com/npm/cli/pull/6416) `ssri@10.0.4`
327
+* [`1b95e73`](https://github.com/npm/cli/commit/1b95e73a64d3031d28f754ca43b603318d7d1920) [#6416](https://github.com/npm/cli/pull/6416) `read-package-json@6.0.2`
328
+* [`6927fd3`](https://github.com/npm/cli/commit/6927fd36a65f7c4917abd3826590a972678a7c7b) [#6416](https://github.com/npm/cli/pull/6416) `fs-minipass@3.0.2`
329
+* [`3eec56e`](https://github.com/npm/cli/commit/3eec56e2135c5278d71b546fea68f9300f343dd6) [#6416](https://github.com/npm/cli/pull/6416) `cacache@17.1.0`
330
+* [`7a2ce3f`](https://github.com/npm/cli/commit/7a2ce3f9fa2c4430500bed2a76822c6aa603570b) [#6416](https://github.com/npm/cli/pull/6416) `@npmcli/run-script@6.0.1`
331
+* [`3881770`](https://github.com/npm/cli/commit/38817700290806ce1b1b6231bdbb0730fa7a9504) [#6416](https://github.com/npm/cli/pull/6416) `@npmcli/map-workspaces@3.0.4`
332
+* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.9): `@npmcli/arborist@6.2.9`
333
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.17): `libnpmdiff@5.0.17`
334
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v5.0.17): `libnpmexec@5.0.17`
335
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.17): `libnpmfund@4.0.17`
336
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmorg-v5.0.4): `libnpmorg@5.0.4`
337
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.17): `libnpmpack@5.0.17`
338
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v7.1.4): `libnpmpublish@7.1.4`
339
+
340
+## [9.6.5](https://github.com/npm/cli/compare/v9.6.4...v9.6.5) (2023-04-19)
341
+
342
+### Bug Fixes
343
+
344
+* [`33dc428`](https://github.com/npm/cli/commit/33dc4285fd8c698c539faae10fe1bf76ceedb6b1) [#6374](https://github.com/npm/cli/pull/6374) account for npx package-name with no spec (@wraithgar)
345
+* [`82879f6`](https://github.com/npm/cli/commit/82879f69c72681f636be73d13c4464e35f258954) [#6225](https://github.com/npm/cli/pull/6225) lazy loading of arborist and pacote (#6225) (@wraithgar)
346
+* [`f4e73ab`](https://github.com/npm/cli/commit/f4e73ab87e0aa1e214f978d4723e85ee2cfdd9c8) [#6322](https://github.com/npm/cli/pull/6322) remove incompatible params from ci (#6322) (@wraithgar)
347
+* [`c7fe1c7`](https://github.com/npm/cli/commit/c7fe1c70eef49fa666f9f25ec941afa8b6acbf05) [#6328](https://github.com/npm/cli/pull/6328) save raw data to file, not parsed data (@wraithgar)
348
+
349
+### Documentation
350
+
351
+* [`31214a6`](https://github.com/npm/cli/commit/31214a6d9e9d4e973f5a5462543ea1d91d7bbf65) [#6381](https://github.com/npm/cli/pull/6381) Update description for publish --provenance flag (#6381) (@feelepxyz)
352
+* [`997bcdf`](https://github.com/npm/cli/commit/997bcdf8d4fd3e5ecdd224060fb166b43c3ffb19) [#6329](https://github.com/npm/cli/pull/6329) fix npm cache folder location for windows (#6329) (@charlie-wong)
353
+
354
+### Dependencies
355
+
356
+* [`fae5e00`](https://github.com/npm/cli/commit/fae5e0063215e97ee18a60f8136a06045d621ec2) [#6372](https://github.com/npm/cli/pull/6372) `sigstore@1.3.0` (#6372)
357
+* [`3fa9542`](https://github.com/npm/cli/commit/3fa9542d7f3c0123cb3c49a40f6d5b7bc8d857a5) [#6363](https://github.com/npm/cli/pull/6363) `semver@7.5.0`
358
+* [`e49844e`](https://github.com/npm/cli/commit/e49844e1c6943be193d8f700d85dac4ddaa91967) [#6363](https://github.com/npm/cli/pull/6363) `minipass-fetch@3.0.2`
359
+* [`357cc29`](https://github.com/npm/cli/commit/357cc29a335e684391c7b840019223e555919406) [#6363](https://github.com/npm/cli/pull/6363) `walk-up-path@3.0.1`
360
+* [`2c80b1e`](https://github.com/npm/cli/commit/2c80b1ede7b6a3c49b3255e171759d30913f0c74) [#6363](https://github.com/npm/cli/pull/6363) `ini@4.1.0`
361
+* [`5933841`](https://github.com/npm/cli/commit/593384149feea848c60b2e6524d1cc1730a35798) [#6363](https://github.com/npm/cli/pull/6363) `minipass@4.2.8`
362
+* [`b39d54e`](https://github.com/npm/cli/commit/b39d54e877e992a583f0d8185da1c3773737801d) [#6363](https://github.com/npm/cli/pull/6363) `minimatch@7.4.6`
363
+* [`201aa5a`](https://github.com/npm/cli/commit/201aa5adcdfcb65ff215c4440244978c44c3ed8b) [#6363](https://github.com/npm/cli/pull/6363) `ssri@10.0.3`
364
+* [`acb9120`](https://github.com/npm/cli/commit/acb912089c02c34f73a7d1e431bce563da98777f) [#6363](https://github.com/npm/cli/pull/6363) `read@2.1.0`
365
+* [`2472205`](https://github.com/npm/cli/commit/247220552bc19a5751542289605f38ab9b74e124) [#6363](https://github.com/npm/cli/pull/6363) `npm-registry-fetch@14.0.4`
366
+* [`2780714`](https://github.com/npm/cli/commit/278071456b3f90e1d3e46857679f547fa98781f0) [#6363](https://github.com/npm/cli/pull/6363) `npm-install-checks@6.1.1`
367
+* [`b5af015`](https://github.com/npm/cli/commit/b5af015e63c75b33184ae329a27e994d6ef94506) [#6363](https://github.com/npm/cli/pull/6363) `make-fetch-happen@11.1.0`
368
+* [`14c498d`](https://github.com/npm/cli/commit/14c498d7dbc13e0bc0f1d9438c0f7f1abd7f98d8) [#6363](https://github.com/npm/cli/pull/6363) `@npmcli/metavuln-calculator@5.0.1`
369
+* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.8): `@npmcli/arborist@6.2.8`
370
+* [Workspace](https://github.com/npm/cli/releases/tag/config-v6.1.6): `@npmcli/config@6.1.6`
371
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.16): `libnpmdiff@5.0.16`
372
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v5.0.16): `libnpmexec@5.0.16`
373
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.16): `libnpmfund@4.0.16`
374
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.16): `libnpmpack@5.0.16`
375
+
376
+## [9.6.4](https://github.com/npm/cli/compare/v9.6.3...v9.6.4) (2023-04-05)
377
+
378
+### Documentation
379
+
380
+* [`54795a3`](https://github.com/npm/cli/commit/54795a3554691e97b369baac714cb43f4342af8a) [#6312](https://github.com/npm/cli/pull/6312) filter archives out of version manager search (#6312) (@ljharb)
381
+* [`530c285`](https://github.com/npm/cli/commit/530c285cfd381006996e15e12d68c6c30fb3a4b2) [#6306](https://github.com/npm/cli/pull/6306) remove reference to npm-packlist (#6306) (@staff0rd)
382
+
383
+### Dependencies
384
+
385
+* [`85935ac`](https://github.com/npm/cli/commit/85935ac24d3cb0df867d4f9f901c4b152d92bc49) [#6325](https://github.com/npm/cli/pull/6325) `ssri@10.0.2` (#6325)
386
+* [`f1388b4`](https://github.com/npm/cli/commit/f1388b4c5aac0617893b546ff9c764f05d20bc07) [#6317](https://github.com/npm/cli/pull/6317) npm update
387
+* [`7dd0129`](https://github.com/npm/cli/commit/7dd012958f392d66974d59a9fb0a200a16822906) [#6317](https://github.com/npm/cli/pull/6317) `glob@9.3.2`
388
+* [`deca335`](https://github.com/npm/cli/commit/deca335ed47697e6e9cb4d67c84cfff8ae95ca5c) [#6317](https://github.com/npm/cli/pull/6317) `promise-call-limit@1.0.2`
389
+* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.7): `@npmcli/arborist@6.2.7`
390
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.15): `libnpmdiff@5.0.15`
391
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v5.0.15): `libnpmexec@5.0.15`
392
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.15): `libnpmfund@4.0.15`
393
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.15): `libnpmpack@5.0.15`
394
+
395
+## [9.6.3](https://github.com/npm/cli/compare/v9.6.2...v9.6.3) (2023-03-30)
396
+
397
+### Bug Fixes
398
+
399
+* [`829503b`](https://github.com/npm/cli/commit/829503b804f31b63a405ece48ea265b641b43392) [#6304](https://github.com/npm/cli/pull/6304) don't break up log message across lines (@wraithgar)
400
+* [`1435fcf`](https://github.com/npm/cli/commit/1435fcf1e351a888b006993c2f6ce73fc533638c) [#6304](https://github.com/npm/cli/pull/6304) do less work loading ./lib/npm.js (@wraithgar)
401
+* [`09b58e4`](https://github.com/npm/cli/commit/09b58e4cabc2202aab878c89fc6930e4a085fd3a) [#6284](https://github.com/npm/cli/pull/6284) make all color output use an npm instance of chalk (#6284) (@lukekarrys)
402
+* [`e252532`](https://github.com/npm/cli/commit/e25253250717601be59e76a5dcf965441fc99caa) [#6283](https://github.com/npm/cli/pull/6283) do less work looking up commands (#6283) (@wraithgar)
403
+* [`6a4bcba`](https://github.com/npm/cli/commit/6a4bcbaaf12c15041c73914fb3a24389a62f7436) [#6275](https://github.com/npm/cli/pull/6275) clean up man sorting (@wraithgar)
404
+* [`8a96b65`](https://github.com/npm/cli/commit/8a96b650ac3e3a1da9f4f50b975dda7847d35916) [#6275](https://github.com/npm/cli/pull/6275) ignore ts and map files (@wraithgar)
405
+* [`94d2b39`](https://github.com/npm/cli/commit/94d2b39dfdf423e4a391baa2910e8537b1ba46c4) [#6271](https://github.com/npm/cli/pull/6271) Do not log warnings about log cleanup when logs_max=0 (#6271) (@jmealo)
406
+* [`2def359`](https://github.com/npm/cli/commit/2def359c93bc6b2f79443107dcb13b0d7c1b9865) [#6277](https://github.com/npm/cli/pull/6277) updated ebadplatform messaging to be generated based on the error (#6277) (@nlf)
407
+
408
+### Documentation
409
+
410
+* [`1e2eb81`](https://github.com/npm/cli/commit/1e2eb8150bf31488b6f591b74144bc0c4709be2c) [#6311](https://github.com/npm/cli/pull/6311) replace version manager list with a github search (#6311) (@wraithgar)
411
+* [`9d2be4e`](https://github.com/npm/cli/commit/9d2be4e1f84e2bd4b79ce2cdc42e338d946867a8) [#6289](https://github.com/npm/cli/pull/6289) remove npm bin link (#6289) (@KevinRouchut)
412
+
413
+### Dependencies
414
+
415
+* [`e652dbd`](https://github.com/npm/cli/commit/e652dbddd1625ea7b774729b0f1f349bb3e7af89) [#6308](https://github.com/npm/cli/pull/6308) `minimatch@7.4.3` (#6308)
416
+* [`01986d1`](https://github.com/npm/cli/commit/01986d13d640e4f532e5c0b66cb2dee01a1462f9) [#6307](https://github.com/npm/cli/pull/6307) `sigstore@1.2.0` (#6307)
417
+* [`ea12627`](https://github.com/npm/cli/commit/ea12627ec8f3455ada2b011bc6ff84980b2a5b30) [#6275](https://github.com/npm/cli/pull/6275) `minimatch@7.4.2`
418
+* [`ec3e020`](https://github.com/npm/cli/commit/ec3e020871419b37f13a92a42d0b90bda549e09c) [#6275](https://github.com/npm/cli/pull/6275) `glob@9.3.1`
419
+* [`952fbed`](https://github.com/npm/cli/commit/952fbed699713cb720d24ca2d9762de4d9ddb83f) [#6275](https://github.com/npm/cli/pull/6275) `read-package-json@6.0.1`
420
+* [`dd43d30`](https://github.com/npm/cli/commit/dd43d305cd108e39fbcbad9400d7db8c8b02fb3c) [#6275](https://github.com/npm/cli/pull/6275) `parse-conflict-json@3.0.1`
421
+* [`d5ce7ca`](https://github.com/npm/cli/commit/d5ce7ca40fec1a3aac47d1edca6f4030ff6134a4) [#6275](https://github.com/npm/cli/pull/6275) `npm-install-checks@6.1.0`
422
+* [`704cd1e`](https://github.com/npm/cli/commit/704cd1ebaaa94d14a1ce5bcb5b45dc6f359edd13) [#6275](https://github.com/npm/cli/pull/6275) `nopt@7.1.0`
423
+* [`a6da22a`](https://github.com/npm/cli/commit/a6da22ad3262c5deb0bdd623c2160ab20efaef28) [#6275](https://github.com/npm/cli/pull/6275) `ignore-walk@6.0.2`
424
+* [`55955fd`](https://github.com/npm/cli/commit/55955fd090938b86b1872dfa986d3d30bfda87de) [#6275](https://github.com/npm/cli/pull/6275) `cacache@17.0.5`
425
+* [`839b670`](https://github.com/npm/cli/commit/839b670c93b19aae9b95b5fd7fe687a5f532628b) [#6275](https://github.com/npm/cli/pull/6275) `@npmcli/map-workspaces@3.0.3`
426
+* [`9a7b8e8`](https://github.com/npm/cli/commit/9a7b8e8105460ca76ce825707961060243987653) [#6275](https://github.com/npm/cli/pull/6275) `@npmcli/git@4.0.4`
427
+* [`57c0a55`](https://github.com/npm/cli/commit/57c0a55d509c4cd725e5b4a0e049aa114969cb2b) [#6275](https://github.com/npm/cli/pull/6275) npm update
428
+* [`74c80f5`](https://github.com/npm/cli/commit/74c80f54a7e6345f6751732dc4cb2c2923947343) [#6275](https://github.com/npm/cli/pull/6275) `minipass@4.2.5`
429
+* [`b174c90`](https://github.com/npm/cli/commit/b174c908f03ade15a8b57ff59a0736c9ff79a313) [#6275](https://github.com/npm/cli/pull/6275) `graceful-fs@4.2.11`
430
+* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.6): `@npmcli/arborist@6.2.6`
431
+* [Workspace](https://github.com/npm/cli/releases/tag/config-v6.1.5): `@npmcli/config@6.1.5`
432
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.14): `libnpmdiff@5.0.14`
433
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v5.0.14): `libnpmexec@5.0.14`
434
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.14): `libnpmfund@4.0.14`
435
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.14): `libnpmpack@5.0.14`
436
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v7.1.3): `libnpmpublish@7.1.3`
437
+
438
+## [9.6.2](https://github.com/npm/cli/compare/v9.6.1...v9.6.2) (2023-03-14)
439
+
440
+### Bug Fixes
441
+
442
+* [`4622b42`](https://github.com/npm/cli/commit/4622b425751bc6e3eebb9abfa5fc3fbf94890e34) [#6247](https://github.com/npm/cli/pull/6247) add provenance publish notice (#6247) (@bdehamer)
443
+
444
+### Dependencies
445
+
446
+* [`434b461`](https://github.com/npm/cli/commit/434b461e4c15513817eaec6acfe82c7814789c85) [#6255](https://github.com/npm/cli/pull/6255) `sigstore@1.1.1` (#6255)
447
+* [Workspace](https://github.com/npm/cli/releases/tag/config-v6.1.4): `@npmcli/config@6.1.4`
448
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v7.1.2): `libnpmpublish@7.1.2`
449
+
450
+## [9.6.1](https://github.com/npm/cli/compare/v9.6.0...v9.6.1) (2023-03-08)
451
+
452
+### Bug Fixes
453
+
454
+* [`e455e3f`](https://github.com/npm/cli/commit/e455e3f6a5d0aa2c53cc24064557ec592706ca2c) [#6211](https://github.com/npm/cli/pull/6211) send options with grant/revoke requests (#6211) (@DavidTanner)
455
+* [`e4de224`](https://github.com/npm/cli/commit/e4de22480a21591f0c9ba755c8464a9e1f0413c9) [#6220](https://github.com/npm/cli/pull/6220) clean uri from audit error (#6220) (@wraithgar)
456
+
457
+### Dependencies
458
+
459
+* [`cb45b21`](https://github.com/npm/cli/commit/cb45b216c831a2b0c08f97d57ad4d34b318f3d69) [#6231](https://github.com/npm/cli/pull/6231) npm update
460
+* [`1f60a7e`](https://github.com/npm/cli/commit/1f60a7ee02953632bf5fb4e64e66755d7bb1bdd1) [#6231](https://github.com/npm/cli/pull/6231) `minipass@4.2.4`
461
+* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.5): `@npmcli/arborist@6.2.5`
462
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.13): `libnpmdiff@5.0.13`
463
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v5.0.13): `libnpmexec@5.0.13`
464
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.13): `libnpmfund@4.0.13`
465
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.13): `libnpmpack@5.0.13`
466
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v7.1.1): `libnpmpublish@7.1.1`
467
+
468
+## [9.6.0](https://github.com/npm/cli/compare/v9.5.1...v9.6.0) (2023-03-02)
469
+
470
+### Features
471
+
472
+* [`84fbaf2`](https://github.com/npm/cli/commit/84fbaf2bd809e56f396496dd5f4691a46dd548aa) [#6216](https://github.com/npm/cli/pull/6216) add preliminary fish shell completion (@wraithgar)
473
+
474
+### Bug Fixes
475
+
476
+* [`c4c8754`](https://github.com/npm/cli/commit/c4c8754f12e73007ef0f0f516c8e51e08858b2c6) audit: add signatures to completion (@wraithgar)
477
+* [`fc46489`](https://github.com/npm/cli/commit/fc4648984c9fc4904d2b51597590015f8ca702fc) access: only complete once (@wraithgar)
478
+* [`b43961a`](https://github.com/npm/cli/commit/b43961a9a3c0e5ea0314a241ba8ae9b7ea57cae7) cmd-list: alias only to real commands (@wraithgar)
479
+
480
+### Documentation
481
+
482
+* [`2695e1f`](https://github.com/npm/cli/commit/2695e1fb1384ad41fe6b99fdc570088978626dd8) [#6187](https://github.com/npm/cli/pull/6187) npm v9 creates package-lock.json v3 (#6187) (@tuukka)
483
+
484
+### Dependencies
485
+
486
+* [`71ae406`](https://github.com/npm/cli/commit/71ae4067bccef53aa99ccf8abbe9115daaae8e8c) [#6218](https://github.com/npm/cli/pull/6218) `@npmcli/installed-package-contents@2.0.2`
487
+* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.4): `@npmcli/arborist@6.2.4`
488
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.12): `libnpmdiff@5.0.12`
489
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v5.0.12): `libnpmexec@5.0.12`
490
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.12): `libnpmfund@4.0.12`
491
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.12): `libnpmpack@5.0.12`
492
+
493
+## [9.5.1](https://github.com/npm/cli/compare/v9.5.0...v9.5.1) (2023-02-22)
494
+
495
+### Documentation
496
+
497
+* [`9bc455b`](https://github.com/npm/cli/commit/9bc455bc2c0f247ff4ca2e1fd299063008b4e260) [#6188](https://github.com/npm/cli/pull/6188) fixing typos (#6188) (@deining)
498
+* [`ec8c95c`](https://github.com/npm/cli/commit/ec8c95c2ab2de71a18e291b4f65ebb87c6ace1e8) [#6186](https://github.com/npm/cli/pull/6186) update OSI link (#6186) (@roerohan)
499
+
500
+### Dependencies
501
+
502
+* [`7ba3e17`](https://github.com/npm/cli/commit/7ba3e17087e13d737103260f10e671befc6ce256) [#6189](https://github.com/npm/cli/pull/6189) npm update
503
+* [`f7a5200`](https://github.com/npm/cli/commit/f7a520072f3dcafd9391e5e27f3ceef8e59e95dc) `pacote@15.1.1`
504
+* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.3): `@npmcli/arborist@6.2.3`
505
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.11): `libnpmdiff@5.0.11`
506
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v5.0.11): `libnpmexec@5.0.11`
507
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.11): `libnpmfund@4.0.11`
508
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.11): `libnpmpack@5.0.11`
509
+
510
+## [9.5.0](https://github.com/npm/cli/compare/v9.4.2...v9.5.0) (2023-02-14)
511
+
512
+### Features
513
+
514
+* [`79bfd03`](https://github.com/npm/cli/commit/79bfd03947a25f4bfb67d1c54893be7c79ec77e2) [#6153](https://github.com/npm/cli/pull/6153) audit signatures verifies attestations (@feelepxyz)
515
+* [`5fc6473`](https://github.com/npm/cli/commit/5fc647316cdc07d4337cdf1b75f73a0663822c7f) add provenance attestation (@bdehamer)
516
+
517
+### Bug Fixes
518
+
519
+* [`53f75a4`](https://github.com/npm/cli/commit/53f75a4faeac02b97cfac91309a7f9f4efe553a0) [#6158](https://github.com/npm/cli/pull/6158) gracefully fallback from auth-type=web (#6158) (@MylesBorins)
520
+* [`ed59aae`](https://github.com/npm/cli/commit/ed59aae51cc55f57ee32d43e898ef05236005a09) [#6162](https://github.com/npm/cli/pull/6162) refactor error reporting in audit command (@bdehamer)
521
+
522
+### Dependencies
523
+
524
+* [`fad0473`](https://github.com/npm/cli/commit/fad04737d7b0d1e3a8cd3d3a651e90db6b185f7b) `minipass@4.0.3`
525
+* [`678c6bf`](https://github.com/npm/cli/commit/678c6bf716012fd834c06644ed1a82e10a5393ad) `minimatch@6.2.0`
526
+* [`9b4b366`](https://github.com/npm/cli/commit/9b4b366af5dac21b6db5d722d30b7e1fff064600) `ci-info@3.8.0`
527
+* [`d20ee2a`](https://github.com/npm/cli/commit/d20ee2afa0b9c97ed6822cb8e6838ba537dd76a9) `pacote@15.1.0`
528
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v7.1.0): `libnpmpublish@7.1.0`
529
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmteam-v5.0.3): `libnpmteam@5.0.3`
530
+
531
+## [9.4.2](https://github.com/npm/cli/compare/v9.4.1...v9.4.2) (2023-02-07)
532
+
533
+### Bug Fixes
534
+
535
+* [`d02da52`](https://github.com/npm/cli/commit/d02da52dc1ac6520223e9e7e8fdcbd9e27b5333f) [#6142](https://github.com/npm/cli/pull/6142) revert `install-links` default back to `false` (#6142) (@nlf)
536
+
537
+### Documentation
538
+
539
+* [`6ea2cd7`](https://github.com/npm/cli/commit/6ea2cd77c6ba92f213e4833c746f032ef9bfcc3d) [#6134](https://github.com/npm/cli/pull/6134) update references to OTP to be accurate (#6134) (@MylesBorins)
540
+
541
+### Dependencies
542
+
543
+* [`cb6713d`](https://github.com/npm/cli/commit/cb6713dc8ef7161c8162cc418a023d25b17e5bcf) [#6143](https://github.com/npm/cli/pull/6143) rebuild package-lock (#6143)
544
+* [`8200f4f`](https://github.com/npm/cli/commit/8200f4f16d9dad1d44094c8c2182e26bc1a8b732) [#6133](https://github.com/npm/cli/pull/6133) `ignore-walk@6.0.1`
545
+* [`d43f881`](https://github.com/npm/cli/commit/d43f8812af5900cce45364729871a745b379aea9) `map-workspaces@3.0.2`
546
+* [`99457f1`](https://github.com/npm/cli/commit/99457f1f48d57f913b398e25f4e5da066af71204) `minimatch@6.1.6`
547
+* [`f4c8c62`](https://github.com/npm/cli/commit/f4c8c62baf532b7599e3760f959788bbda97ba0b) `init-package-json@5.0.0`
548
+* [`3c6615f`](https://github.com/npm/cli/commit/3c6615fff53a3368679f28b8812eba86dbc195a9) `npm-user-validate@2.0.0`
549
+* [`10445ca`](https://github.com/npm/cli/commit/10445ca4a09df590777a9289ab1ed0f41449c85d) remove mkdirp
550
+* [`ab82492`](https://github.com/npm/cli/commit/ab824922ea7678585926adb67a90cdcebc53b4ae) `node-gyp@9.3.1`
551
+* [`74c5cbb`](https://github.com/npm/cli/commit/74c5cbbd774f7ff7c1f037b382aec36cbc8ca2f1) `minipass@4.0.2`
552
+* [`1138038`](https://github.com/npm/cli/commit/11380386cef7ad8b12226431ca3d5e166455d626) `make-fetch-happen@11.0.3`
553
+* [`c1ccfa1`](https://github.com/npm/cli/commit/c1ccfa146523d734bdfe2a7bef1b0abc64e716d8) `glob@8.1.0`
554
+* [`3dc17ce`](https://github.com/npm/cli/commit/3dc17ce3fa570f9ef2c55e2a565af6fe89b3e73d) `fs-minipass@3.0.1`
555
+* [`5c84a99`](https://github.com/npm/cli/commit/5c84a99f5a141a632bd644ca97505010c2842eb2) `ci-info@3.7.1`
556
+* [`fc5332f`](https://github.com/npm/cli/commit/fc5332f4027f3019a855f12a66e29bca1b143364) `read@2.0.0`
557
+* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.2): `@npmcli/arborist@6.2.2`
558
+* [Workspace](https://github.com/npm/cli/releases/tag/config-v6.1.3): `@npmcli/config@6.1.3`
559
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.10): `libnpmdiff@5.0.10`
560
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v5.0.10): `libnpmexec@5.0.10`
561
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.10): `libnpmfund@4.0.10`
562
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmhook-v9.0.3): `libnpmhook@9.0.3`
563
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmorg-v5.0.3): `libnpmorg@5.0.3`
564
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.10): `libnpmpack@5.0.10`
565
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v7.0.8): `libnpmpublish@7.0.8`
566
+
567
+## [9.4.1](https://github.com/npm/cli/compare/v9.4.0...v9.4.1) (2023-02-01)
568
+
569
+### Bug Fixes
570
+
571
+* [`1525a5e`](https://github.com/npm/cli/commit/1525a5e7fba4c996ac3bed5fdb75da275c537da8) [#6082](https://github.com/npm/cli/pull/6082) unpublish with scoped registry (@wraithgar)
572
+
573
+### Dependencies
574
+
575
+* [`721fe3f`](https://github.com/npm/cli/commit/721fe3fac383d714aa7fd7285b4392619903b1e7) [#6118](https://github.com/npm/cli/pull/6118) `read-package-json-fast@3.0.2`
576
+* [`6e4a649`](https://github.com/npm/cli/commit/6e4a64976dc9a359b97413cd725e93caa1f0fc28) `pacote@15.0.8`
577
+* [`1820afe`](https://github.com/npm/cli/commit/1820afe4b34909b8702da69032dde9d3ecdbb447) `cacache@17.0.4`
578
+* [`24b2ec4`](https://github.com/npm/cli/commit/24b2ec4e156f98ef80ed5ac8751d35a32ad1251a) `@npmcli/promise-spawn@6.0.2`
579
+* [`4b8046e`](https://github.com/npm/cli/commit/4b8046e680d5907d2df71d6d3775b66e0bea7ed2) `@npmcli/name-from-folder@2.0.0`
580
+* [`1d4be7a`](https://github.com/npm/cli/commit/1d4be7a5457fd0081696e29f8382645873cf13d9) `@npmcli/map-workspaces@3.0.1`
581
+* [`a39556f`](https://github.com/npm/cli/commit/a39556f1cff4526dcbcb7b65cdd86a1ba092e13e) `@npmcli/template-oss@4.11.3`
582
+* [`64b06ed`](https://github.com/npm/cli/commit/64b06ed21fc165e413b3e6f1ae5a236350e5bfaf) [#6115](https://github.com/npm/cli/pull/6115) `http-cache-semantics@4.1.1`
583
+* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.1): `@npmcli/arborist@6.2.1`
584
+* [Workspace](https://github.com/npm/cli/releases/tag/config-v6.1.2): `@npmcli/config@6.1.2`
585
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmaccess-v7.0.2): `libnpmaccess@7.0.2`
586
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.9): `libnpmdiff@5.0.9`
587
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v5.0.9): `libnpmexec@5.0.9`
588
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.9): `libnpmfund@4.0.9`
589
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmhook-v9.0.2): `libnpmhook@9.0.2`
590
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmorg-v5.0.2): `libnpmorg@5.0.2`
591
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.9): `libnpmpack@5.0.9`
592
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v7.0.7): `libnpmpublish@7.0.7`
593
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmsearch-v6.0.2): `libnpmsearch@6.0.2`
594
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmteam-v5.0.2): `libnpmteam@5.0.2`
595
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmversion-v4.0.2): `libnpmversion@4.0.2`
596
+
597
+## [9.4.0](https://github.com/npm/cli/compare/v9.3.1...v9.4.0) (2023-01-25)
598
+
599
+### Features
600
+
601
+* [`8d6d851`](https://github.com/npm/cli/commit/8d6d8519fbbcebdca8834e19cb34ac71f045a010) [#6078](https://github.com/npm/cli/pull/6078) added --install-strategy=linked (#6078) (@fritzy)
602
+
603
+### Dependencies
604
+
605
+* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.0): `@npmcli/arborist@6.2.0`
606
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.8): `libnpmdiff@5.0.8`
607
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v5.0.8): `libnpmexec@5.0.8`
608
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.8): `libnpmfund@4.0.8`
609
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.8): `libnpmpack@5.0.8`
610
+
611
+## [9.3.1](https://github.com/npm/cli/compare/v9.3.0...v9.3.1) (2023-01-13)
612
+
613
+### Bug Fixes
614
+
615
+* [`8be672b`](https://github.com/npm/cli/commit/8be672b21f7d434c898bb4e97dc3fca6e54b29a1) [#6050](https://github.com/npm/cli/pull/6050) don't try to deprecate nonexistant versions (#6050) (@wraithgar)
616
+* [`1c3612c`](https://github.com/npm/cli/commit/1c3612cc2fe9974166b5aab92477b289a768c1e7) [#6054](https://github.com/npm/cli/pull/6054) use recursive rm in ci command (#6054) (@jamesshaw1987, @burkel24)
617
+
618
+## [9.3.0](https://github.com/npm/cli/compare/v9.2.0...v9.3.0) (2023-01-12)
619
+
620
+### Features
621
+
622
+* [`753b98e`](https://github.com/npm/cli/commit/753b98ef49e0410642cbfb1adbe06e7417e22d82) [#5261](https://github.com/npm/cli/pull/5261) rootless workspace init provides suggestion (@fritzy)
623
+
624
+### Bug Fixes
625
+
626
+* [`cf175fb`](https://github.com/npm/cli/commit/cf175fb2a7faffa6664874a9e8bea52dbbb1b0e2) [#6044](https://github.com/npm/cli/pull/6044) default auth-type to legacy if otp is configured (#6044) (@wraithgar)
627
+* [`2383deb`](https://github.com/npm/cli/commit/2383deb9723593365cf748238f3b2388e7aaf6f5) [#6037](https://github.com/npm/cli/pull/6037) clean urls from arborist, owner, and ping commands (#6037) (@lukekarrys)
628
+* [`69f5ff8`](https://github.com/npm/cli/commit/69f5ff863fccf91935b1f62b514fd2621b761903) view: convert command to use output instead of console (@lukekarrys)
629
+* [`dc52222`](https://github.com/npm/cli/commit/dc52222123245d3faf2afa444d0223deb25e35b6) init: write package.json workspaces paths with / separators (@lukekarrys)
630
+* [`31af1aa`](https://github.com/npm/cli/commit/31af1aaa9f6427bd61d752d54801d873c6242af8) refactor `help` to use `@npmcli/promise-spawn` (@lukekarrys)
631
+* [`669ef94`](https://github.com/npm/cli/commit/669ef9476cac4679322bec69e7a55ff5992cf827) fund: correctly parse and use `which` config (@lukekarrys)
632
+* [`72e6d6f`](https://github.com/npm/cli/commit/72e6d6f638db03dbe3c965be79ce05cb6fda12fc) generate workspace support for docs pages (@lukekarrys)
633
+* [`450e50f`](https://github.com/npm/cli/commit/450e50fa555bfef869735b0195fe0a451e94eb3d) evaluate configs in command class (@lukekarrys)
634
+* [`28ec922`](https://github.com/npm/cli/commit/28ec922e18c7178e840fd28cbbf78f56f0a7a653) [#5946](https://github.com/npm/cli/pull/5946) replace rimraf with fs.rm (@lukekarrys)
635
+
636
+### Documentation
637
+
638
+* [`f0038e5`](https://github.com/npm/cli/commit/f0038e5b7492a899da26fafd5f781291961ef427) [#6048](https://github.com/npm/cli/pull/6048) missing backtick in synopsis of npm init (#5837) (#6048) (@Peallyz)
639
+* [`ca8ff00`](https://github.com/npm/cli/commit/ca8ff007d7abba1f3ae6646668ee840afa1191b6) [#6045](https://github.com/npm/cli/pull/6045) update outdated file path to definitions.js (@ericmutta)
640
+* [`fe9debd`](https://github.com/npm/cli/commit/fe9debd7925c8e6d05d53f49f516fec8aede8890) [#6038](https://github.com/npm/cli/pull/6038) fix typos in definitions.js (#6038) (@lukekarrys, @ericmutta)
641
+* [`fa27aca`](https://github.com/npm/cli/commit/fa27acaa72002c5cc80f59401dbd0ba817cda404) [#6018](https://github.com/npm/cli/pull/6018) fix typo in removal.md (@ericmutta)
642
+* [`82f69d9`](https://github.com/npm/cli/commit/82f69d90d58da8cc2a53570bfe2a1a9cc2574f0d) [#6026](https://github.com/npm/cli/pull/6026) fix typo in registry.md (@ericmutta)
643
+
644
+### Dependencies
645
+
646
+* [`ec09474`](https://github.com/npm/cli/commit/ec09474b371b0706d0d55a4968cf6ae545423568) [#5945](https://github.com/npm/cli/pull/5945) `minipass-fetch@3.0.1`
647
+* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.1.6): `@npmcli/arborist@6.1.6`
648
+* [Workspace](https://github.com/npm/cli/releases/tag/config-v6.1.1): `@npmcli/config@6.1.1`
649
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.7): `libnpmdiff@5.0.7`
650
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v5.0.7): `libnpmexec@5.0.7`
651
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.7): `libnpmfund@4.0.7`
652
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.7): `libnpmpack@5.0.7`
653
+
654
+## [9.2.0](https://github.com/npm/cli/compare/v9.1.3...v9.2.0) (2022-12-07)
655
+
656
+### Features
657
+
658
+* [`cf57ffa`](https://github.com/npm/cli/commit/cf57ffa90088fcf5b028cc02938baae6228b5a40) [#5888](https://github.com/npm/cli/pull/5888) discrete npm doctor commands (#5888) (@wraithgar)
659
+
660
+### Bug Fixes
661
+
662
+* [`dfd5d46`](https://github.com/npm/cli/commit/dfd5d461e0ee2163e210cc136d2bb7873dfeb363) [#5932](https://github.com/npm/cli/pull/5932) ignore implicit workspaces for completion (#5932) (@wraithgar)
663
+
664
+### Dependencies
665
+
666
+* [`2f2b146`](https://github.com/npm/cli/commit/2f2b1469565894ec777e6eb77fea7b607b797adb) [#5936](https://github.com/npm/cli/pull/5936) `npm-packlist@7.0.4` (#5936)
667
+* [`372d158`](https://github.com/npm/cli/commit/372d158d2637120600a95abee64355ed1cb6f990) [#5935](https://github.com/npm/cli/pull/5935) `minimatch@5.1.1` (#5935)
668
+* [`0e6c28b`](https://github.com/npm/cli/commit/0e6c28ba093f8c5d35df98afca28e842b247004b) [#5934](https://github.com/npm/cli/pull/5934) `ci-info@3.7.0` (#5934)
669
+* [`0a3fe00`](https://github.com/npm/cli/commit/0a3fe000e2723ae6fdb8b1d3154fd3835057c992) [#5933](https://github.com/npm/cli/pull/5933) `minipass@4.0.0`
670
+* [`6b77340`](https://github.com/npm/cli/commit/6b7734009ecd939fbb3d382cb92eb0cdbec7dcd3) `tar@6.1.13`
671
+* [`cf0a174`](https://github.com/npm/cli/commit/cf0a17407abc577c27420a1c8a4a0c08c7cefce9) `ssri@10.0.1`
672
+* [`3da9a1a`](https://github.com/npm/cli/commit/3da9a1a4ebcf1779035b5f9ae985c087f617efe3) `pacote@15.0.7`
673
+* [`fee9b66`](https://github.com/npm/cli/commit/fee9b6686892a1c7f976c36ddd5d89b70c416817) `npm-registry-fetch@14.0.3`
674
+* [`e940917`](https://github.com/npm/cli/commit/e940917befcdaf44ee7e24d31b540f4de8507734) `cacache@17.0.3`
675
+* [`875bd56`](https://github.com/npm/cli/commit/875bd56c33ca5eef80c2a50a11808445f2a39a2a) `npm-package-arg@10.1.0`
676
+* [`280b7a4`](https://github.com/npm/cli/commit/280b7a445e4a83d70980cf3c436745a1faa50c67) [#5927](https://github.com/npm/cli/pull/5927) `npm-packlist@7.0.3`
677
+* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.1.5): `@npmcli/arborist@6.1.5`
678
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmaccess-v7.0.1): `libnpmaccess@7.0.1`
679
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.6): `libnpmdiff@5.0.6`
680
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v5.0.6): `libnpmexec@5.0.6`
681
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.6): `libnpmfund@4.0.6`
682
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmhook-v9.0.1): `libnpmhook@9.0.1`
683
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmorg-v5.0.1): `libnpmorg@5.0.1`
684
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.6): `libnpmpack@5.0.6`
685
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v7.0.6): `libnpmpublish@7.0.6`
686
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmsearch-v6.0.1): `libnpmsearch@6.0.1`
687
+* [Workspace](https://github.com/npm/cli/releases/tag/libnpmteam-v5.0.1): `libnpmteam@5.0.1`
688
+
689
+## [9.1.3](https://github.com/npm/cli/compare/v9.1.2...v9.1.3) (2022-11-30)
690
+
691
+### Bug Fixes
692
+
693
+* [`ffbdea2`](https://github.com/npm/cli/commit/ffbdea286a08eeaf40ab83eea5bfe0602dc6bbcd) [#5894](https://github.com/npm/cli/pull/5894) npm pack filename on scoped packages (#5894) (@HenryNguyen5)
694
+* [`c26d708`](https://github.com/npm/cli/commit/c26d708428a96da530092759b5ff6d67c7282348) [#5884](https://github.com/npm/cli/pull/5884) validate username at get-identity (#5884) (@sosoba, @nlf)
695
+
696
+### Documentation
697
+
698
+* [`ea948dc`](https://github.com/npm/cli/commit/ea948dceac5cfeef437c97874ab26c3275e75766) [#5881](https://github.com/npm/cli/pull/5881) update description of npm exec (#5881) (@styfle, @wraithgar)
699
+* [`40f2c21`](https://github.com/npm/cli/commit/40f2c213d75a252665311b4f8775d297390aeb70) [#5865](https://github.com/npm/cli/pull/5865) ci-info url (#5865) (@wraithgar)
700
+* [`681a45b`](https://github.com/npm/cli/commit/681a45bb48acd57aa64cb3241ea4915f5a12e029) [#5875](https://github.com/npm/cli/pull/5875) run the comand for directory workspaces (#5875) (@1aron)
701
+* [`681a45b`](https://github.com/npm/cli/commit/681a45bb48acd57aa64cb3241ea4915f5a12e029) [#5875](https://github.com/npm/cli/pull/5875) add workspace directory example (#5875) (@1aron)
702
+
703
+### Dependencies
704
+
705
+* [Workspace](https://github.com/npm/cli/compare/arborist-v6.1.3...arborist-v6.1.4): `@npmcli/arborist@6.1.4`
706
+* [Workspace](https://github.com/npm/cli/compare/libnpmdiff-v5.0.4...libnpmdiff-v5.0.5): `libnpmdiff@5.0.5`
707
+* [Workspace](https://github.com/npm/cli/compare/libnpmexec-v5.0.4...libnpmexec-v5.0.5): `libnpmexec@5.0.5`
708
+* [Workspace](https://github.com/npm/cli/compare/libnpmfund-v4.0.4...libnpmfund-v4.0.5): `libnpmfund@4.0.5`
709
+* [Workspace](https://github.com/npm/cli/compare/libnpmpack-v5.0.4...libnpmpack-v5.0.5): `libnpmpack@5.0.5`
710
+* [Workspace](https://github.com/npm/cli/compare/libnpmpublish-v7.0.4...libnpmpublish-v7.0.5): `libnpmpublish@7.0.5`
711
+
712
+## [9.1.2](https://github.com/npm/cli/compare/v9.1.1...v9.1.2) (2022-11-16)
713
+
714
+### Bug Fixes
715
+
716
+* [`d9654cf`](https://github.com/npm/cli/commit/d9654cffd7024ec2d068147868978fc994d696e4) [#5861](https://github.com/npm/cli/pull/5861) remove unwanted package.json entries (#5861) (@wraithgar)
717
+
718
+### Dependencies
719
+
720
+* [`a351685`](https://github.com/npm/cli/commit/a351685c4951b1d9e2ba86bc99e3706688813438) [#5858](https://github.com/npm/cli/pull/5858) move from @npmcli/ci-detect to ci-info (#5858)
721
+* [Workspace](https://github.com/npm/cli/compare/arborist-v6.1.2...arborist-v6.1.3): `@npmcli/arborist@6.1.3`
722
+* [Workspace](https://github.com/npm/cli/compare/libnpmdiff-v5.0.3...libnpmdiff-v5.0.4): `libnpmdiff@5.0.4`
723
+* [Workspace](https://github.com/npm/cli/compare/libnpmexec-v5.0.3...libnpmexec-v5.0.4): `libnpmexec@5.0.4`
724
+* [Workspace](https://github.com/npm/cli/compare/libnpmfund-v4.0.3...libnpmfund-v4.0.4): `libnpmfund@4.0.4`
725
+* [Workspace](https://github.com/npm/cli/compare/libnpmpack-v5.0.3...libnpmpack-v5.0.4): `libnpmpack@5.0.4`
726
+* [Workspace](https://github.com/npm/cli/compare/libnpmpublish-v7.0.3...libnpmpublish-v7.0.4): `libnpmpublish@7.0.4`
727
+
728
+## [9.1.1](https://github.com/npm/cli/compare/v9.1.0...v9.1.1) (2022-11-09)
729
+
730
+### Documentation
731
+
732
+* [`1bff064`](https://github.com/npm/cli/commit/1bff0640ccb8414e2d416a5cf9d64e9ff03c6403) [#5819](https://github.com/npm/cli/pull/5819) config: document `npm config fix` (#5819) (@wraithgar)
733
+
734
+### Dependencies
735
+
736
+* [`335c7e4`](https://github.com/npm/cli/commit/335c7e4348f5505fad33b8a78348a02a82b91426) [#5813](https://github.com/npm/cli/pull/5813) `cacache@17.0.2`
737
+* [`878ddfb`](https://github.com/npm/cli/commit/878ddfb5b68c03bdcd7d7da8dae92c4947942801) `@npmcli/fs@3.1.0`
738
+* [Workspace](https://github.com/npm/cli/compare/arborist-v6.1.1...arborist-v6.1.2): `@npmcli/arborist@6.1.2`
739
+* [Workspace](https://github.com/npm/cli/compare/libnpmdiff-v5.0.2...libnpmdiff-v5.0.3): `libnpmdiff@5.0.3`
740
+* [Workspace](https://github.com/npm/cli/compare/libnpmexec-v5.0.2...libnpmexec-v5.0.3): `libnpmexec@5.0.3`
741
+* [Workspace](https://github.com/npm/cli/compare/libnpmfund-v4.0.2...libnpmfund-v4.0.3): `libnpmfund@4.0.3`
742
+* [Workspace](https://github.com/npm/cli/compare/libnpmpack-v5.0.2...libnpmpack-v5.0.3): `libnpmpack@5.0.3`
743
+* [Workspace](https://github.com/npm/cli/compare/libnpmpublish-v7.0.2...libnpmpublish-v7.0.3): `libnpmpublish@7.0.3`
744
+
745
+## [9.1.0](https://github.com/npm/cli/compare/v9.0.1...v9.1.0) (2022-11-02)
746
+
747
+### Features
748
+
749
+* [`706b3d3`](https://github.com/npm/cli/commit/706b3d3f227de43a095263926d2eef2b4e4cf2a9) [#5779](https://github.com/npm/cli/pull/5779) set --no-audit when installing outside of a project (like --global) (@fritzy)
750
+
751
+### Bug Fixes
752
+
753
+* [`1f5382d`](https://github.com/npm/cli/commit/1f5382dada181cda41f1504974de1e69a6c1ad7f) [#5789](https://github.com/npm/cli/pull/5789) don't set `stdioString` for any spawn/run-script calls (@lukekarrys)
754
+* [`8fd614a`](https://github.com/npm/cli/commit/8fd614af5d6de970a6bbcffc538564d2a809411a) use promiseSpawn.open instead of opener (@nlf)
755
+* [`41843ad`](https://github.com/npm/cli/commit/41843ad8a20bd20aacad2bb37fe473f2e76d5306) use an absolute path to notepad.exe by default, correct docs (@nlf)
756
+* [`0c5834e`](https://github.com/npm/cli/commit/0c5834ed635833ef49fe10cc888025a5debebe21) [#5758](https://github.com/npm/cli/pull/5758) use hosted-git-info to parse registry urls (#5758) (@lukekarrys)
757
+
758
+### Documentation
759
+
760
+* [`ce6745c`](https://github.com/npm/cli/commit/ce6745c806d721f5e3c455a65fd44bfe03e9d2ae) [#5763](https://github.com/npm/cli/pull/5763) fixed some typos (#5763) (@AndrewDawes)
761
+
762
+### Dependencies
763
+
764
+* [`b89c19e`](https://github.com/npm/cli/commit/b89c19e9a7674b0bd9d336c14dee1bf381843648) [#5795](https://github.com/npm/cli/pull/5795) `cli-table3@0.6.3`
765
+* [`6b6dfca`](https://github.com/npm/cli/commit/6b6dfca191cb8f7871f755b926fd5ae223ba697a) `fastest-levenshtein@1.0.16`
766
+* [`9972ed1`](https://github.com/npm/cli/commit/9972ed1423d7a4f7ca03a34f5aa69321b81850fd) `@npmcli/ci-detect@3.0.1`
767
+* [`024e612`](https://github.com/npm/cli/commit/024e612f55fc9906b49065dbabbee8b8261eb4eb) `abbrev@2.0.0`
768
+* [`66f9bcd`](https://github.com/npm/cli/commit/66f9bcd10b8d8cb635593c526727056581c7955d) `nopt@7.0.0`
769
+* [`5730d17`](https://github.com/npm/cli/commit/5730d17198e066077cb3ea6f78753746afc13603) `tar@6.1.12`
770
+* [`2fef570`](https://github.com/npm/cli/commit/2fef570caf00bd92a3a4cf0b2bc4ce56fd8bd594) `node-gyp@9.3.0`
771
+* [`abfb28b`](https://github.com/npm/cli/commit/abfb28b249183b8c033f8e7acc1546150cdac137) `@npmcli/run-script@6.0.0`
772
+* [`205e2fd`](https://github.com/npm/cli/commit/205e2fdde91f4f21d92ccf0bf9e1ab9ab3053167) `pacote@15.0.6`
773
+* [`ac25863`](https://github.com/npm/cli/commit/ac25863a33b75620ac9edf4057bfb9409028636a) remove opener, `@npmcli/promise-spawn@6.0.1`, `@npmcli/run-script@5.1.1`, `@npmcli/git@4.0.3`, `pacote@15.0.5`, `which@3.0.0`
774
+* [Workspace](https://github.com/npm/cli/compare/arborist-v6.1.0...arborist-v6.1.1): `@npmcli/arborist@6.1.1`
775
+* [Workspace](https://github.com/npm/cli/compare/config-v6.0.1...config-v6.1.0): `@npmcli/config@6.1.0`
776
+* [Workspace](https://github.com/npm/cli/compare/libnpmdiff-v5.0.1...libnpmdiff-v5.0.2): `libnpmdiff@5.0.2`
777
+* [Workspace](https://github.com/npm/cli/compare/libnpmexec-v5.0.1...libnpmexec-v5.0.2): `libnpmexec@5.0.2`
778
+* [Workspace](https://github.com/npm/cli/compare/libnpmfund-v4.0.1...libnpmfund-v4.0.2): `libnpmfund@4.0.2`
779
+* [Workspace](https://github.com/npm/cli/compare/libnpmpack-v5.0.1...libnpmpack-v5.0.2): `libnpmpack@5.0.2`
780
+* [Workspace](https://github.com/npm/cli/compare/libnpmpublish-v7.0.1...libnpmpublish-v7.0.2): `libnpmpublish@7.0.2`
781
+* [Workspace](https://github.com/npm/cli/compare/libnpmversion-v4.0.0...libnpmversion-v4.0.1): `libnpmversion@4.0.1`
782
+
783
+## [9.0.1](https://github.com/npm/cli/compare/v9.0.0...v9.0.1) (2022-10-26)
784
+
785
+### Documentation
786
+
787
+* [`b5fadd0`](https://github.com/npm/cli/commit/b5fadd0cec392f4bf6d60fa1358f96400be94667) [#5742](https://github.com/npm/cli/pull/5742) Better npx link (#5742) (@mrienstra)
788
+
789
+### Dependencies
790
+
791
+* [`de6618e`](https://github.com/npm/cli/commit/de6618e93182ba00b4be516db1efb3c51efa17ba) [#5757](https://github.com/npm/cli/pull/5757) `@npmcli/promise-spawn@5.0.0` (#5757)
792
+* [`5625274`](https://github.com/npm/cli/commit/562527456d3862d871d042fa4ff6e38354e320ea) [#5755](https://github.com/npm/cli/pull/5755) `hosted-git-info@6.1.0` (#5755)
793
+* [`32bdd68`](https://github.com/npm/cli/commit/32bdd686ccf826050075e770ffddf7401efa79c9) [#5754](https://github.com/npm/cli/pull/5754) `npm-packlist@7.0.2` (#5754)
794
+* [Workspace](https://github.com/npm/cli/compare/arborist-v6.0.0...arborist-v6.1.0): `@npmcli/arborist@6.1.0`
795
+* [Workspace](https://github.com/npm/cli/compare/libnpmdiff-v5.0.0...libnpmdiff-v5.0.1): `libnpmdiff@5.0.1`
796
+* [Workspace](https://github.com/npm/cli/compare/libnpmexec-v5.0.0...libnpmexec-v5.0.1): `libnpmexec@5.0.1`
797
+* [Workspace](https://github.com/npm/cli/compare/libnpmfund-v4.0.0...libnpmfund-v4.0.1): `libnpmfund@4.0.1`
798
+* [Workspace](https://github.com/npm/cli/compare/libnpmpack-v5.0.0...libnpmpack-v5.0.1): `libnpmpack@5.0.1`
799
+* [Workspace](https://github.com/npm/cli/compare/libnpmpublish-v7.0.0...libnpmpublish-v7.0.1): `libnpmpublish@7.0.1`
800
+
801
+## [9.0.0](https://github.com/npm/cli/compare/v9.0.0-pre.6...v9.0.0) (2022-10-19)
802
+
803
+### Features
804
+
805
+* [`e3b004c`](https://github.com/npm/cli/commit/e3b004c0d6dfcb153c4734af12afb09897e20932) [#5727](https://github.com/npm/cli/pull/5727) move cli and all workspaces out of prerelease mode (@lukekarrys)
806
+
807
+### Dependencies
808
+
809
+* [Workspace](https://github.com/npm/cli/compare/arborist-v6.0.0-pre.5...arborist-v6.0.0): `@npmcli/arborist@6.0.0`
810
+* [Workspace](https://github.com/npm/cli/compare/libnpmaccess-v7.0.0-pre.2...libnpmaccess-v7.0.0): `libnpmaccess@7.0.0`
811
+* [Workspace](https://github.com/npm/cli/compare/libnpmdiff-v5.0.0-pre.3...libnpmdiff-v5.0.0): `libnpmdiff@5.0.0`
812
+* [Workspace](https://github.com/npm/cli/compare/libnpmexec-v5.0.0-pre.5...libnpmexec-v5.0.0): `libnpmexec@5.0.0`
813
+* [Workspace](https://github.com/npm/cli/compare/libnpmfund-v4.0.0-pre.5...libnpmfund-v4.0.0): `libnpmfund@4.0.0`
814
+* [Workspace](https://github.com/npm/cli/compare/libnpmhook-v9.0.0-pre.1...libnpmhook-v9.0.0): `libnpmhook@9.0.0`
815
+* [Workspace](https://github.com/npm/cli/compare/libnpmorg-v5.0.0-pre.1...libnpmorg-v5.0.0): `libnpmorg@5.0.0`
816
+* [Workspace](https://github.com/npm/cli/compare/libnpmpack-v5.0.0-pre.4...libnpmpack-v5.0.0): `libnpmpack@5.0.0`
817
+* [Workspace](https://github.com/npm/cli/compare/libnpmpublish-v7.0.0-pre.4...libnpmpublish-v7.0.0): `libnpmpublish@7.0.0`
818
+* [Workspace](https://github.com/npm/cli/compare/libnpmsearch-v6.0.0-pre.1...libnpmsearch-v6.0.0): `libnpmsearch@6.0.0`
819
+* [Workspace](https://github.com/npm/cli/compare/libnpmteam-v5.0.0-pre.1...libnpmteam-v5.0.0): `libnpmteam@5.0.0`
820
+* [Workspace](https://github.com/npm/cli/compare/libnpmversion-v4.0.0-pre.1...libnpmversion-v4.0.0): `libnpmversion@4.0.0`
821
+
822
+## [9.0.0-pre.6](https://github.com/npm/cli/compare/v9.0.0-pre.5...v9.0.0-pre.6) (2022-10-19)
823
+
824
+### ⚠️ BREAKING CHANGES
825
+
826
+* `npm` now outputs some json errors on stdout. Previously `npm` would output all json formatted errors on stderr, making it difficult to parse as the stderr stream usually has logs already written to it. In the future, `npm` will differentiate between errors and crashes. Errors, such as `E404` and `ERESOLVE`, will be handled and will continue to be output on stdout. In the case of a crash, `npm` will log the error as usual but will not attempt to display it as json, even in `--json` mode. Moving a case from the category of an error to a crash will not be considered a breaking change. For more information see npm/rfcs#482.
827
+* `npm config set` will no longer accept deprecated or invalid config options.
828
+* `timing` and `loglevel` changes
829
+ - `timing` has been removed as a value for `--loglevel`
830
+ - `--timing` will show timing information regardless of
831
+ `--loglevel`, except when `--silent`
832
+* deprecate boolean install flags in favor of `--install-strategy`
833
+ * deprecate --global-style, --global now sets --install-strategy=shallow
834
+ * deprecate --legacy-bundling, now sets --install-strategy=nested
835
+* npm will no longer attempt to modify ownership of files it creates
836
+* this package no longer attempts to change file ownership automatically
837
+* this package no longer attempts to change file ownership automatically
838
+
839
+### Features
840
+
841
+* [`d3543e9`](https://github.com/npm/cli/commit/d3543e945e721783dcb83385935f282a4bb32cf3) output json formatted errors on stdout (#5716) (@lukekarrys)
842
+* [`be642c6`](https://github.com/npm/cli/commit/be642c6b8e3df40fd43b0110b30d3ecd44086016) refuse to set deprecated/invalid config (#5719) (@wraithgar)
843
+* [`332914b`](https://github.com/npm/cli/commit/332914b48b616099e586893b1df21480b7ddb733) separate configs for `--timing` and `--loglevel` (@lukekarrys)
844
+* [`f653785`](https://github.com/npm/cli/commit/f6537855e1a34b84251993a49e1ee362082ada37) deprecated `key`, `cert` config options and updated registry scoped auth docs (@fritzy)
845
+* [`de2d33f`](https://github.com/npm/cli/commit/de2d33f3ed42e187803bdd31db4f7a12f08f353c) add --install-strategy=hoisted|nested|shallow, deprecate --global-style, --legacy-bundling (#5709) (@fritzy)
846
+* [`58065bc`](https://github.com/npm/cli/commit/58065bc679e6968742b5b15fa2fb82dd9e8ae988) [#5704](https://github.com/npm/cli/pull/5704) do not alter file ownership (@nlf)
847
+* [`475e9b6`](https://github.com/npm/cli/commit/475e9b6c0c978a104dd2ee47bde22b0a031a95f9) [#5703](https://github.com/npm/cli/pull/5703) do not alter file ownership (@nlf)
848
+
849
+### Bug Fixes
850
+
851
+* [`6ffa5b7`](https://github.com/npm/cli/commit/6ffa5b7bbb8fd7cae1a0b955a1f762661ec5e9ed) `npm hook ls` duplicates hook name prefixes (#5295) (@gennadiygashev)
852
+* [`1afe5ba`](https://github.com/npm/cli/commit/1afe5ba9647d1f0f55bf0a4bace543965d05daed) account for new npm-package-arg behavior (@wraithgar)
853
+* [`353b5bb`](https://github.com/npm/cli/commit/353b5bb92c3f7899526536b597252b44aa8a712d) [#5710](https://github.com/npm/cli/pull/5710) remove chownr and mkdirp-infer-owner (@nlf)
854
+
855
+### Documentation
856
+
857
+* [`9e74d3e`](https://github.com/npm/cli/commit/9e74d3e847c4bc0abc630fbe81328e011d6f0187) update supported engines in readme (#5725) (@lukekarrys)
858
+
859
+### Dependencies
860
+
861
+* [`88137a3`](https://github.com/npm/cli/commit/88137a329c8ad418db265dd465768a7cf5ebccb1) `npmlog@7.0.1`
862
+* [`2008ea6`](https://github.com/npm/cli/commit/2008ea6a807acbd97912799adfe97f276202cea6) `npm-package-arg@10.0.0`, `pacote@15.0.2`
863
+* [`aa01072`](https://github.com/npm/cli/commit/aa010722996ef6de46e1bb937c6f8a94dc2844fa) [#5707](https://github.com/npm/cli/pull/5707) update the following dependencies
864
+* [Workspace](https://github.com/npm/cli/compare/arborist-v6.0.0-pre.4...arborist-v6.0.0-pre.5): `@npmcli/arborist@6.0.0-pre.5`
865
+* [Workspace](https://github.com/npm/cli/compare/libnpmaccess-v7.0.0-pre.1...libnpmaccess-v7.0.0-pre.2): `libnpmaccess@7.0.0-pre.2`
866
+* [Workspace](https://github.com/npm/cli/compare/libnpmdiff-v5.0.0-pre.2...libnpmdiff-v5.0.0-pre.3): `libnpmdiff@5.0.0-pre.3`
867
+* [Workspace](https://github.com/npm/cli/compare/libnpmexec-v5.0.0-pre.4...libnpmexec-v5.0.0-pre.5): `libnpmexec@5.0.0-pre.5`
868
+* [Workspace](https://github.com/npm/cli/compare/libnpmfund-v4.0.0-pre.4...libnpmfund-v4.0.0-pre.5): `libnpmfund@4.0.0-pre.5`
869
+* [Workspace](https://github.com/npm/cli/compare/libnpmhook-v9.0.0-pre.0...libnpmhook-v9.0.0-pre.1): `libnpmhook@9.0.0-pre.1`
870
+* [Workspace](https://github.com/npm/cli/compare/libnpmorg-v5.0.0-pre.0...libnpmorg-v5.0.0-pre.1): `libnpmorg@5.0.0-pre.1`
871
+* [Workspace](https://github.com/npm/cli/compare/libnpmpack-v5.0.0-pre.3...libnpmpack-v5.0.0-pre.4): `libnpmpack@5.0.0-pre.4`
872
+* [Workspace](https://github.com/npm/cli/compare/libnpmpublish-v7.0.0-pre.3...libnpmpublish-v7.0.0-pre.4): `libnpmpublish@7.0.0-pre.4`
873
+* [Workspace](https://github.com/npm/cli/compare/libnpmsearch-v6.0.0-pre.0...libnpmsearch-v6.0.0-pre.1): `libnpmsearch@6.0.0-pre.1`
874
+* [Workspace](https://github.com/npm/cli/compare/libnpmteam-v5.0.0-pre.0...libnpmteam-v5.0.0-pre.1): `libnpmteam@5.0.0-pre.1`
875
+* [Workspace](https://github.com/npm/cli/compare/libnpmversion-v4.0.0-pre.0...libnpmversion-v4.0.0-pre.1): `libnpmversion@4.0.0-pre.1`
876
+
877
+## [9.0.0-pre.5](https://github.com/npm/cli/compare/v9.0.0-pre.4...v9.0.0-pre.5) (2022-10-13)
878
+
879
+### ⚠️ BREAKING CHANGES
880
+
881
+* the presence of auth related settings that are not scoped to a specific registry found in a config file is no longer supported and will throw errors
882
+* the `node-version` and `npm-version` configs have been removed.
883
+* links generated from git urls will now use `HEAD` instead of `master` as the default ref
884
+
885
+### Features
886
+
887
+* [`a09e19d`](https://github.com/npm/cli/commit/a09e19d88f046e54e8d75343883635a1bd056310) [#5696](https://github.com/npm/cli/pull/5696) introduce the `npm config fix` command (@nlf)
888
+* [`d2963c6`](https://github.com/npm/cli/commit/d2963c67b992b9b3b9dd32f6f41cbbe4bcc580c8) explicitly validate config within the cli (@nlf)
889
+* [`a5fec08`](https://github.com/npm/cli/commit/a5fec08348add7e75fa2498e6a9efe608b20aa8b) rewrite docs generation (@lukekarrys)
890
+
891
+### Bug Fixes
892
+
893
+* [`a35c784`](https://github.com/npm/cli/commit/a35c784f8c25dce05b4173edd6c3f8e7913d7b50) [#5691](https://github.com/npm/cli/pull/5691) config: remove `node-version` and `npm-version` (@wraithgar)
894
+
895
+### Documentation
896
+
897
+* [`a8532eb`](https://github.com/npm/cli/commit/a8532eb39504584cef452152948e015cef8c010a) [#5661](https://github.com/npm/cli/pull/5661) typo missing parentheses (@hbrls)
898
+* [`542efdb`](https://github.com/npm/cli/commit/542efdb0a31f663cd899bc6d2ddad8fa88c20bc8) update `folders` page for modern npm (@shalvah)
899
+
900
+### Dependencies
901
+
902
+* [`cee3fd9`](https://github.com/npm/cli/commit/cee3fd9905c7eb0a5cb26a8c9c08c5db48becd15) `@npmcli/config@5.0.0`
903
+* [`2a740b1`](https://github.com/npm/cli/commit/2a740b14c3789d80825b1345f2e99765fcb90351) [#5692](https://github.com/npm/cli/pull/5692) `hosted-git-info@6.0.0`
904
+* [Workspace](https://github.com/npm/cli/compare/libnpmpack-v5.0.0-pre.2...libnpmpack-v5.0.0-pre.3): `libnpmpack@5.0.0-pre.3`
905
+* [Workspace](https://github.com/npm/cli/compare/libnpmpublish-v7.0.0-pre.2...libnpmpublish-v7.0.0-pre.3): `libnpmpublish@7.0.0-pre.3`
906
+
907
+## [9.0.0-pre.4](https://github.com/npm/cli/compare/v9.0.0-pre.3...v9.0.0-pre.4) (2022-10-05)
908
+
909
+### Features
910
+
911
+* [`9609e9e`](https://github.com/npm/cli/commit/9609e9eed87c735f0319ac0af265f4d406cbf800) [#5605](https://github.com/npm/cli/pull/5605) use v3 lockfiles by default (#5605) (@fritzy)
912
+
913
+### Bug Fixes
914
+
915
+* [`e4e8ae2`](https://github.com/npm/cli/commit/e4e8ae20aef9e27e57282e87e8757d5b364abb39) libnpmpack: obey foregroundScripts (@winterqt)
916
+* [`07fabc9`](https://github.com/npm/cli/commit/07fabc93007495f0926f4dd24b4350c07d92887d) [#5633](https://github.com/npm/cli/pull/5633) `npm link` should override `--install-links` (#5633) (@fritzy)
917
+* [`02fcbb6`](https://github.com/npm/cli/commit/02fcbb67e6b7cf78cd6dc996570b0ba58132de22) [#5634](https://github.com/npm/cli/pull/5634) ensure Arborist constructor gets passed around everywhere for pacote (#5634) (@nlf)
918
+
919
+### Documentation
920
+
921
+* [`f37caad`](https://github.com/npm/cli/commit/f37caad9e92c50ae949014f6bee6375d9299fb39) [#5606](https://github.com/npm/cli/pull/5606) accurately describe install-links effect on relative paths (#5606) (@lukekarrys)
922
+* [`97c32ed`](https://github.com/npm/cli/commit/97c32ed24d8fa2edcdbb9448839a1f1c9d8fb86f) [#5637](https://github.com/npm/cli/pull/5637) remove link to cache command (#5637) (@wraithgar)
923
+* [`130bc9f`](https://github.com/npm/cli/commit/130bc9fb31fcff956765493a9e3cec668867c30e) [#5626](https://github.com/npm/cli/pull/5626) Remove circular reference (#5626) (@giovanniPepi)
924
+
925
+### Dependencies
926
+
927
+* [`5344d2c`](https://github.com/npm/cli/commit/5344d2ca9ffd1f6db473fd58b46b50179f899ff5) [#5644](https://github.com/npm/cli/pull/5644) `pacote@14.0.0`
928
+* [`6a43b31`](https://github.com/npm/cli/commit/6a43b31eab8bd392ed684d2f906259ddfe0f26b5) `@npmcli/metavuln-calculator@4.0.0`
929
+* [`501f8ca`](https://github.com/npm/cli/commit/501f8ca47bb042f19cdfca4026970caf7160f7f6) [#5640](https://github.com/npm/cli/pull/5640) `semver@7.3.8` (#5640)
930
+* [`8b072dc`](https://github.com/npm/cli/commit/8b072dc113190ed49b296a5f02650b7d8cbf384a) [#5639](https://github.com/npm/cli/pull/5639) `@npmcli/ci-detect@3.0.0` (#5639)
931
+* [`1ebbb44`](https://github.com/npm/cli/commit/1ebbb4454c09891ca2c9f9a11432c4a10ccf8c32) [#5638](https://github.com/npm/cli/pull/5638) `npm-profile@7.0.0` (#5638)
932
+* [Workspace](https://github.com/npm/cli/compare/arborist-v6.0.0-pre.3...arborist-v6.0.0-pre.4): `@npmcli/arborist@6.0.0-pre.4`
933
+* [Workspace](https://github.com/npm/cli/compare/libnpmdiff-v5.0.0-pre.1...libnpmdiff-v5.0.0-pre.2): `libnpmdiff@5.0.0-pre.2`
934
+* [Workspace](https://github.com/npm/cli/compare/libnpmexec-v5.0.0-pre.3...libnpmexec-v5.0.0-pre.4): `libnpmexec@5.0.0-pre.4`
935
+* [Workspace](https://github.com/npm/cli/compare/libnpmfund-v4.0.0-pre.3...libnpmfund-v4.0.0-pre.4): `libnpmfund@4.0.0-pre.4`
936
+* [Workspace](https://github.com/npm/cli/compare/libnpmpack-v5.0.0-pre.1...libnpmpack-v5.0.0-pre.2): `libnpmpack@5.0.0-pre.2`
937
+* [Workspace](https://github.com/npm/cli/compare/libnpmpublish-v7.0.0-pre.1...libnpmpublish-v7.0.0-pre.2): `libnpmpublish@7.0.0-pre.2`
938
+
939
+## [9.0.0-pre.3](https://github.com/npm/cli/compare/v9.0.0-pre.2...v9.0.0-pre.3) (2022-09-30)
940
+
941
+### ⚠️ BREAKING CHANGES
942
+
943
+* `npm pack` now follows a strict order of operations when applying ignore rules. If a files array is present in the package.json, then rules in .gitignore and .npmignore files from the root will be ignored.
944
+* `--timing` file changes:
945
+ - When run with the `--timing` flag, `npm` now writes timing data to a
946
+ file alongside the debug log data, respecting the `logs-dir` option and
947
+ falling back to `<CACHE\>/_logs/` dir, instead of directly inside the
948
+ cache directory.
949
+ - The timing file data is no longer newline delimited JSON, and instead
950
+ each run will create a uniquely named `<ID\>-timing.json` file, with the
951
+ `<ID\>` portion being the same as the debug log.
952
+ - Finally, the data inside the file now has three top level keys,
953
+ `metadata`, `timers, and `unfinishedTimers` instead of everything being
954
+ a top level key.
955
+
956
+### Features
957
+
958
+* [`3ae796d`](https://github.com/npm/cli/commit/3ae796d937bd36a5b1b9fd6e9e8473b4f2ddc32d) implement new `npm-packlist` behavior (@lukekarrys)
959
+* [`e64d69a`](https://github.com/npm/cli/commit/e64d69aedecc0943425605b3a6dc68aec3ad93aa) [#5581](https://github.com/npm/cli/pull/5581) write eresolve error files to the logs directory (@lukekarrys)
960
+* [`3445da0`](https://github.com/npm/cli/commit/3445da0138f9eed9d73d2b3f5f451fcc1fa2e3fe) timings are now written alongside debug log files (@lukekarrys)
961
+
962
+### Documentation
963
+
964
+* [`f0e7584`](https://github.com/npm/cli/commit/f0e758494698d9dd8a58d07bf71c87608c36869e) [#5601](https://github.com/npm/cli/pull/5601) update docs/logging for new --access default (@wraithgar)
965
+
966
+### Dependencies
967
+
968
+* [`bc21552`](https://github.com/npm/cli/commit/bc2155247d00b7a868c414f4bc86993069b035f9) [#5603](https://github.com/npm/cli/pull/5603) `npm-package-arg@9.1.2`
969
+* [Workspace](https://github.com/npm/cli/compare/arborist-v6.0.0-pre.2...arborist-v6.0.0-pre.3): `@npmcli/arborist@6.0.0-pre.3`
970
+* [Workspace](https://github.com/npm/cli/compare/libnpmdiff-v5.0.0-pre.0...libnpmdiff-v5.0.0-pre.1): `libnpmdiff@5.0.0-pre.1`
971
+* [Workspace](https://github.com/npm/cli/compare/libnpmexec-v5.0.0-pre.2...libnpmexec-v5.0.0-pre.3): `libnpmexec@5.0.0-pre.3`
972
+* [Workspace](https://github.com/npm/cli/compare/libnpmfund-v4.0.0-pre.2...libnpmfund-v4.0.0-pre.3): `libnpmfund@4.0.0-pre.3`
973
+* [Workspace](https://github.com/npm/cli/compare/libnpmpack-v5.0.0-pre.0...libnpmpack-v5.0.0-pre.1): `libnpmpack@5.0.0-pre.1`
974
+* [Workspace](https://github.com/npm/cli/compare/libnpmpublish-v7.0.0-pre.0...libnpmpublish-v7.0.0-pre.1): `libnpmpublish@7.0.0-pre.1`
975
+
976
+## [9.0.0-pre.2](https://github.com/npm/cli/compare/v9.0.0-pre.1...v9.0.0-pre.2) (2022-09-23)
977
+
978
+### ⚠️ BREAKING CHANGES
979
+
980
+* the default `auth-type` config value is now `web`
981
+* `login`, `adduser`, and `auth-type` changes
982
+ - This removes all `auth-type` configs except `web` and `legacy`.
983
+ - `login` and `adduser` are now separate commands that send different data to the registry.
984
+ - `auth-type` config values `web` and `legacy` only try
985
+ their respective methods, npm no longer tries them all and waits to see
986
+ which one doesn't fail.
987
+
988
+### Features
989
+
990
+* [`66ed584`](https://github.com/npm/cli/commit/66ed58454418dd69c4cd8196ad8499e73f7e46e1) [#5551](https://github.com/npm/cli/pull/5551) default auth-type to web (#5551) (@wraithgar)
991
+* [`6ee5b32`](https://github.com/npm/cli/commit/6ee5b320d2eab58c18d50b861b3cfabe7f24124a) query: display `queryContext` in results (@nlf)
992
+* [`314311c`](https://github.com/npm/cli/commit/314311c61b8f341715c168199d52976ee3237077) [#5550](https://github.com/npm/cli/pull/5550) separate login/adduser, remove auth types (#5550) (@wraithgar)
993
+
994
+### Bug Fixes
995
+
996
+* [`0d90a01`](https://github.com/npm/cli/commit/0d90a011fff411c878ba4b44582f14ef7dbdceb1) [#5480](https://github.com/npm/cli/pull/5480) audit: add a condition to allow third-party registries returning E400 (#5480) (@juanheyns, Juan Heyns)
997
+
998
+### Documentation
999
+
1000
+* [`2d756cb`](https://github.com/npm/cli/commit/2d756cbb05125dcb769f2ca4c1687e42568d5882) [#5527](https://github.com/npm/cli/pull/5527) add instruction to query objects with npm view (#5527) (@moonith)
1001
+* [`8743366`](https://github.com/npm/cli/commit/874336699681ac37857167b2438fac19c059511c) [#5519](https://github.com/npm/cli/pull/5519) add hash to "tag" config link (#5519) (@mrienstra, @lukekarrys)
1002
+* [`5645c51`](https://github.com/npm/cli/commit/5645c51410a730c4b9c6831cf81ab22efbe8c0ce) [#5521](https://github.com/npm/cli/pull/5521) link mentions of config parameters (#5521) (@mrienstra)
1003
+* [`19762b4`](https://github.com/npm/cli/commit/19762b4ac4b10741ff53ddd315be1fd23d9b1e28) [#5529](https://github.com/npm/cli/pull/5529) modify Misleading doc about bins (@Hafizur046)
1004
+* [`19762b4`](https://github.com/npm/cli/commit/19762b4ac4b10741ff53ddd315be1fd23d9b1e28) [#5529](https://github.com/npm/cli/pull/5529) modify misleading doc about package.json:bin (#5529) (@Hafizur046)
1005
+* [`8402fd8`](https://github.com/npm/cli/commit/8402fd8780c5e0461850da882dca024f7df1a681) [#5547](https://github.com/npm/cli/pull/5547) add `:outdated` pseudo selector to docs (@nlf)
1006
+
1007
+### Dependencies
1008
+
1009
+* [`d030f10`](https://github.com/npm/cli/commit/d030f10fd535433e5a824df1b099f500a71075dd) `@npmcli/query@2.0.0`
1010
+* [Workspace](https://github.com/npm/cli/compare/arborist-v6.0.0-pre.1...arborist-v6.0.0-pre.2): `@npmcli/arborist@6.0.0-pre.2`
1011
+* [Workspace](https://github.com/npm/cli/compare/libnpmexec-v5.0.0-pre.1...libnpmexec-v5.0.0-pre.2): `libnpmexec@5.0.0-pre.2`
1012
+* [Workspace](https://github.com/npm/cli/compare/libnpmfund-v4.0.0-pre.1...libnpmfund-v4.0.0-pre.2): `libnpmfund@4.0.0-pre.2`
1013
+
1014
+## [9.0.0-pre.1](https://github.com/npm/cli/compare/v9.0.0-pre.0...v9.0.0-pre.1) (2022-09-14)
1015
+
1016
+### ⚠️ BREAKING CHANGES
1017
+
1018
+* renames most of the `npm access` subcommands
1019
+* the api for libnpmaccess is different now
1020
+
1021
+### Features
1022
+
1023
+* [`9c32c6c`](https://github.com/npm/cli/commit/9c32c6c8d6fc5bdfd6af685731fe26920d7e5446) rewrite: rewrite `npm access` (@wraithgar)
1024
+* [`854521b`](https://github.com/npm/cli/commit/854521baa49ef88ff9586ec2cc5f1fbaee7fa364) rewrite: Rewrite libnpmaccess (@wraithgar)
1025
+
1026
+### Bug Fixes
1027
+
1028
+* [`c3d7549`](https://github.com/npm/cli/commit/c3d75499cfd4e3601c6ca31621b2f693af466c4d) add tag to publish log message (@wraithgar)
1029
+
1030
+### Documentation
1031
+
1032
+* [`fd0eebe`](https://github.com/npm/cli/commit/fd0eebe4c2b55dd69972aff7de1b4db14ea6799a) update registry docs header (@hughlilly)
1033
+
1034
+### Dependencies
1035
+
1036
+* [Workspace](https://github.com/npm/cli/compare/arborist-v6.0.0-pre.0...arborist-v6.0.0-pre.1): `@npmcli/arborist@6.0.0-pre.1`
1037
+* [Workspace](https://github.com/npm/cli/compare/libnpmaccess-v7.0.0-pre.0...libnpmaccess-v7.0.0-pre.1): `libnpmaccess@7.0.0-pre.1`
1038
+* [Workspace](https://github.com/npm/cli/compare/libnpmexec-v5.0.0-pre.0...libnpmexec-v5.0.0-pre.1): `libnpmexec@5.0.0-pre.1`
1039
+* [Workspace](https://github.com/npm/cli/compare/libnpmfund-v4.0.0-pre.0...libnpmfund-v4.0.0-pre.1): `libnpmfund@4.0.0-pre.1`
1040
+
1041
+## [9.0.0-pre.0](https://github.com/npm/cli/compare/v8.19.1...v9.0.0-pre.0) (2022-09-08)
1042
+
1043
+### ⚠ BREAKING CHANGES
1044
+
1045
+* **workspaces:** all workspace packages are now compatible with the following semver range for node: `^14.17.0 || ^16.13.0 || \>=18.0.0`
1046
+* this removes the `npm birthday` command
1047
+* this removes `npm set-script`
1048
+* this changes the default value of `install-links` to true
1049
+* this removes the `npm bin` command
1050
+* `npm` is now compatible with the following semver range for node: `^14.17.0 || ^16.13.0 || \>=18.0.0`
1051
+
1052
+### Features
1053
+
1054
+ * [`e95017a`](https://github.com/npm/cli/commit/e95017a07b041cbb3293e659dad853f76462c108) [#5485](https://github.com/npm/cli/pull/5485) feat(workspaces): update supported node engines in package.json (@lukekarrys)
1055
+ * [`49bbb2f`](https://github.com/npm/cli/commit/49bbb2fb9d56e02d94da652befaa3d445283090b) [#5455](https://github.com/npm/cli/pull/5455) feat: remove `npm birthday` (@wraithgar)
1056
+ * [`926f0ad`](https://github.com/npm/cli/commit/926f0adbd71949c905932a241a245b78c85ef643) [#5456](https://github.com/npm/cli/pull/5456) feat: remove `npm set-script` (@wraithgar)
1057
+ * [`2a8c2fc`](https://github.com/npm/cli/commit/2a8c2fcd124ce7d4b23a6c26552d097c6501ac74) [#5458](https://github.com/npm/cli/pull/5458) feat: default `install-links` to true (@wraithgar)
1058
+ * [`2e92800`](https://github.com/npm/cli/commit/2e9280072f9852466fa0944d3a0fdb0c8af156a9) [#5459](https://github.com/npm/cli/pull/5459) feat: remove `npm bin` (@wraithgar)
1059
+ * [`457d388`](https://github.com/npm/cli/commit/457d388c9a70b4bc6c2421f576c79fb7524ff259) [#5475](https://github.com/npm/cli/pull/5475) feat: update supported node engines in package.json (@wraithgar)
1060
+
1061
+### Bug Fixes
1062
+
1063
+ * [`41481f8`](https://github.com/npm/cli/commit/41481f8bc1de0fb92a2d6aab3d4a43292d1a1db7) [#5475](https://github.com/npm/cli/pull/5475) fix: attempt more graceful failure in older node versions (@wraithgar)
1064
+
1065
+### Documentation
1066
+
1067
+ * [`7fc2b6f`](https://github.com/npm/cli/commit/7fc2b6f3cc157c8727da9e480f1f552eae2451e2) [#5468](https://github.com/npm/cli/pull/5468) docs: remove duplicate description for `prepare` script (@kidonng)
1068
+ * [`285b39f`](https://github.com/npm/cli/commit/285b39f8d6915823fb424cca7161a0b445b86bd3) [#5324](https://github.com/npm/cli/pull/5324) docs: add documentation for expanded :semver selector (@nlf)
1069
+
1070
+
1071
+### Dependencies
1072
+
1073
+* The following workspace dependencies were updated
1074
+ * dependencies
1075
+ * @npmcli/arborist bumped from ^5.6.1 to ^6.0.0-pre.0
1076
+ * libnpmaccess bumped from ^6.0.4 to ^7.0.0-pre.0
1077
+ * libnpmdiff bumped from ^4.0.5 to ^5.0.0-pre.0
1078
+ * libnpmexec bumped from ^4.0.12 to ^5.0.0-pre.0
1079
+ * libnpmfund bumped from ^3.0.3 to ^4.0.0-pre.0
1080
+ * libnpmhook bumped from ^8.0.4 to ^9.0.0-pre.0
1081
+ * libnpmorg bumped from ^4.0.4 to ^5.0.0-pre.0
1082
+ * libnpmpack bumped from ^4.1.3 to ^5.0.0-pre.0
1083
+ * libnpmpublish bumped from ^6.0.5 to ^7.0.0-pre.0
1084
+ * libnpmsearch bumped from ^5.0.4 to ^6.0.0-pre.0
1085
+ * libnpmteam bumped from ^4.0.4 to ^5.0.0-pre.0
1086
+ * libnpmversion bumped from ^3.0.7 to ^4.0.0-pre.0
content/cli/v10/using-npm/config.md
new
+1951
@@ -0,0 +1,1951 @@
1
+---
2
+title: config
3
+section: 7
4
+description: More than you probably want to know about npm configuration
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/using-npm/config.md
8
+redirect_from:
9
+ - /cli-documentation/v10/misc/config
10
+ - /cli-documentation/v10/using-npm/config
11
+ - /cli/v10/misc/config
12
+---
13
+
14
+### Description
15
+
16
+npm gets its configuration values from the following sources, sorted by priority:
17
+
18
+#### Command Line Flags
19
+
20
+Putting `--foo bar` on the command line sets the `foo` configuration
21
+parameter to `"bar"`. A `--` argument tells the cli parser to stop
22
+reading flags. Using `--flag` without specifying any value will set
23
+the value to `true`.
24
+
25
+Example: `--flag1 --flag2` will set both configuration parameters
26
+to `true`, while `--flag1 --flag2 bar` will set `flag1` to `true`,
27
+and `flag2` to `bar`. Finally, `--flag1 --flag2 -- bar` will set
28
+both configuration parameters to `true`, and the `bar` is taken
29
+as a command argument.
30
+
31
+#### Environment Variables
32
+
33
+Any environment variables that start with `npm_config_` will be
34
+interpreted as a configuration parameter. For example, putting
35
+`npm_config_foo=bar` in your environment will set the `foo`
36
+configuration parameter to `bar`. Any environment configurations that
37
+are not given a value will be given the value of `true`. Config
38
+values are case-insensitive, so `NPM_CONFIG_FOO=bar` will work the
39
+same. However, please note that inside [`scripts`](/cli/v10/using-npm/scripts)
40
+npm will set its own environment variables and Node will prefer
41
+those lowercase versions over any uppercase ones that you might set.
42
+For details see [this issue](https://github.com/npm/npm/issues/14528).
43
+
44
+Notice that you need to use underscores instead of dashes, so `--allow-same-version`
45
+would become `npm_config_allow_same_version=true`.
46
+
47
+#### npmrc Files
48
+
49
+The four relevant files are:
50
+
51
+* per-project configuration file (`/path/to/my/project/.npmrc`)
52
+* per-user configuration file (defaults to `$HOME/.npmrc`; configurable via CLI
53
+ option `--userconfig` or environment variable `$NPM_CONFIG_USERCONFIG`)
54
+* global configuration file (defaults to `$PREFIX/etc/npmrc`; configurable via
55
+ CLI option `--globalconfig` or environment variable `$NPM_CONFIG_GLOBALCONFIG`)
56
+* npm's built-in configuration file (`/path/to/npm/npmrc`)
57
+
58
+See [npmrc](/cli/v10/configuring-npm/npmrc) for more details.
59
+
60
+#### Default Configs
61
+
62
+Run `npm config ls -l` to see a set of configuration parameters that are
63
+internal to npm, and are defaults if nothing else is specified.
64
+
65
+### Shorthands and Other CLI Niceties
66
+
67
+The following shorthands are parsed on the command-line:
68
+
69
+* `-a`: `--all`
70
+* `--enjoy-by`: `--before`
71
+* `-c`: `--call`
72
+* `--desc`: `--description`
73
+* `-f`: `--force`
74
+* `-g`: `--global`
75
+* `--iwr`: `--include-workspace-root`
76
+* `-L`: `--location`
77
+* `-d`: `--loglevel info`
78
+* `-s`: `--loglevel silent`
79
+* `--silent`: `--loglevel silent`
80
+* `--ddd`: `--loglevel silly`
81
+* `--dd`: `--loglevel verbose`
82
+* `--verbose`: `--loglevel verbose`
83
+* `-q`: `--loglevel warn`
84
+* `--quiet`: `--loglevel warn`
85
+* `-l`: `--long`
86
+* `-m`: `--message`
87
+* `--local`: `--no-global`
88
+* `-n`: `--no-yes`
89
+* `--no`: `--no-yes`
90
+* `-p`: `--parseable`
91
+* `--porcelain`: `--parseable`
92
+* `-C`: `--prefix`
93
+* `--readonly`: `--read-only`
94
+* `--reg`: `--registry`
95
+* `-S`: `--save`
96
+* `-B`: `--save-bundle`
97
+* `-D`: `--save-dev`
98
+* `-E`: `--save-exact`
99
+* `-O`: `--save-optional`
100
+* `-P`: `--save-prod`
101
+* `-?`: `--usage`
102
+* `-h`: `--usage`
103
+* `-H`: `--usage`
104
+* `--help`: `--usage`
105
+* `-v`: `--version`
106
+* `-w`: `--workspace`
107
+* `--ws`: `--workspaces`
108
+* `-y`: `--yes`
109
+
110
+If the specified configuration param resolves unambiguously to a known
111
+configuration parameter, then it is expanded to that configuration
112
+parameter. For example:
113
+
114
+```bash
115
+npm ls --par
116
+# same as:
117
+npm ls --parseable
118
+```
119
+
120
+If multiple single-character shorthands are strung together, and the
121
+resulting combination is unambiguously not some other configuration
122
+param, then it is expanded to its various component pieces. For
123
+example:
124
+
125
+```bash
126
+npm ls -gpld
127
+# same as:
128
+npm ls --global --parseable --long --loglevel info
129
+```
130
+
131
+### Config Settings
132
+
133
+#### `_auth`
134
+
135
+* Default: null
136
+* Type: null or String
137
+
138
+A basic-auth string to use when authenticating against the npm registry.
139
+This will ONLY be used to authenticate against the npm registry. For other
140
+registries you will need to scope it like "//other-registry.tld/:_auth"
141
+
142
+Warning: This should generally not be set via a command-line option. It is
143
+safer to use a registry-provided authentication bearer token stored in the
144
+~/.npmrc file by running `npm login`.
145
+
146
+
147
+
148
+#### `access`
149
+
150
+* Default: 'public' for new packages, existing packages it will not change the
151
+ current level
152
+* Type: null, "restricted", or "public"
153
+
154
+If you do not want your scoped package to be publicly viewable (and
155
+installable) set `--access=restricted`.
156
+
157
+Unscoped packages can not be set to `restricted`.
158
+
159
+Note: This defaults to not changing the current access level for existing
160
+packages. Specifying a value of `restricted` or `public` during publish will
161
+change the access for an existing package the same way that `npm access set
162
+status` would.
163
+
164
+
165
+
166
+#### `all`
167
+
168
+* Default: false
169
+* Type: Boolean
170
+
171
+When running `npm outdated` and `npm ls`, setting `--all` will show all
172
+outdated or installed packages, rather than only those directly depended
173
+upon by the current project.
174
+
175
+
176
+
177
+#### `allow-same-version`
178
+
179
+* Default: false
180
+* Type: Boolean
181
+
182
+Prevents throwing an error when `npm version` is used to set the new version
183
+to the same value as the current version.
184
+
185
+
186
+
187
+#### `audit`
188
+
189
+* Default: true
190
+* Type: Boolean
191
+
192
+When "true" submit audit reports alongside the current npm command to the
193
+default registry and all registries configured for scopes. See the
194
+documentation for [`npm audit`](/cli/v10/commands/npm-audit) for details on what is
195
+submitted.
196
+
197
+
198
+
199
+#### `audit-level`
200
+
201
+* Default: null
202
+* Type: null, "info", "low", "moderate", "high", "critical", or "none"
203
+
204
+The minimum level of vulnerability for `npm audit` to exit with a non-zero
205
+exit code.
206
+
207
+
208
+
209
+#### `auth-type`
210
+
211
+* Default: "web"
212
+* Type: "legacy" or "web"
213
+
214
+What authentication strategy to use with `login`. Note that if an `otp`
215
+config is given, this value will always be set to `legacy`.
216
+
217
+
218
+
219
+#### `before`
220
+
221
+* Default: null
222
+* Type: null or Date
223
+
224
+If passed to `npm install`, will rebuild the npm tree such that only
225
+versions that were available **on or before** the `--before` time get
226
+installed. If there's no versions available for the current set of direct
227
+dependencies, the command will error.
228
+
229
+If the requested version is a `dist-tag` and the given tag does not pass the
230
+`--before` filter, the most recent version less than or equal to that tag
231
+will be used. For example, `foo@latest` might install `foo@1.2` even though
232
+`latest` is `2.0`.
233
+
234
+
235
+
236
+#### `bin-links`
237
+
238
+* Default: true
239
+* Type: Boolean
240
+
241
+Tells npm to create symlinks (or `.cmd` shims on Windows) for package
242
+executables.
243
+
244
+Set to false to have it not do this. This can be used to work around the
245
+fact that some file systems don't support symlinks, even on ostensibly Unix
246
+systems.
247
+
248
+
249
+
250
+#### `browser`
251
+
252
+* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
253
+* Type: null, Boolean, or String
254
+
255
+The browser that is called by npm commands to open websites.
256
+
257
+Set to `false` to suppress browser behavior and instead print urls to
258
+terminal.
259
+
260
+Set to `true` to use default system URL opener.
261
+
262
+
263
+
264
+#### `ca`
265
+
266
+* Default: null
267
+* Type: null or String (can be set multiple times)
268
+
269
+The Certificate Authority signing certificate that is trusted for SSL
270
+connections to the registry. Values should be in PEM format (Windows calls
271
+it "Base-64 encoded X.509 (.CER)") with newlines replaced by the string
272
+"\n". For example:
273
+
274
+```ini
275
+ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
276
+```
277
+
278
+Set to `null` to only allow "known" registrars, or to a specific CA cert to
279
+trust only that specific signing authority.
280
+
281
+Multiple CAs can be trusted by specifying an array of certificates:
282
+
283
+```ini
284
+ca[]="..."
285
+ca[]="..."
286
+```
287
+
288
+See also the `strict-ssl` config.
289
+
290
+
291
+
292
+#### `cache`
293
+
294
+* Default: Windows: `%LocalAppData%\npm-cache`, Posix: `~/.npm`
295
+* Type: Path
296
+
297
+The location of npm's cache directory.
298
+
299
+
300
+
301
+#### `cafile`
302
+
303
+* Default: null
304
+* Type: Path
305
+
306
+A path to a file containing one or multiple Certificate Authority signing
307
+certificates. Similar to the `ca` setting, but allows for multiple CA's, as
308
+well as for the CA information to be stored in a file on disk.
309
+
310
+
311
+
312
+#### `call`
313
+
314
+* Default: ""
315
+* Type: String
316
+
317
+Optional companion option for `npm exec`, `npx` that allows for specifying a
318
+custom command to be run along with the installed packages.
319
+
320
+```bash
321
+npm exec --package yo --package generator-node --call "yo node"
322
+```
323
+
324
+
325
+
326
+#### `cidr`
327
+
328
+* Default: null
329
+* Type: null or String (can be set multiple times)
330
+
331
+This is a list of CIDR address to be used when configuring limited access
332
+tokens with the `npm token create` command.
333
+
334
+
335
+
336
+#### `color`
337
+
338
+* Default: true unless the NO_COLOR environ is set to something other than '0'
339
+* Type: "always" or Boolean
340
+
341
+If false, never shows colors. If `"always"` then always shows colors. If
342
+true, then only prints color codes for tty file descriptors.
343
+
344
+
345
+
346
+#### `commit-hooks`
347
+
348
+* Default: true
349
+* Type: Boolean
350
+
351
+Run git commit hooks when using the `npm version` command.
352
+
353
+
354
+
355
+#### `depth`
356
+
357
+* Default: `Infinity` if `--all` is set, otherwise `1`
358
+* Type: null or Number
359
+
360
+The depth to go when recursing packages for `npm ls`.
361
+
362
+If not set, `npm ls` will show only the immediate dependencies of the root
363
+project. If `--all` is set, then npm will show all dependencies by default.
364
+
365
+
366
+
367
+#### `description`
368
+
369
+* Default: true
370
+* Type: Boolean
371
+
372
+Show the description in `npm search`
373
+
374
+
375
+
376
+#### `diff`
377
+
378
+* Default:
379
+* Type: String (can be set multiple times)
380
+
381
+Define arguments to compare in `npm diff`.
382
+
383
+
384
+
385
+#### `diff-dst-prefix`
386
+
387
+* Default: "b/"
388
+* Type: String
389
+
390
+Destination prefix to be used in `npm diff` output.
391
+
392
+
393
+
394
+#### `diff-ignore-all-space`
395
+
396
+* Default: false
397
+* Type: Boolean
398
+
399
+Ignore whitespace when comparing lines in `npm diff`.
400
+
401
+
402
+
403
+#### `diff-name-only`
404
+
405
+* Default: false
406
+* Type: Boolean
407
+
408
+Prints only filenames when using `npm diff`.
409
+
410
+
411
+
412
+#### `diff-no-prefix`
413
+
414
+* Default: false
415
+* Type: Boolean
416
+
417
+Do not show any source or destination prefix in `npm diff` output.
418
+
419
+Note: this causes `npm diff` to ignore the `--diff-src-prefix` and
420
+`--diff-dst-prefix` configs.
421
+
422
+
423
+
424
+#### `diff-src-prefix`
425
+
426
+* Default: "a/"
427
+* Type: String
428
+
429
+Source prefix to be used in `npm diff` output.
430
+
431
+
432
+
433
+#### `diff-text`
434
+
435
+* Default: false
436
+* Type: Boolean
437
+
438
+Treat all files as text in `npm diff`.
439
+
440
+
441
+
442
+#### `diff-unified`
443
+
444
+* Default: 3
445
+* Type: Number
446
+
447
+The number of lines of context to print in `npm diff`.
448
+
449
+
450
+
451
+#### `dry-run`
452
+
453
+* Default: false
454
+* Type: Boolean
455
+
456
+Indicates that you don't want npm to make any changes and that it should
457
+only report what it would have done. This can be passed into any of the
458
+commands that modify your local installation, eg, `install`, `update`,
459
+`dedupe`, `uninstall`, as well as `pack` and `publish`.
460
+
461
+Note: This is NOT honored by other network related commands, eg `dist-tags`,
462
+`owner`, etc.
463
+
464
+
465
+
466
+#### `editor`
467
+
468
+* Default: The EDITOR or VISUAL environment variables, or
469
+ '%SYSTEMROOT%\notepad.exe' on Windows, or 'vi' on Unix systems
470
+* Type: String
471
+
472
+The command to run for `npm edit` and `npm config edit`.
473
+
474
+
475
+
476
+#### `engine-strict`
477
+
478
+* Default: false
479
+* Type: Boolean
480
+
481
+If set to true, then npm will stubbornly refuse to install (or even consider
482
+installing) any package that claims to not be compatible with the current
483
+Node.js version.
484
+
485
+This can be overridden by setting the `--force` flag.
486
+
487
+
488
+
489
+#### `fetch-retries`
490
+
491
+* Default: 2
492
+* Type: Number
493
+
494
+The "retries" config for the `retry` module to use when fetching packages
495
+from the registry.
496
+
497
+npm will retry idempotent read requests to the registry in the case of
498
+network failures or 5xx HTTP errors.
499
+
500
+
501
+
502
+#### `fetch-retry-factor`
503
+
504
+* Default: 10
505
+* Type: Number
506
+
507
+The "factor" config for the `retry` module to use when fetching packages.
508
+
509
+
510
+
511
+#### `fetch-retry-maxtimeout`
512
+
513
+* Default: 60000 (1 minute)
514
+* Type: Number
515
+
516
+The "maxTimeout" config for the `retry` module to use when fetching
517
+packages.
518
+
519
+
520
+
521
+#### `fetch-retry-mintimeout`
522
+
523
+* Default: 10000 (10 seconds)
524
+* Type: Number
525
+
526
+The "minTimeout" config for the `retry` module to use when fetching
527
+packages.
528
+
529
+
530
+
531
+#### `fetch-timeout`
532
+
533
+* Default: 300000 (5 minutes)
534
+* Type: Number
535
+
536
+The maximum amount of time to wait for HTTP requests to complete.
537
+
538
+
539
+
540
+#### `force`
541
+
542
+* Default: false
543
+* Type: Boolean
544
+
545
+Removes various protections against unfortunate side effects, common
546
+mistakes, unnecessary performance degradation, and malicious input.
547
+
548
+* Allow clobbering non-npm files in global installs.
549
+* Allow the `npm version` command to work on an unclean git repository.
550
+* Allow deleting the cache folder with `npm cache clean`.
551
+* Allow installing packages that have an `engines` declaration requiring a
552
+ different version of npm.
553
+* Allow installing packages that have an `engines` declaration requiring a
554
+ different version of `node`, even if `--engine-strict` is enabled.
555
+* Allow `npm audit fix` to install modules outside your stated dependency
556
+ range (including SemVer-major changes).
557
+* Allow unpublishing all versions of a published package.
558
+* Allow conflicting peerDependencies to be installed in the root project.
559
+* Implicitly set `--yes` during `npm init`.
560
+* Allow clobbering existing values in `npm pkg`
561
+* Allow unpublishing of entire packages (not just a single version).
562
+
563
+If you don't have a clear idea of what you want to do, it is strongly
564
+recommended that you do not use this option!
565
+
566
+
567
+
568
+#### `foreground-scripts`
569
+
570
+* Default: false
571
+* Type: Boolean
572
+
573
+Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)
574
+scripts for installed packages in the foreground process, sharing standard
575
+input, output, and error with the main npm process.
576
+
577
+Note that this will generally make installs run slower, and be much noisier,
578
+but can be useful for debugging.
579
+
580
+
581
+
582
+#### `format-package-lock`
583
+
584
+* Default: true
585
+* Type: Boolean
586
+
587
+Format `package-lock.json` or `npm-shrinkwrap.json` as a human readable
588
+file.
589
+
590
+
591
+
592
+#### `fund`
593
+
594
+* Default: true
595
+* Type: Boolean
596
+
597
+When "true" displays the message at the end of each `npm install`
598
+acknowledging the number of dependencies looking for funding. See [`npm
599
+fund`](/cli/v10/commands/npm-fund) for details.
600
+
601
+
602
+
603
+#### `git`
604
+
605
+* Default: "git"
606
+* Type: String
607
+
608
+The command to use for git commands. If git is installed on the computer,
609
+but is not in the `PATH`, then set this to the full path to the git binary.
610
+
611
+
612
+
613
+#### `git-tag-version`
614
+
615
+* Default: true
616
+* Type: Boolean
617
+
618
+Tag the commit when using the `npm version` command. Setting this to false
619
+results in no commit being made at all.
620
+
621
+
622
+
623
+#### `global`
624
+
625
+* Default: false
626
+* Type: Boolean
627
+
628
+Operates in "global" mode, so that packages are installed into the `prefix`
629
+folder instead of the current working directory. See
630
+[folders](/cli/v10/configuring-npm/folders) for more on the differences in behavior.
631
+
632
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
633
+ of the current working directory.
634
+* bin files are linked to `{prefix}/bin`
635
+* man pages are linked to `{prefix}/share/man`
636
+
637
+
638
+
639
+#### `globalconfig`
640
+
641
+* Default: The global --prefix setting plus 'etc/npmrc'. For example,
642
+ '/usr/local/etc/npmrc'
643
+* Type: Path
644
+
645
+The config file to read for global config options.
646
+
647
+
648
+
649
+#### `heading`
650
+
651
+* Default: "npm"
652
+* Type: String
653
+
654
+The string that starts all the debugging log output.
655
+
656
+
657
+
658
+#### `https-proxy`
659
+
660
+* Default: null
661
+* Type: null or URL
662
+
663
+A proxy to use for outgoing https requests. If the `HTTPS_PROXY` or
664
+`https_proxy` or `HTTP_PROXY` or `http_proxy` environment variables are set,
665
+proxy settings will be honored by the underlying `make-fetch-happen`
666
+library.
667
+
668
+
669
+
670
+#### `if-present`
671
+
672
+* Default: false
673
+* Type: Boolean
674
+
675
+If true, npm will not exit with an error code when `run-script` is invoked
676
+for a script that isn't defined in the `scripts` section of `package.json`.
677
+This option can be used when it's desirable to optionally run a script when
678
+it's present and fail if the script fails. This is useful, for example, when
679
+running scripts that may only apply for some builds in an otherwise generic
680
+CI setup.
681
+
682
+This value is not exported to the environment for child processes.
683
+
684
+#### `ignore-scripts`
685
+
686
+* Default: false
687
+* Type: Boolean
688
+
689
+If true, npm does not run scripts specified in package.json files.
690
+
691
+Note that commands explicitly intended to run a particular script, such as
692
+`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
693
+will still run their intended script if `ignore-scripts` is set, but they
694
+will *not* run any pre- or post-scripts.
695
+
696
+
697
+
698
+#### `include`
699
+
700
+* Default:
701
+* Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
702
+
703
+Option that allows for defining which types of dependencies to install.
704
+
705
+This is the inverse of `--omit=<type>`.
706
+
707
+Dependency types specified in `--include` will not be omitted, regardless of
708
+the order in which omit/include are specified on the command-line.
709
+
710
+
711
+
712
+#### `include-staged`
713
+
714
+* Default: false
715
+* Type: Boolean
716
+
717
+Allow installing "staged" published packages, as defined by [npm RFC PR
718
+#92](https://github.com/npm/rfcs/pull/92).
719
+
720
+This is experimental, and not implemented by the npm public registry.
721
+
722
+
723
+
724
+#### `include-workspace-root`
725
+
726
+* Default: false
727
+* Type: Boolean
728
+
729
+Include the workspace root when workspaces are enabled for a command.
730
+
731
+When false, specifying individual workspaces via the `workspace` config, or
732
+all workspaces via the `workspaces` flag, will cause npm to operate only on
733
+the specified workspaces, and not on the root project.
734
+
735
+This value is not exported to the environment for child processes.
736
+
737
+#### `init-author-email`
738
+
739
+* Default: ""
740
+* Type: String
741
+
742
+The value `npm init` should use by default for the package author's email.
743
+
744
+
745
+
746
+#### `init-author-name`
747
+
748
+* Default: ""
749
+* Type: String
750
+
751
+The value `npm init` should use by default for the package author's name.
752
+
753
+
754
+
755
+#### `init-author-url`
756
+
757
+* Default: ""
758
+* Type: "" or URL
759
+
760
+The value `npm init` should use by default for the package author's
761
+homepage.
762
+
763
+
764
+
765
+#### `init-license`
766
+
767
+* Default: "ISC"
768
+* Type: String
769
+
770
+The value `npm init` should use by default for the package license.
771
+
772
+
773
+
774
+#### `init-module`
775
+
776
+* Default: "~/.npm-init.js"
777
+* Type: Path
778
+
779
+A module that will be loaded by the `npm init` command. See the
780
+documentation for the
781
+[init-package-json](https://github.com/npm/init-package-json) module for
782
+more information, or [npm init](/cli/v10/commands/npm-init).
783
+
784
+
785
+
786
+#### `init-version`
787
+
788
+* Default: "1.0.0"
789
+* Type: SemVer string
790
+
791
+The value that `npm init` should use by default for the package version
792
+number, if not already set in package.json.
793
+
794
+
795
+
796
+#### `install-links`
797
+
798
+* Default: false
799
+* Type: Boolean
800
+
801
+When set file: protocol dependencies will be packed and installed as regular
802
+dependencies instead of creating a symlink. This option has no effect on
803
+workspaces.
804
+
805
+
806
+
807
+#### `install-strategy`
808
+
809
+* Default: "hoisted"
810
+* Type: "hoisted", "nested", "shallow", or "linked"
811
+
812
+Sets the strategy for installing packages in node_modules. hoisted
813
+(default): Install non-duplicated in top-level, and duplicated as necessary
814
+within directory structure. nested: (formerly --legacy-bundling) install in
815
+place, no hoisting. shallow (formerly --global-style) only install direct
816
+deps at top-level. linked: (experimental) install in node_modules/.store,
817
+link in place, unhoisted.
818
+
819
+
820
+
821
+#### `json`
822
+
823
+* Default: false
824
+* Type: Boolean
825
+
826
+Whether or not to output JSON data, rather than the normal output.
827
+
828
+* In `npm pkg set` it enables parsing set values with JSON.parse() before
829
+ saving them to your `package.json`.
830
+
831
+Not supported by all npm commands.
832
+
833
+
834
+
835
+#### `legacy-peer-deps`
836
+
837
+* Default: false
838
+* Type: Boolean
839
+
840
+Causes npm to completely ignore `peerDependencies` when building a package
841
+tree, as in npm versions 3 through 6.
842
+
843
+If a package cannot be installed because of overly strict `peerDependencies`
844
+that collide, it provides a way to move forward resolving the situation.
845
+
846
+This differs from `--omit=peer`, in that `--omit=peer` will avoid unpacking
847
+`peerDependencies` on disk, but will still design a tree such that
848
+`peerDependencies` _could_ be unpacked in a correct place.
849
+
850
+Use of `legacy-peer-deps` is not recommended, as it will not enforce the
851
+`peerDependencies` contract that meta-dependencies may rely on.
852
+
853
+
854
+
855
+#### `link`
856
+
857
+* Default: false
858
+* Type: Boolean
859
+
860
+Used with `npm ls`, limiting output to only those packages that are linked.
861
+
862
+
863
+
864
+#### `local-address`
865
+
866
+* Default: null
867
+* Type: IP Address
868
+
869
+The IP address of the local interface to use when making connections to the
870
+npm registry. Must be IPv4 in versions of Node prior to 0.12.
871
+
872
+
873
+
874
+#### `location`
875
+
876
+* Default: "user" unless `--global` is passed, which will also set this value
877
+ to "global"
878
+* Type: "global", "user", or "project"
879
+
880
+When passed to `npm config` this refers to which config file to use.
881
+
882
+When set to "global" mode, packages are installed into the `prefix` folder
883
+instead of the current working directory. See
884
+[folders](/cli/v10/configuring-npm/folders) for more on the differences in behavior.
885
+
886
+* packages are installed into the `{prefix}/lib/node_modules` folder, instead
887
+ of the current working directory.
888
+* bin files are linked to `{prefix}/bin`
889
+* man pages are linked to `{prefix}/share/man`
890
+
891
+
892
+
893
+#### `lockfile-version`
894
+
895
+* Default: Version 3 if no lockfile, auto-converting v1 lockfiles to v3,
896
+ otherwise maintain current lockfile version.
897
+* Type: null, 1, 2, 3, "1", "2", or "3"
898
+
899
+Set the lockfile format version to be used in package-lock.json and
900
+npm-shrinkwrap-json files. Possible options are:
901
+
902
+1: The lockfile version used by npm versions 5 and 6. Lacks some data that
903
+is used during the install, resulting in slower and possibly less
904
+deterministic installs. Prevents lockfile churn when interoperating with
905
+older npm versions.
906
+
907
+2: The default lockfile version used by npm version 7 and 8. Includes both
908
+the version 1 lockfile data and version 3 lockfile data, for maximum
909
+determinism and interoperability, at the expense of more bytes on disk.
910
+
911
+3: Only the new lockfile information introduced in npm version 7. Smaller on
912
+disk than lockfile version 2, but not interoperable with older npm versions.
913
+Ideal if all users are on npm version 7 and higher.
914
+
915
+
916
+
917
+#### `loglevel`
918
+
919
+* Default: "notice"
920
+* Type: "silent", "error", "warn", "notice", "http", "info", "verbose", or
921
+ "silly"
922
+
923
+What level of logs to report. All logs are written to a debug log, with the
924
+path to that file printed if the execution of a command fails.
925
+
926
+Any logs of a higher level than the setting are shown. The default is
927
+"notice".
928
+
929
+See also the `foreground-scripts` config.
930
+
931
+
932
+
933
+#### `logs-dir`
934
+
935
+* Default: A directory named `_logs` inside the cache
936
+* Type: null or Path
937
+
938
+The location of npm's log directory. See [`npm logging`](/cli/v10/using-npm/logging)
939
+for more information.
940
+
941
+
942
+
943
+#### `logs-max`
944
+
945
+* Default: 10
946
+* Type: Number
947
+
948
+The maximum number of log files to store.
949
+
950
+If set to 0, no log files will be written for the current run.
951
+
952
+
953
+
954
+#### `long`
955
+
956
+* Default: false
957
+* Type: Boolean
958
+
959
+Show extended information in `ls`, `search`, and `help-search`.
960
+
961
+
962
+
963
+#### `maxsockets`
964
+
965
+* Default: 15
966
+* Type: Number
967
+
968
+The maximum number of connections to use per origin (protocol/host/port
969
+combination).
970
+
971
+
972
+
973
+#### `message`
974
+
975
+* Default: "%s"
976
+* Type: String
977
+
978
+Commit message which is used by `npm version` when creating version commit.
979
+
980
+Any "%s" in the message will be replaced with the version number.
981
+
982
+
983
+
984
+#### `node-options`
985
+
986
+* Default: null
987
+* Type: null or String
988
+
989
+Options to pass through to Node.js via the `NODE_OPTIONS` environment
990
+variable. This does not impact how npm itself is executed but it does impact
991
+how lifecycle scripts are called.
992
+
993
+
994
+
995
+#### `noproxy`
996
+
997
+* Default: The value of the NO_PROXY environment variable
998
+* Type: String (can be set multiple times)
999
+
1000
+Domain extensions that should bypass any proxies.
1001
+
1002
+Also accepts a comma-delimited string.
1003
+
1004
+
1005
+
1006
+#### `offline`
1007
+
1008
+* Default: false
1009
+* Type: Boolean
1010
+
1011
+Force offline mode: no network requests will be done during install. To
1012
+allow the CLI to fill in missing cache data, see `--prefer-offline`.
1013
+
1014
+
1015
+
1016
+#### `omit`
1017
+
1018
+* Default: 'dev' if the `NODE_ENV` environment variable is set to
1019
+ 'production', otherwise empty.
1020
+* Type: "dev", "optional", or "peer" (can be set multiple times)
1021
+
1022
+Dependency types to omit from the installation tree on disk.
1023
+
1024
+Note that these dependencies _are_ still resolved and added to the
1025
+`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
1026
+physically installed on disk.
1027
+
1028
+If a package type appears in both the `--include` and `--omit` lists, then
1029
+it will be included.
1030
+
1031
+If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
1032
+variable will be set to `'production'` for all lifecycle scripts.
1033
+
1034
+
1035
+
1036
+#### `omit-lockfile-registry-resolved`
1037
+
1038
+* Default: false
1039
+* Type: Boolean
1040
+
1041
+This option causes npm to create lock files without a `resolved` key for
1042
+registry dependencies. Subsequent installs will need to resolve tarball
1043
+endpoints with the configured registry, likely resulting in a longer install
1044
+time.
1045
+
1046
+
1047
+
1048
+#### `otp`
1049
+
1050
+* Default: null
1051
+* Type: null or String
1052
+
1053
+This is a one-time password from a two-factor authenticator. It's needed
1054
+when publishing or changing package permissions with `npm access`.
1055
+
1056
+If not set, and a registry response fails with a challenge for a one-time
1057
+password, npm will prompt on the command line for one.
1058
+
1059
+
1060
+
1061
+#### `pack-destination`
1062
+
1063
+* Default: "."
1064
+* Type: String
1065
+
1066
+Directory in which `npm pack` will save tarballs.
1067
+
1068
+
1069
+
1070
+#### `package`
1071
+
1072
+* Default:
1073
+* Type: String (can be set multiple times)
1074
+
1075
+The package or packages to install for [`npm exec`](/cli/v10/commands/npm-exec)
1076
+
1077
+
1078
+
1079
+#### `package-lock`
1080
+
1081
+* Default: true
1082
+* Type: Boolean
1083
+
1084
+If set to false, then ignore `package-lock.json` files when installing. This
1085
+will also prevent _writing_ `package-lock.json` if `save` is true.
1086
+
1087
+
1088
+
1089
+#### `package-lock-only`
1090
+
1091
+* Default: false
1092
+* Type: Boolean
1093
+
1094
+If set to true, the current operation will only use the `package-lock.json`,
1095
+ignoring `node_modules`.
1096
+
1097
+For `update` this means only the `package-lock.json` will be updated,
1098
+instead of checking `node_modules` and downloading dependencies.
1099
+
1100
+For `list` this means the output will be based on the tree described by the
1101
+`package-lock.json`, rather than the contents of `node_modules`.
1102
+
1103
+
1104
+
1105
+#### `parseable`
1106
+
1107
+* Default: false
1108
+* Type: Boolean
1109
+
1110
+Output parseable results from commands that write to standard output. For
1111
+`npm search`, this will be tab-separated table format.
1112
+
1113
+
1114
+
1115
+#### `prefer-dedupe`
1116
+
1117
+* Default: false
1118
+* Type: Boolean
1119
+
1120
+Prefer to deduplicate packages if possible, rather than choosing a newer
1121
+version of a dependency.
1122
+
1123
+
1124
+
1125
+#### `prefer-offline`
1126
+
1127
+* Default: false
1128
+* Type: Boolean
1129
+
1130
+If true, staleness checks for cached data will be bypassed, but missing data
1131
+will be requested from the server. To force full offline mode, use
1132
+`--offline`.
1133
+
1134
+
1135
+
1136
+#### `prefer-online`
1137
+
1138
+* Default: false
1139
+* Type: Boolean
1140
+
1141
+If true, staleness checks for cached data will be forced, making the CLI
1142
+look for updates immediately even for fresh package data.
1143
+
1144
+
1145
+
1146
+#### `prefix`
1147
+
1148
+* Default: In global mode, the folder where the node executable is installed.
1149
+ Otherwise, the nearest parent folder containing either a package.json file
1150
+ or a node_modules folder.
1151
+* Type: Path
1152
+
1153
+The location to install global items. If set on the command line, then it
1154
+forces non-global commands to run in the specified folder.
1155
+
1156
+
1157
+
1158
+#### `preid`
1159
+
1160
+* Default: ""
1161
+* Type: String
1162
+
1163
+The "prerelease identifier" to use as a prefix for the "prerelease" part of
1164
+a semver. Like the `rc` in `1.2.0-rc.8`.
1165
+
1166
+
1167
+
1168
+#### `progress`
1169
+
1170
+* Default: `true` unless running in a known CI system
1171
+* Type: Boolean
1172
+
1173
+When set to `true`, npm will display a progress bar during time intensive
1174
+operations, if `process.stderr` is a TTY.
1175
+
1176
+Set to `false` to suppress the progress bar.
1177
+
1178
+
1179
+
1180
+#### `provenance`
1181
+
1182
+* Default: false
1183
+* Type: Boolean
1184
+
1185
+When publishing from a supported cloud CI/CD system, the package will be
1186
+publicly linked to where it was built and published from.
1187
+
1188
+This config can not be used with: `provenance-file`
1189
+
1190
+#### `provenance-file`
1191
+
1192
+* Default: null
1193
+* Type: Path
1194
+
1195
+When publishing, the provenance bundle at the given path will be used.
1196
+
1197
+This config can not be used with: `provenance`
1198
+
1199
+#### `proxy`
1200
+
1201
+* Default: null
1202
+* Type: null, false, or URL
1203
+
1204
+A proxy to use for outgoing http requests. If the `HTTP_PROXY` or
1205
+`http_proxy` environment variables are set, proxy settings will be honored
1206
+by the underlying `request` library.
1207
+
1208
+
1209
+
1210
+#### `read-only`
1211
+
1212
+* Default: false
1213
+* Type: Boolean
1214
+
1215
+This is used to mark a token as unable to publish when configuring limited
1216
+access tokens with the `npm token create` command.
1217
+
1218
+
1219
+
1220
+#### `rebuild-bundle`
1221
+
1222
+* Default: true
1223
+* Type: Boolean
1224
+
1225
+Rebuild bundled dependencies after installation.
1226
+
1227
+
1228
+
1229
+#### `registry`
1230
+
1231
+* Default: "https://registry.npmjs.org/"
1232
+* Type: URL
1233
+
1234
+The base URL of the npm registry.
1235
+
1236
+
1237
+
1238
+#### `replace-registry-host`
1239
+
1240
+* Default: "npmjs"
1241
+* Type: "npmjs", "never", "always", or String
1242
+
1243
+Defines behavior for replacing the registry host in a lockfile with the
1244
+configured registry.
1245
+
1246
+The default behavior is to replace package dist URLs from the default
1247
+registry (https://registry.npmjs.org) to the configured registry. If set to
1248
+"never", then use the registry value. If set to "always", then replace the
1249
+registry host with the configured host every time.
1250
+
1251
+You may also specify a bare hostname (e.g., "registry.npmjs.org").
1252
+
1253
+
1254
+
1255
+#### `save`
1256
+
1257
+* Default: `true` unless when using `npm update` where it defaults to `false`
1258
+* Type: Boolean
1259
+
1260
+Save installed packages to a `package.json` file as dependencies.
1261
+
1262
+When used with the `npm rm` command, removes the dependency from
1263
+`package.json`.
1264
+
1265
+Will also prevent writing to `package-lock.json` if set to `false`.
1266
+
1267
+
1268
+
1269
+#### `save-bundle`
1270
+
1271
+* Default: false
1272
+* Type: Boolean
1273
+
1274
+If a package would be saved at install time by the use of `--save`,
1275
+`--save-dev`, or `--save-optional`, then also put it in the
1276
+`bundleDependencies` list.
1277
+
1278
+Ignored if `--save-peer` is set, since peerDependencies cannot be bundled.
1279
+
1280
+
1281
+
1282
+#### `save-dev`
1283
+
1284
+* Default: false
1285
+* Type: Boolean
1286
+
1287
+Save installed packages to a package.json file as `devDependencies`.
1288
+
1289
+
1290
+
1291
+#### `save-exact`
1292
+
1293
+* Default: false
1294
+* Type: Boolean
1295
+
1296
+Dependencies saved to package.json will be configured with an exact version
1297
+rather than using npm's default semver range operator.
1298
+
1299
+
1300
+
1301
+#### `save-optional`
1302
+
1303
+* Default: false
1304
+* Type: Boolean
1305
+
1306
+Save installed packages to a package.json file as `optionalDependencies`.
1307
+
1308
+
1309
+
1310
+#### `save-peer`
1311
+
1312
+* Default: false
1313
+* Type: Boolean
1314
+
1315
+Save installed packages to a package.json file as `peerDependencies`
1316
+
1317
+
1318
+
1319
+#### `save-prefix`
1320
+
1321
+* Default: "^"
1322
+* Type: String
1323
+
1324
+Configure how versions of packages installed to a package.json file via
1325
+`--save` or `--save-dev` get prefixed.
1326
+
1327
+For example if a package has version `1.2.3`, by default its version is set
1328
+to `^1.2.3` which allows minor upgrades for that package, but after `npm
1329
+config set save-prefix='~'` it would be set to `~1.2.3` which only allows
1330
+patch upgrades.
1331
+
1332
+
1333
+
1334
+#### `save-prod`
1335
+
1336
+* Default: false
1337
+* Type: Boolean
1338
+
1339
+Save installed packages into `dependencies` specifically. This is useful if
1340
+a package already exists in `devDependencies` or `optionalDependencies`, but
1341
+you want to move it to be a non-optional production dependency.
1342
+
1343
+This is the default behavior if `--save` is true, and neither `--save-dev`
1344
+or `--save-optional` are true.
1345
+
1346
+
1347
+
1348
+#### `scope`
1349
+
1350
+* Default: the scope of the current project, if any, or ""
1351
+* Type: String
1352
+
1353
+Associate an operation with a scope for a scoped registry.
1354
+
1355
+Useful when logging in to or out of a private registry:
1356
+
1357
+```
1358
+# log in, linking the scope to the custom registry
1359
+npm login --scope=@mycorp --registry=https://registry.mycorp.com
1360
+
1361
+# log out, removing the link and the auth token
1362
+npm logout --scope=@mycorp
1363
+```
1364
+
1365
+This will cause `@mycorp` to be mapped to the registry for future
1366
+installation of packages specified according to the pattern
1367
+`@mycorp/package`.
1368
+
1369
+This will also cause `npm init` to create a scoped package.
1370
+
1371
+```
1372
+# accept all defaults, and create a package named "@foo/whatever",
1373
+# instead of just named "whatever"
1374
+npm init --scope=@foo --yes
1375
+```
1376
+
1377
+
1378
+
1379
+#### `script-shell`
1380
+
1381
+* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
1382
+* Type: null or String
1383
+
1384
+The shell to use for scripts run with the `npm exec`, `npm run` and `npm
1385
+init <package-spec>` commands.
1386
+
1387
+
1388
+
1389
+#### `searchexclude`
1390
+
1391
+* Default: ""
1392
+* Type: String
1393
+
1394
+Space-separated options that limit the results from search.
1395
+
1396
+
1397
+
1398
+#### `searchlimit`
1399
+
1400
+* Default: 20
1401
+* Type: Number
1402
+
1403
+Number of items to limit search results to. Will not apply at all to legacy
1404
+searches.
1405
+
1406
+
1407
+
1408
+#### `searchopts`
1409
+
1410
+* Default: ""
1411
+* Type: String
1412
+
1413
+Space-separated options that are always passed to search.
1414
+
1415
+
1416
+
1417
+#### `searchstaleness`
1418
+
1419
+* Default: 900
1420
+* Type: Number
1421
+
1422
+The age of the cache, in seconds, before another registry request is made if
1423
+using legacy search endpoint.
1424
+
1425
+
1426
+
1427
+#### `shell`
1428
+
1429
+* Default: SHELL environment variable, or "bash" on Posix, or "cmd.exe" on
1430
+ Windows
1431
+* Type: String
1432
+
1433
+The shell to run for the `npm explore` command.
1434
+
1435
+
1436
+
1437
+#### `sign-git-commit`
1438
+
1439
+* Default: false
1440
+* Type: Boolean
1441
+
1442
+If set to true, then the `npm version` command will commit the new package
1443
+version using `-S` to add a signature.
1444
+
1445
+Note that git requires you to have set up GPG keys in your git configs for
1446
+this to work properly.
1447
+
1448
+
1449
+
1450
+#### `sign-git-tag`
1451
+
1452
+* Default: false
1453
+* Type: Boolean
1454
+
1455
+If set to true, then the `npm version` command will tag the version using
1456
+`-s` to add a signature.
1457
+
1458
+Note that git requires you to have set up GPG keys in your git configs for
1459
+this to work properly.
1460
+
1461
+
1462
+
1463
+#### `strict-peer-deps`
1464
+
1465
+* Default: false
1466
+* Type: Boolean
1467
+
1468
+If set to `true`, and `--legacy-peer-deps` is not set, then _any_
1469
+conflicting `peerDependencies` will be treated as an install failure, even
1470
+if npm could reasonably guess the appropriate resolution based on non-peer
1471
+dependency relationships.
1472
+
1473
+By default, conflicting `peerDependencies` deep in the dependency graph will
1474
+be resolved using the nearest non-peer dependency specification, even if
1475
+doing so will result in some packages receiving a peer dependency outside
1476
+the range set in their package's `peerDependencies` object.
1477
+
1478
+When such an override is performed, a warning is printed, explaining the
1479
+conflict and the packages involved. If `--strict-peer-deps` is set, then
1480
+this warning is treated as a failure.
1481
+
1482
+
1483
+
1484
+#### `strict-ssl`
1485
+
1486
+* Default: true
1487
+* Type: Boolean
1488
+
1489
+Whether or not to do SSL key validation when making requests to the registry
1490
+via https.
1491
+
1492
+See also the `ca` config.
1493
+
1494
+
1495
+
1496
+#### `tag`
1497
+
1498
+* Default: "latest"
1499
+* Type: String
1500
+
1501
+If you ask npm to install a package and don't tell it a specific version,
1502
+then it will install the specified tag.
1503
+
1504
+Also the tag that is added to the package@version specified by the `npm tag`
1505
+command, if no explicit tag is given.
1506
+
1507
+When used by the `npm diff` command, this is the tag used to fetch the
1508
+tarball that will be compared with the local files by default.
1509
+
1510
+
1511
+
1512
+#### `tag-version-prefix`
1513
+
1514
+* Default: "v"
1515
+* Type: String
1516
+
1517
+If set, alters the prefix used when tagging a new version when performing a
1518
+version increment using `npm version`. To remove the prefix altogether, set
1519
+it to the empty string: `""`.
1520
+
1521
+Because other tools may rely on the convention that npm version tags look
1522
+like `v1.0.0`, _only use this property if it is absolutely necessary_. In
1523
+particular, use care when overriding this setting for public packages.
1524
+
1525
+
1526
+
1527
+#### `timing`
1528
+
1529
+* Default: false
1530
+* Type: Boolean
1531
+
1532
+If true, writes timing information to a process specific json file in the
1533
+cache or `logs-dir`. The file name ends with `-timing.json`.
1534
+
1535
+You can quickly view it with this [json](https://npm.im/json) command line:
1536
+`cat ~/.npm/_logs/*-timing.json | npm exec -- json -g`.
1537
+
1538
+Timing information will also be reported in the terminal. To suppress this
1539
+while still writing the timing file, use `--silent`.
1540
+
1541
+
1542
+
1543
+#### `umask`
1544
+
1545
+* Default: 0
1546
+* Type: Octal numeric string in range 0000..0777 (0..511)
1547
+
1548
+The "umask" value to use when setting the file creation mode on files and
1549
+folders.
1550
+
1551
+Folders and executables are given a mode which is `0o777` masked against
1552
+this value. Other files are given a mode which is `0o666` masked against
1553
+this value.
1554
+
1555
+Note that the underlying system will _also_ apply its own umask value to
1556
+files and folders that are created, and npm does not circumvent this, but
1557
+rather adds the `--umask` config to it.
1558
+
1559
+Thus, the effective default umask value on most POSIX systems is 0o22,
1560
+meaning that folders and executables are created with a mode of 0o755 and
1561
+other files are created with a mode of 0o644.
1562
+
1563
+
1564
+
1565
+#### `unicode`
1566
+
1567
+* Default: false on windows, true on mac/unix systems with a unicode locale,
1568
+ as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables.
1569
+* Type: Boolean
1570
+
1571
+When set to true, npm uses unicode characters in the tree output. When
1572
+false, it uses ascii characters instead of unicode glyphs.
1573
+
1574
+
1575
+
1576
+#### `update-notifier`
1577
+
1578
+* Default: true
1579
+* Type: Boolean
1580
+
1581
+Set to false to suppress the update notification when using an older version
1582
+of npm than the latest.
1583
+
1584
+
1585
+
1586
+#### `usage`
1587
+
1588
+* Default: false
1589
+* Type: Boolean
1590
+
1591
+Show short usage output about the command specified.
1592
+
1593
+
1594
+
1595
+#### `user-agent`
1596
+
1597
+* Default: "npm/{npm-version} node/{node-version} {platform} {arch}
1598
+ workspaces/{workspaces} {ci}"
1599
+* Type: String
1600
+
1601
+Sets the User-Agent request header. The following fields are replaced with
1602
+their actual counterparts:
1603
+
1604
+* `{npm-version}` - The npm version in use
1605
+* `{node-version}` - The Node.js version in use
1606
+* `{platform}` - The value of `process.platform`
1607
+* `{arch}` - The value of `process.arch`
1608
+* `{workspaces}` - Set to `true` if the `workspaces` or `workspace` options
1609
+ are set.
1610
+* `{ci}` - The value of the `ci-name` config, if set, prefixed with `ci/`, or
1611
+ an empty string if `ci-name` is empty.
1612
+
1613
+
1614
+
1615
+#### `userconfig`
1616
+
1617
+* Default: "~/.npmrc"
1618
+* Type: Path
1619
+
1620
+The location of user-level configuration settings.
1621
+
1622
+This may be overridden by the `npm_config_userconfig` environment variable
1623
+or the `--userconfig` command line option, but may _not_ be overridden by
1624
+settings in the `globalconfig` file.
1625
+
1626
+
1627
+
1628
+#### `version`
1629
+
1630
+* Default: false
1631
+* Type: Boolean
1632
+
1633
+If true, output the npm version and exit successfully.
1634
+
1635
+Only relevant when specified explicitly on the command line.
1636
+
1637
+
1638
+
1639
+#### `versions`
1640
+
1641
+* Default: false
1642
+* Type: Boolean
1643
+
1644
+If true, output the npm version as well as node's `process.versions` map and
1645
+the version in the current working directory's `package.json` file if one
1646
+exists, and exit successfully.
1647
+
1648
+Only relevant when specified explicitly on the command line.
1649
+
1650
+
1651
+
1652
+#### `viewer`
1653
+
1654
+* Default: "man" on Posix, "browser" on Windows
1655
+* Type: String
1656
+
1657
+The program to use to view help content.
1658
+
1659
+Set to `"browser"` to view html help content in the default web browser.
1660
+
1661
+
1662
+
1663
+#### `which`
1664
+
1665
+* Default: null
1666
+* Type: null or Number
1667
+
1668
+If there are multiple funding sources, which 1-indexed source URL to open.
1669
+
1670
+
1671
+
1672
+#### `workspace`
1673
+
1674
+* Default:
1675
+* Type: String (can be set multiple times)
1676
+
1677
+Enable running a command in the context of the configured workspaces of the
1678
+current project while filtering by running only the workspaces defined by
1679
+this configuration option.
1680
+
1681
+Valid values for the `workspace` config are either:
1682
+
1683
+* Workspace names
1684
+* Path to a workspace directory
1685
+* Path to a parent workspace directory (will result in selecting all
1686
+ workspaces within that folder)
1687
+
1688
+When set for the `npm init` command, this may be set to the folder of a
1689
+workspace which does not yet exist, to create the folder and set it up as a
1690
+brand new workspace within the project.
1691
+
1692
+This value is not exported to the environment for child processes.
1693
+
1694
+#### `workspaces`
1695
+
1696
+* Default: null
1697
+* Type: null or Boolean
1698
+
1699
+Set to true to run the command in the context of **all** configured
1700
+workspaces.
1701
+
1702
+Explicitly setting this to false will cause commands like `install` to
1703
+ignore workspaces altogether. When not set explicitly:
1704
+
1705
+- Commands that operate on the `node_modules` tree (install, update, etc.)
1706
+will link workspaces into the `node_modules` folder. - Commands that do
1707
+other things (test, exec, publish, etc.) will operate on the root project,
1708
+_unless_ one or more workspaces are specified in the `workspace` config.
1709
+
1710
+This value is not exported to the environment for child processes.
1711
+
1712
+#### `workspaces-update`
1713
+
1714
+* Default: true
1715
+* Type: Boolean
1716
+
1717
+If set to true, the npm cli will run an update after operations that may
1718
+possibly change the workspaces installed to the `node_modules` folder.
1719
+
1720
+
1721
+
1722
+#### `yes`
1723
+
1724
+* Default: null
1725
+* Type: null or Boolean
1726
+
1727
+Automatically answer "yes" to any prompts that npm might print on the
1728
+command line.
1729
+
1730
+
1731
+
1732
+#### `also`
1733
+
1734
+* Default: null
1735
+* Type: null, "dev", or "development"
1736
+* DEPRECATED: Please use --include=dev instead.
1737
+
1738
+When set to `dev` or `development`, this is an alias for `--include=dev`.
1739
+
1740
+
1741
+
1742
+#### `cache-max`
1743
+
1744
+* Default: Infinity
1745
+* Type: Number
1746
+* DEPRECATED: This option has been deprecated in favor of `--prefer-online`
1747
+
1748
+`--cache-max=0` is an alias for `--prefer-online`
1749
+
1750
+
1751
+
1752
+#### `cache-min`
1753
+
1754
+* Default: 0
1755
+* Type: Number
1756
+* DEPRECATED: This option has been deprecated in favor of `--prefer-offline`.
1757
+
1758
+`--cache-min=9999 (or bigger)` is an alias for `--prefer-offline`.
1759
+
1760
+
1761
+
1762
+#### `cert`
1763
+
1764
+* Default: null
1765
+* Type: null or String
1766
+* DEPRECATED: `key` and `cert` are no longer used for most registry
1767
+ operations. Use registry scoped `keyfile` and `certfile` instead. Example:
1768
+ //other-registry.tld/:keyfile=/path/to/key.pem
1769
+ //other-registry.tld/:certfile=/path/to/cert.crt
1770
+
1771
+A client certificate to pass when accessing the registry. Values should be
1772
+in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with
1773
+newlines replaced by the string "\n". For example:
1774
+
1775
+```ini
1776
+cert="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
1777
+```
1778
+
1779
+It is _not_ the path to a certificate file, though you can set a
1780
+registry-scoped "certfile" path like
1781
+"//other-registry.tld/:certfile=/path/to/cert.pem".
1782
+
1783
+
1784
+
1785
+#### `dev`
1786
+
1787
+* Default: false
1788
+* Type: Boolean
1789
+* DEPRECATED: Please use --include=dev instead.
1790
+
1791
+Alias for `--include=dev`.
1792
+
1793
+
1794
+
1795
+#### `global-style`
1796
+
1797
+* Default: false
1798
+* Type: Boolean
1799
+* DEPRECATED: This option has been deprecated in favor of
1800
+ `--install-strategy=shallow`
1801
+
1802
+Only install direct dependencies in the top level `node_modules`, but hoist
1803
+on deeper dependencies. Sets `--install-strategy=shallow`.
1804
+
1805
+
1806
+
1807
+#### `init.author.email`
1808
+
1809
+* Default: ""
1810
+* Type: String
1811
+* DEPRECATED: Use `--init-author-email` instead.
1812
+
1813
+Alias for `--init-author-email`
1814
+
1815
+
1816
+
1817
+#### `init.author.name`
1818
+
1819
+* Default: ""
1820
+* Type: String
1821
+* DEPRECATED: Use `--init-author-name` instead.
1822
+
1823
+Alias for `--init-author-name`
1824
+
1825
+
1826
+
1827
+#### `init.author.url`
1828
+
1829
+* Default: ""
1830
+* Type: "" or URL
1831
+* DEPRECATED: Use `--init-author-url` instead.
1832
+
1833
+Alias for `--init-author-url`
1834
+
1835
+
1836
+
1837
+#### `init.license`
1838
+
1839
+* Default: "ISC"
1840
+* Type: String
1841
+* DEPRECATED: Use `--init-license` instead.
1842
+
1843
+Alias for `--init-license`
1844
+
1845
+
1846
+
1847
+#### `init.module`
1848
+
1849
+* Default: "~/.npm-init.js"
1850
+* Type: Path
1851
+* DEPRECATED: Use `--init-module` instead.
1852
+
1853
+Alias for `--init-module`
1854
+
1855
+
1856
+
1857
+#### `init.version`
1858
+
1859
+* Default: "1.0.0"
1860
+* Type: SemVer string
1861
+* DEPRECATED: Use `--init-version` instead.
1862
+
1863
+Alias for `--init-version`
1864
+
1865
+
1866
+
1867
+#### `key`
1868
+
1869
+* Default: null
1870
+* Type: null or String
1871
+* DEPRECATED: `key` and `cert` are no longer used for most registry
1872
+ operations. Use registry scoped `keyfile` and `certfile` instead. Example:
1873
+ //other-registry.tld/:keyfile=/path/to/key.pem
1874
+ //other-registry.tld/:certfile=/path/to/cert.crt
1875
+
1876
+A client key to pass when accessing the registry. Values should be in PEM
1877
+format with newlines replaced by the string "\n". For example:
1878
+
1879
+```ini
1880
+key="-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----"
1881
+```
1882
+
1883
+It is _not_ the path to a key file, though you can set a registry-scoped
1884
+"keyfile" path like "//other-registry.tld/:keyfile=/path/to/key.pem".
1885
+
1886
+
1887
+
1888
+#### `legacy-bundling`
1889
+
1890
+* Default: false
1891
+* Type: Boolean
1892
+* DEPRECATED: This option has been deprecated in favor of
1893
+ `--install-strategy=nested`
1894
+
1895
+Instead of hoisting package installs in `node_modules`, install packages in
1896
+the same manner that they are depended on. This may cause very deep
1897
+directory structures and duplicate package installs as there is no
1898
+de-duplicating. Sets `--install-strategy=nested`.
1899
+
1900
+
1901
+
1902
+#### `only`
1903
+
1904
+* Default: null
1905
+* Type: null, "prod", or "production"
1906
+* DEPRECATED: Use `--omit=dev` to omit dev dependencies from the install.
1907
+
1908
+When set to `prod` or `production`, this is an alias for `--omit=dev`.
1909
+
1910
+
1911
+
1912
+#### `optional`
1913
+
1914
+* Default: null
1915
+* Type: null or Boolean
1916
+* DEPRECATED: Use `--omit=optional` to exclude optional dependencies, or
1917
+ `--include=optional` to include them.
1918
+
1919
+Default value does install optional deps unless otherwise omitted.
1920
+
1921
+Alias for --include=optional or --omit=optional
1922
+
1923
+
1924
+
1925
+#### `production`
1926
+
1927
+* Default: null
1928
+* Type: null or Boolean
1929
+* DEPRECATED: Use `--omit=dev` instead.
1930
+
1931
+Alias for `--omit=dev`
1932
+
1933
+
1934
+
1935
+#### `shrinkwrap`
1936
+
1937
+* Default: true
1938
+* Type: Boolean
1939
+* DEPRECATED: Use the --package-lock setting instead.
1940
+
1941
+Alias for --package-lock
1942
+
1943
+
1944
+
1945
+### See also
1946
+
1947
+* [npm config](/cli/v10/commands/npm-config)
1948
+* [npmrc](/cli/v10/configuring-npm/npmrc)
1949
+* [npm scripts](/cli/v10/using-npm/scripts)
1950
+* [npm folders](/cli/v10/configuring-npm/folders)
1951
+* [npm](/cli/v10/commands/npm)
content/cli/v10/using-npm/dependency-selectors.md
new
+214
@@ -0,0 +1,214 @@
1
+---
2
+title: Dependency Selector Syntax & Querying
3
+section: 7
4
+description: Dependency Selector Syntax & Querying
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/using-npm/dependency-selectors.md
8
+redirect_from:
9
+ - /cli-documentation/v10/misc/dependency-selectors
10
+ - /cli-documentation/v10/using-npm/dependency-selectors
11
+ - /cli/v10/misc/dependency-selectors
12
+---
13
+
14
+### Description
15
+
16
+The [`npm query`](/cli/v10/commands/npm-query) command exposes a new dependency selector syntax (informed by & respecting many aspects of the [CSS Selectors 4 Spec](https://dev.w3.org/csswg/selectors4/#relational)) which:
17
+
18
+- Standardizes the shape of, & querying of, dependency graphs with a robust object model, metadata & selector syntax
19
+- Leverages existing, known language syntax & operators from CSS to make disparate package information broadly accessible
20
+- Unlocks the ability to answer complex, multi-faceted questions about dependencies, their relationships & associative metadata
21
+- Consolidates redundant logic of similar query commands in `npm` (ex. `npm fund`, `npm ls`, `npm outdated`, `npm audit` ...)
22
+
23
+### Dependency Selector Syntax `v1.0.0`
24
+
25
+#### Overview:
26
+
27
+- there is no "type" or "tag" selectors (ex. `div, h1, a`) as a dependency/target is the only type of `Node` that can be queried
28
+- the term "dependencies" is in reference to any `Node` found in a `tree` returned by `Arborist`
29
+
30
+#### Combinators
31
+
32
+- `>` direct descendant/child
33
+- ` ` any descendant/child
34
+- `~` sibling
35
+
36
+#### Selectors
37
+
38
+- `*` universal selector
39
+- `#<name>` dependency selector (equivalent to `[name="..."]`)
40
+- `#<name>@<version>` (equivalent to `[name=<name>]:semver(<version>)`)
41
+- `,` selector list delimiter
42
+- `.` dependency type selector
43
+- `:` pseudo selector
44
+
45
+#### Dependency Type Selectors
46
+
47
+- `.prod` dependency found in the `dependencies` section of `package.json`, or is a child of said dependency
48
+- `.dev` dependency found in the `devDependencies` section of `package.json`, or is a child of said dependency
49
+- `.optional` dependency found in the `optionalDependencies` section of `package.json`, or has `"optional": true` set in its entry in the `peerDependenciesMeta` section of `package.json`, or a child of said dependency
50
+- `.peer` dependency found in the `peerDependencies` section of `package.json`
51
+- `.workspace` dependency found in the [`workspaces`](https://docs.npmjs.com/cli/v8/using-npm/workspaces) section of `package.json`
52
+- `.bundled` dependency found in the `bundleDependencies` section of `package.json`, or is a child of said dependency
53
+
54
+#### Pseudo Selectors
55
+- [`:not(<selector>)`](https://developer.mozilla.org/en-US/docs/Web/CSS/:not)
56
+- [`:has(<selector>)`](https://developer.mozilla.org/en-US/docs/Web/CSS/:has)
57
+- [`:is(<selector list>)`](https://developer.mozilla.org/en-US/docs/Web/CSS/:is)
58
+- [`:root`](https://developer.mozilla.org/en-US/docs/Web/CSS/:root) matches the root node/dependency
59
+- [`:scope`](https://developer.mozilla.org/en-US/docs/Web/CSS/:scope) matches node/dependency it was queried against
60
+- [`:empty`](https://developer.mozilla.org/en-US/docs/Web/CSS/:empty) when a dependency has no dependencies
61
+- [`:private`](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#private) when a dependency is private
62
+- `:link` when a dependency is linked (for instance, workspaces or packages manually [`linked`](https://docs.npmjs.com/cli/v8/commands/npm-link)
63
+- `:deduped` when a dependency has been deduped (note that this does *not* always mean the dependency has been hoisted to the root of node_modules)
64
+- `:overridden` when a dependency has been overridden
65
+- `:extraneous` when a dependency exists but is not defined as a dependency of any node
66
+- `:invalid` when a dependency version is out of its ancestors specified range
67
+- `:missing` when a dependency is not found on disk
68
+- `:semver(<spec>, [selector], [function])` match a valid [`node-semver`](https://github.com/npm/node-semver) version or range to a selector
69
+- `:path(<path>)` [glob](https://www.npmjs.com/package/glob) matching based on dependencies path relative to the project
70
+- `:type(<type>)` [based on currently recognized types](https://github.com/npm/npm-package-arg#result-object)
71
+- `:outdated(<type>)` when a dependency is outdated
72
+
73
+##### `:semver(<spec>, [selector], [function])`
74
+
75
+The `:semver()` pseudo selector allows comparing fields from each node's `package.json` using [semver](https://github.com/npm/node-semver#readme) methods. It accepts up to 3 parameters, all but the first of which are optional.
76
+
77
+- `spec` a semver version or range
78
+- `selector` an attribute selector for each node (default `[version]`)
79
+- `function` a semver method to apply, one of: `satisfies`, `intersects`, `subset`, `gt`, `gte`, `gtr`, `lt`, `lte`, `ltr`, `eq`, `neq` or the special function `infer` (default `infer`)
80
+
81
+When the special `infer` function is used the `spec` and the actual value from the node are compared. If both are versions, according to `semver.valid()`, `eq` is used. If both values are ranges, according to `!semver.valid()`, `intersects` is used. If the values are mixed types `satisfies` is used.
82
+
83
+Some examples:
84
+
85
+- `:semver(^1.0.0)` returns every node that has a `version` satisfied by the provided range `^1.0.0`
86
+- `:semver(16.0.0, :attr(engines, [node]))` returns every node which has an `engines.node` property satisfying the version `16.0.0`
87
+- `:semver(1.0.0, [version], lt)` every node with a `version` less than `1.0.0`
88
+
89
+##### `:outdated(<type>)`
90
+
91
+The `:outdated` pseudo selector retrieves data from the registry and returns information about which of your dependencies are outdated. The type parameter may be one of the following:
92
+
93
+- `any` (default) a version exists that is greater than the current one
94
+- `in-range` a version exists that is greater than the current one, and satisfies at least one if its dependents
95
+- `out-of-range` a version exists that is greater than the current one, does not satisfy at least one of its dependents
96
+- `major` a version exists that is a semver major greater than the current one
97
+- `minor` a version exists that is a semver minor greater than the current one
98
+- `patch` a version exists that is a semver patch greater than the current one
99
+
100
+In addition to the filtering performed by the pseudo selector, some extra data is added to the resulting objects. The following data can be found under the `queryContext` property of each node.
101
+
102
+- `versions` an array of every available version of the given node
103
+- `outdated.inRange` an array of objects, each with a `from` and `versions`, where `from` is the on-disk location of the node that depends on the current node and `versions` is an array of all available versions that satisfies that dependency. This is only populated if `:outdated(in-range)` is used.
104
+- `outdated.outOfRange` an array of objects, identical in shape to `inRange`, but where the `versions` array is every available version that does not satisfy the dependency. This is only populated if `:outdated(out-of-range)` is used.
105
+
106
+Some examples:
107
+
108
+- `:root > :outdated(major)` returns every direct dependency that has a new semver major release
109
+- `.prod:outdated(in-range)` returns production dependencies that have a new release that satisfies at least one of its edges in
110
+
111
+#### [Attribute Selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors)
112
+
113
+The attribute selector evaluates the key/value pairs in `package.json` if they are `String`s.
114
+
115
+- `[]` attribute selector (ie. existence of attribute)
116
+- `[attribute=value]` attribute value is equivalant...
117
+- `[attribute~=value]` attribute value contains word...
118
+- `[attribute*=value]` attribute value contains string...
119
+- `[attribute|=value]` attribute value is equal to or starts with...
120
+- `[attribute^=value]` attribute value starts with...
121
+- `[attribute$=value]` attribute value ends with...
122
+
123
+#### `Array` & `Object` Attribute Selectors
124
+
125
+The generic `:attr()` pseudo selector standardizes a pattern which can be used for attribute selection of `Object`s, `Array`s or `Arrays` of `Object`s accessible via `Arborist`'s `Node.package` metadata. This allows for iterative attribute selection beyond top-level `String` evaluation. The last argument passed to `:attr()` must be an `attribute` selector or a nested `:attr()`. See examples below:
126
+
127
+#### `Objects`
128
+
129
+```css
130
+/* return dependencies that have a `scripts.test` containing `"tap"` */
131
+*:attr(scripts, [test~=tap])
132
+```
133
+
134
+#### Nested `Objects`
135
+
136
+Nested objects are expressed as sequential arguments to `:attr()`.
137
+
138
+```css
139
+/* return dependencies that have a testling config for opera browsers */
140
+*:attr(testling, browsers, [~=opera])
141
+```
142
+
143
+#### `Arrays`
144
+
145
+`Array`s specifically uses a special/reserved `.` character in place of a typical attribute name. `Arrays` also support exact `value` matching when a `String` is passed to the selector.
146
+
147
+##### Example of an `Array` Attribute Selection:
148
+```css
149
+/* removes the distinction between properties & arrays */
150
+/* ie. we'd have to check the property & iterate to match selection */
151
+*:attr([keywords^=react])
152
+*:attr(contributors, :attr([name~=Jordan]))
153
+```
154
+
155
+##### Example of an `Array` matching directly to a value:
156
+```css
157
+/* return dependencies that have the exact keyword "react" */
158
+/* this is equivalent to `*:keywords([value="react"])` */
159
+*:attr([keywords=react])
160
+```
161
+
162
+##### Example of an `Array` of `Object`s:
163
+```css
164
+/* returns */
165
+*:attr(contributors, [email=ruyadorno@github.com])
166
+```
167
+
168
+### Groups
169
+
170
+Dependency groups are defined by the package relationships to their ancestors (ie. the dependency types that are defined in `package.json`). This approach is user-centric as the ecosystem has been taught to think about dependencies in these groups first-and-foremost. Dependencies are allowed to be included in multiple groups (ex. a `prod` dependency may also be a `dev` dependency (in that it's also required by another `dev` dependency) & may also be `bundled` - a selector for that type of dependency would look like: `*.prod.dev.bundled`).
171
+
172
+- `.prod`
173
+- `.dev`
174
+- `.optional`
175
+- `.peer`
176
+- `.bundled`
177
+- `.workspace`
178
+
179
+Please note that currently `workspace` deps are always `prod` dependencies. Additionally the `.root` dependency is also considered a `prod` dependency.
180
+
181
+### Programmatic Usage
182
+
183
+- `Arborist`'s `Node` Class has a `.querySelectorAll()` method
184
+ - this method will return a filtered, flattened dependency Arborist `Node` list based on a valid query selector
185
+
186
+```js
187
+const Arborist = require('@npmcli/arborist')
188
+const arb = new Arborist({})
189
+```
190
+
191
+```js
192
+// root-level
193
+arb.loadActual().then(async (tree) => {
194
+ // query all production dependencies
195
+ const results = await tree.querySelectorAll('.prod')
196
+ console.log(results)
197
+})
198
+```
199
+
200
+```js
201
+// iterative
202
+arb.loadActual().then(async (tree) => {
203
+ // query for the deduped version of react
204
+ const results = await tree.querySelectorAll('#react:not(:deduped)')
205
+ // query the deduped react for git deps
206
+ const deps = await results[0].querySelectorAll(':type(git)')
207
+ console.log(deps)
208
+})
209
+```
210
+
211
+## See Also
212
+
213
+* [npm query](/cli/v10/commands/npm-query)
214
+* [@npmcli/arborist](https://npm.im/@npmcli/arborist)
content/cli/v10/using-npm/developers.md
new
+252
@@ -0,0 +1,252 @@
1
+---
2
+title: developers
3
+section: 7
4
+description: Developer Guide
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/using-npm/developers.md
8
+redirect_from:
9
+ - /cli-documentation/v10/misc/developers
10
+ - /cli-documentation/v10/using-npm/developers
11
+ - /cli/v10/misc/developers
12
+---
13
+
14
+### Description
15
+
16
+So, you've decided to use npm to develop (and maybe publish/deploy)
17
+your project.
18
+
19
+Fantastic!
20
+
21
+There are a few things that you need to do above the simple steps
22
+that your users will do to install your program.
23
+
24
+### About These Documents
25
+
26
+These are man pages. If you install npm, you should be able to
27
+then do `man npm-thing` to get the documentation on a particular
28
+topic, or `npm help thing` to see the same information.
29
+
30
+### What is a Package
31
+
32
+A package is:
33
+
34
+* a) a folder containing a program described by a package.json file
35
+* b) a gzipped tarball containing (a)
36
+* c) a url that resolves to (b)
37
+* d) a `<name>@<version>` that is published on the registry with (c)
38
+* e) a `<name>@<tag>` that points to (d)
39
+* f) a `<name>` that has a "latest" tag satisfying (e)
40
+* g) a `git` url that, when cloned, results in (a).
41
+
42
+Even if you never publish your package, you can still get a lot of
43
+benefits of using npm if you just want to write a node program (a), and
44
+perhaps if you also want to be able to easily install it elsewhere
45
+after packing it up into a tarball (b).
46
+
47
+Git urls can be of the form:
48
+
49
+```bash
50
+git://github.com/user/project.git#commit-ish
51
+git+ssh://user@hostname:project.git#commit-ish
52
+git+http://user@hostname/project/blah.git#commit-ish
53
+git+https://user@hostname/project/blah.git#commit-ish
54
+```
55
+
56
+The `commit-ish` can be any tag, sha, or branch which can be supplied as
57
+an argument to `git checkout`. The default is whatever the repository uses
58
+as its default branch.
59
+
60
+### The package.json File
61
+
62
+You need to have a `package.json` file in the root of your project to do
63
+much of anything with npm. That is basically the whole interface.
64
+
65
+See [`package.json`](/cli/v10/configuring-npm/package-json) for details about what
66
+goes in that file. At the very least, you need:
67
+
68
+* name: This should be a string that identifies your project. Please do
69
+ not use the name to specify that it runs on node, or is in JavaScript.
70
+ You can use the "engines" field to explicitly state the versions of node
71
+ (or whatever else) that your program requires, and it's pretty well
72
+ assumed that it's JavaScript.
73
+
74
+ It does not necessarily need to match your github repository name.
75
+
76
+ So, `node-foo` and `bar-js` are bad names. `foo` or `bar` are better.
77
+
78
+* version: A semver-compatible version.
79
+
80
+* engines: Specify the versions of node (or whatever else) that your
81
+ program runs on. The node API changes a lot, and there may be bugs or
82
+ new functionality that you depend on. Be explicit.
83
+
84
+* author: Take some credit.
85
+
86
+* scripts: If you have a special compilation or installation script, then
87
+ you should put it in the `scripts` object. You should definitely have at
88
+ least a basic smoke-test command as the "scripts.test" field. See
89
+ [scripts](/cli/v10/using-npm/scripts).
90
+
91
+* main: If you have a single module that serves as the entry point to your
92
+ program (like what the "foo" package gives you at require("foo")), then
93
+ you need to specify that in the "main" field.
94
+
95
+* directories: This is an object mapping names to folders. The best ones
96
+ to include are "lib" and "doc", but if you use "man" to specify a folder
97
+ full of man pages, they'll get installed just like these ones.
98
+
99
+You can use `npm init` in the root of your package in order to get you
100
+started with a pretty basic package.json file. See [`npm
101
+init`](/cli/v10/commands/npm-init) for more info.
102
+
103
+### Keeping files *out* of your Package
104
+
105
+Use a `.npmignore` file to keep stuff out of your package. If there's no
106
+`.npmignore` file, but there *is* a `.gitignore` file, then npm will ignore
107
+the stuff matched by the `.gitignore` file. If you *want* to include
108
+something that is excluded by your `.gitignore` file, you can create an
109
+empty `.npmignore` file to override it. Like `git`, `npm` looks for
110
+`.npmignore` and `.gitignore` files in all subdirectories of your package,
111
+not only the root directory.
112
+
113
+`.npmignore` files follow the [same pattern
114
+rules](https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_ignoring)
115
+as `.gitignore` files:
116
+
117
+* Blank lines or lines starting with `#` are ignored.
118
+* Standard glob patterns work.
119
+* You can end patterns with a forward slash `/` to specify a directory.
120
+* You can negate a pattern by starting it with an exclamation point `!`.
121
+
122
+By default, the following paths and files are ignored, so there's no
123
+need to add them to `.npmignore` explicitly:
124
+
125
+* `.*.swp`
126
+* `._*`
127
+* `.DS_Store`
128
+* `.git`
129
+* `.gitignore`
130
+* `.hg`
131
+* `.npmignore`
132
+* `.npmrc`
133
+* `.lock-wscript`
134
+* `.svn`
135
+* `.wafpickle-*`
136
+* `config.gypi`
137
+* `CVS`
138
+* `npm-debug.log`
139
+
140
+Additionally, everything in `node_modules` is ignored, except for
141
+bundled dependencies. npm automatically handles this for you, so don't
142
+bother adding `node_modules` to `.npmignore`.
143
+
144
+The following paths and files are never ignored, so adding them to
145
+`.npmignore` is pointless:
146
+
147
+* `package.json`
148
+* `README` (and its variants)
149
+* `CHANGELOG` (and its variants)
150
+* `LICENSE` / `LICENCE`
151
+
152
+If, given the structure of your project, you find `.npmignore` to be a
153
+maintenance headache, you might instead try populating the `files`
154
+property of `package.json`, which is an array of file or directory names
155
+that should be included in your package. Sometimes manually picking
156
+which items to allow is easier to manage than building a block list.
157
+
158
+#### Testing whether your `.npmignore` or `files` config works
159
+
160
+If you want to double check that your package will include only the files
161
+you intend it to when published, you can run the `npm pack` command locally
162
+which will generate a tarball in the working directory, the same way it
163
+does for publishing.
164
+
165
+### Link Packages
166
+
167
+`npm link` is designed to install a development package and see the
168
+changes in real time without having to keep re-installing it. (You do
169
+need to either re-link or `npm rebuild -g` to update compiled packages,
170
+of course.)
171
+
172
+More info at [`npm link`](/cli/v10/commands/npm-link).
173
+
174
+### Before Publishing: Make Sure Your Package Installs and Works
175
+
176
+**This is important.**
177
+
178
+If you can not install it locally, you'll have
179
+problems trying to publish it. Or, worse yet, you'll be able to
180
+publish it, but you'll be publishing a broken or pointless package.
181
+So don't do that.
182
+
183
+In the root of your package, do this:
184
+
185
+```bash
186
+npm install . -g
187
+```
188
+
189
+That'll show you that it's working. If you'd rather just create a symlink
190
+package that points to your working directory, then do this:
191
+
192
+```bash
193
+npm link
194
+```
195
+
196
+Use `npm ls -g` to see if it's there.
197
+
198
+To test a local install, go into some other folder, and then do:
199
+
200
+```bash
201
+cd ../some-other-folder
202
+npm install ../my-package
203
+```
204
+
205
+to install it locally into the node_modules folder in that other place.
206
+
207
+Then go into the node-repl, and try using require("my-thing") to
208
+bring in your module's main module.
209
+
210
+### Create a User Account
211
+
212
+Create a user with the adduser command. It works like this:
213
+
214
+```bash
215
+npm adduser
216
+```
217
+
218
+and then follow the prompts.
219
+
220
+This is documented better in [npm adduser](/cli/v10/commands/npm-adduser).
221
+
222
+### Publish your Package
223
+
224
+This part's easy. In the root of your folder, do this:
225
+
226
+```bash
227
+npm publish
228
+```
229
+
230
+You can give publish a url to a tarball, or a filename of a tarball,
231
+or a path to a folder.
232
+
233
+Note that pretty much **everything in that folder will be exposed**
234
+by default. So, if you have secret stuff in there, use a
235
+`.npmignore` file to list out the globs to ignore, or publish
236
+from a fresh checkout.
237
+
238
+### Brag about it
239
+
240
+Send emails, write blogs, blab in IRC.
241
+
242
+Tell the world how easy it is to install your program!
243
+
244
+### See also
245
+
246
+* [npm](/cli/v10/commands/npm)
247
+* [npm init](/cli/v10/commands/npm-init)
248
+* [package.json](/cli/v10/configuring-npm/package-json)
249
+* [npm scripts](/cli/v10/using-npm/scripts)
250
+* [npm publish](/cli/v10/commands/npm-publish)
251
+* [npm adduser](/cli/v10/commands/npm-adduser)
252
+* [npm registry](/cli/v10/using-npm/registry)
content/cli/v10/using-npm/index.mdx
new
+17
@@ -0,0 +1,17 @@
1
+---
2
+title: Using npm
3
+shortName: Using
4
+github_repo: npm/cli
5
+github_branch: latest
6
+github_path: docs/lib/content/nav.yml
7
+redirect_from:
8
+ - /cli-documentation/v10/misc
9
+ - /cli-documentation/v10/misc/index
10
+ - /cli-documentation/v10/using-npm
11
+ - /cli-documentation/v10/using-npm/index
12
+ - /cli/v10/misc
13
+ - /cli/v10/misc/index
14
+ - /cli/v10/using-npm/index
15
+---
16
+
17
+<Index depth="1" />
content/cli/v10/using-npm/logging.md
new
+103
@@ -0,0 +1,103 @@
1
+---
2
+title: Logging
3
+section: 7
4
+description: Why, What & How We Log
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/using-npm/logging.md
8
+redirect_from:
9
+ - /cli-documentation/v10/misc/logging
10
+ - /cli-documentation/v10/using-npm/logging
11
+ - /cli/v10/misc/logging
12
+---
13
+
14
+### Description
15
+
16
+The `npm` CLI has various mechanisms for showing different levels of information back to end-users for certain commands, configurations & environments.
17
+
18
+### Setting Log File Location
19
+
20
+All logs are written to a debug log, with the path to that file printed if the execution of a command fails.
21
+
22
+The default location of the logs directory is a directory named `_logs` inside the npm cache. This can be changed with the `logs-dir` config option.
23
+
24
+For example, if you wanted to write all your logs to the current working directory, you could run: `npm install --logs-dir=.`. This is especially helpful in debugging a specific `npm` issue as you can run
25
+a command multiple times with different config values and then diff all the log files.
26
+
27
+Log files will be removed from the `logs-dir` when the number of log files exceeds `logs-max`, with the oldest logs being deleted first.
28
+
29
+To turn off logs completely set `--logs-max=0`.
30
+
31
+### Setting Log Levels
32
+
33
+#### `loglevel`
34
+
35
+`loglevel` is a global argument/config that can be set to determine the type of information to be displayed.
36
+
37
+The default value of `loglevel` is `"notice"` but there are several levels/types of logs available, including:
38
+
39
+- `"silent"`
40
+- `"error"`
41
+- `"warn"`
42
+- `"notice"`
43
+- `"http"`
44
+- `"info"`
45
+- `"verbose"`
46
+- `"silly"`
47
+
48
+All logs pertaining to a level proceeding the current setting will be shown.
49
+
50
+##### Aliases
51
+
52
+The log levels listed above have various corresponding aliases, including:
53
+
54
+- `-d`: `--loglevel info`
55
+- `--dd`: `--loglevel verbose`
56
+- `--verbose`: `--loglevel verbose`
57
+- `--ddd`: `--loglevel silly`
58
+- `-q`: `--loglevel warn`
59
+- `--quiet`: `--loglevel warn`
60
+- `-s`: `--loglevel silent`
61
+- `--silent`: `--loglevel silent`
62
+
63
+#### `foreground-scripts`
64
+
65
+The `npm` CLI began hiding the output of lifecycle scripts for `npm install` as of `v7`. Notably, this means you will not see logs/output from packages that may be using "install scripts" to display information back to you or from your own project's scripts defined in `package.json`. If you'd like to change this behavior & log this output you can set `foreground-scripts` to `true`.
66
+
67
+### Timing Information
68
+
69
+The [`--timing` config](/cli/v10/using-npm/config#timing) can be set which does a few
70
+things:
71
+
72
+1. Always shows the full path to the debug log regardless of command exit status
73
+1. Write timing information to a process specific timing file in the cache or `logs-dir`
74
+1. Output timing information to the terminal
75
+
76
+This file contains a `timers` object where the keys are an identifier for the
77
+portion of the process being timed and the value is the number of milliseconds it took to complete.
78
+
79
+Sometimes it is helpful to get timing information without outputting anything to the terminal. For
80
+example, the performance might be affected by writing to the terminal. In this case you can use
81
+`--timing --silent` which will still write the timing file, but not output anything to the terminal
82
+while running.
83
+
84
+### Registry Response Headers
85
+
86
+#### `npm-notice`
87
+
88
+The `npm` CLI reads from & logs any `npm-notice` headers that are returned from the configured registry. This mechanism can be used by third-party registries to provide useful information when network-dependent requests occur.
89
+
90
+This header is not cached, and will not be logged if the request is served from the cache.
91
+
92
+### Logs and Sensitive Information
93
+
94
+The `npm` CLI makes a best effort to redact the following from terminal output and log files:
95
+
96
+- Passwords inside basic auth URLs
97
+- npm tokens
98
+
99
+However, this behavior should not be relied on to keep all possible sensitive information redacted. If you are concerned about secrets in your log file or terminal output, you can use `--loglevel=silent` and `--logs-max=0` to ensure no logs are written to your terminal or filesystem.
100
+
101
+### See also
102
+
103
+* [config](/cli/v10/using-npm/config)
content/cli/v10/using-npm/orgs.md
new
+100
@@ -0,0 +1,100 @@
1
+---
2
+title: orgs
3
+section: 7
4
+description: Working with Teams & Orgs
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/using-npm/orgs.md
8
+redirect_from:
9
+ - /cli-documentation/v10/misc/orgs
10
+ - /cli-documentation/v10/using-npm/orgs
11
+ - /cli/v10/misc/orgs
12
+---
13
+
14
+### Description
15
+
16
+There are three levels of org users:
17
+
18
+1. Super admin, controls billing & adding people to the org.
19
+2. Team admin, manages team membership & package access.
20
+3. Developer, works on packages they are given access to.
21
+
22
+The super admin is the only person who can add users to the org because it impacts the monthly bill. The super admin will use the website to manage membership. Every org has a `developers` team that all users are automatically added to.
23
+
24
+The team admin is the person who manages team creation, team membership, and package access for teams. The team admin grants package access to teams, not individuals.
25
+
26
+The developer will be able to access packages based on the teams they are on. Access is either read-write or read-only.
27
+
28
+There are two main commands:
29
+
30
+1. `npm team` see [npm team](/cli/v10/commands/npm-team) for more details
31
+2. `npm access` see [npm access](/cli/v10/commands/npm-access) for more details
32
+
33
+### Team Admins create teams
34
+
35
+* Check who you’ve added to your org:
36
+
37
+```bash
38
+npm team ls <org>:developers
39
+```
40
+
41
+* Each org is automatically given a `developers` team, so you can see the whole list of team members in your org. This team automatically gets read-write access to all packages, but you can change that with the `access` command.
42
+
43
+* Create a new team:
44
+
45
+```bash
46
+npm team create <org:team>
47
+```
48
+
49
+* Add members to that team:
50
+
51
+```bash
52
+npm team add <org:team> <user>
53
+```
54
+
55
+### Publish a package and adjust package access
56
+
57
+* In package directory, run
58
+
59
+```bash
60
+npm init --scope=<org>
61
+```
62
+to scope it for your org & publish as usual
63
+
64
+* Grant access:
65
+
66
+```bash
67
+npm access grant <read-only|read-write> <org:team> [<package>]
68
+```
69
+
70
+* Revoke access:
71
+
72
+```bash
73
+npm access revoke <org:team> [<package>]
74
+```
75
+
76
+### Monitor your package access
77
+
78
+* See what org packages a team member can access:
79
+
80
+```bash
81
+npm access ls-packages <org> <user>
82
+```
83
+
84
+* See packages available to a specific team:
85
+
86
+```bash
87
+npm access ls-packages <org:team>
88
+```
89
+
90
+* Check which teams are collaborating on a package:
91
+
92
+```bash
93
+npm access ls-collaborators <pkg>
94
+```
95
+
96
+### See also
97
+
98
+* [npm team](/cli/v10/commands/npm-team)
99
+* [npm access](/cli/v10/commands/npm-access)
100
+* [npm scope](/cli/v10/using-npm/scope)
content/cli/v10/using-npm/package-spec.md
new
+112
@@ -0,0 +1,112 @@
1
+---
2
+title: package-spec
3
+section: 7
4
+description: Package name specifier
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/using-npm/package-spec.md
8
+redirect_from:
9
+ - /cli-documentation/v10/misc/package-spec
10
+ - /cli-documentation/v10/using-npm/package-spec
11
+ - /cli/v10/misc/package-spec
12
+---
13
+
14
+### Description
15
+
16
+Commands like `npm install` and the dependency sections in the
17
+`package.json` use a package name specifier. This can be many different
18
+things that all refer to a "package". Examples include a package name,
19
+git url, tarball, or local directory. These will generally be referred
20
+to as `<package-spec>` in the help output for the npm commands that use
21
+this package name specifier.
22
+
23
+### Package name
24
+
25
+* `[<@scope>/]<pkg>`
26
+* `[<@scope>/]<pkg>@<tag>`
27
+* `[<@scope>/]<pkg>@<version>`
28
+* `[<@scope>/]<pkg>@<version range>`
29
+
30
+Refers to a package by name, with or without a scope, and optionally
31
+tag, version, or version range. This is typically used in combination
32
+with the [registry](/cli/v10/using-npm/config#registry) config to refer to a
33
+package in a registry.
34
+
35
+Examples:
36
+* `npm`
37
+* `@npmcli/arborist`
38
+* `@npmcli/arborist@latest`
39
+* `npm@6.13.1`
40
+* `npm@^4.0.0`
41
+
42
+### Aliases
43
+
44
+* `<alias>@npm:<name>`
45
+
46
+Primarily used by commands like `npm install` and in the dependency
47
+sections in the `package.json`, this refers to a package by an alias.
48
+The `<alias>` is the name of the package as it is reified in the
49
+`node_modules` folder, and the `<name>` refers to a package name as
50
+found in the configured registry.
51
+
52
+See `Package name` above for more info on referring to a package by
53
+name, and [registry](/cli/v10/using-npm/config#registry) for configuring which
54
+registry is used when referring to a package by name.
55
+
56
+Examples:
57
+* `semver:@npm:@npmcli/semver-with-patch`
58
+* `semver:@npm:semver@7.2.2`
59
+* `semver:@npm:semver@legacy`
60
+
61
+### Folders
62
+
63
+* `<folder>`
64
+
65
+This refers to a package on the local filesystem. Specifically this is
66
+a folder with a `package.json` file in it. This *should* always be
67
+prefixed with a `/` or `./` (or your OS equivalent) to reduce confusion.
68
+npm currently will parse a string with more than one `/` in it as a
69
+folder, but this is legacy behavior that may be removed in a future
70
+version.
71
+
72
+Examples:
73
+
74
+* `./my-package`
75
+* `/opt/npm/my-package`
76
+
77
+### Tarballs
78
+
79
+* `<tarball file>`
80
+* `<tarball url>`
81
+
82
+Examples:
83
+
84
+* `./my-package.tgz`
85
+* `https://registry.npmjs.org/semver/-/semver-1.0.0.tgz`
86
+
87
+Refers to a package in a tarball format, either on the local filesystem
88
+or remotely via url. This is the format that packages exist in when
89
+uploaded to a registry.
90
+
91
+### git urls
92
+
93
+* `<git:// url>`
94
+* `<github username>/<github project>`
95
+
96
+Refers to a package in a git repo. This can be a full git url, git
97
+shorthand, or a username/package on GitHub. You can specify a
98
+git tag, branch, or other git ref by appending `#ref`.
99
+
100
+Examples:
101
+
102
+* `https://github.com/npm/cli.git`
103
+* `git@github.com:npm/cli.git`
104
+* `git+ssh://git@github.com/npm/cli#v6.0.0`
105
+* `github:npm/cli#HEAD`
106
+* `npm/cli#c12ea07`
107
+
108
+### See also
109
+
110
+* [npm-package-arg](https://npm.im/npm-package-arg)
111
+* [scope](/cli/v10/using-npm/scope)
112
+* [config](/cli/v10/using-npm/config)
content/cli/v10/using-npm/registry.md
new
+93
@@ -0,0 +1,93 @@
1
+---
2
+title: registry
3
+section: 7
4
+description: The JavaScript Package Registry
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/using-npm/registry.md
8
+redirect_from:
9
+ - /cli-documentation/v10/misc/registry
10
+ - /cli-documentation/v10/using-npm/registry
11
+ - /cli/v10/misc/registry
12
+---
13
+
14
+### Description
15
+
16
+To resolve packages by name and version, npm talks to a registry website
17
+that implements the CommonJS Package Registry specification for reading
18
+package info.
19
+
20
+npm is configured to use the **npm public registry** at
21
+<https://registry.npmjs.org> by default. Use of the npm public registry is
22
+subject to terms of use available at <https://docs.npmjs.com/policies/terms>.
23
+
24
+You can configure npm to use any compatible registry you like, and even run
25
+your own registry. Use of someone else's registry may be governed by their
26
+terms of use.
27
+
28
+npm's package registry implementation supports several
29
+write APIs as well, to allow for publishing packages and managing user
30
+account information.
31
+
32
+The npm public registry is powered by a CouchDB database,
33
+of which there is a public mirror at <https://skimdb.npmjs.com/registry>.
34
+
35
+The registry URL used is determined by the scope of the package (see
36
+[`scope`](/cli/v10/using-npm/scope). If no scope is specified, the default registry is
37
+used, which is supplied by the [`registry` config](/cli/v10/using-npm/config#registry)
38
+parameter. See [`npm config`](/cli/v10/commands/npm-config),
39
+[`npmrc`](/cli/v10/configuring-npm/npmrc), and [`config`](/cli/v10/using-npm/config) for more on
40
+managing npm's configuration.
41
+Authentication configuration such as auth tokens and certificates are configured
42
+specifically scoped to an individual registry. See
43
+[Auth Related Configuration](/cli/v10/configuring-npm/npmrc#auth-related-configuration)
44
+
45
+When the default registry is used in a package-lock or shrinkwrap it has the
46
+special meaning of "the currently configured registry". If you create a lock
47
+file while using the default registry you can switch to another registry and
48
+npm will install packages from the new registry, but if you create a lock
49
+file while using a custom registry packages will be installed from that
50
+registry even after you change to another registry.
51
+
52
+### Does npm send any information about me back to the registry?
53
+
54
+Yes.
55
+
56
+When making requests of the registry npm adds two headers with information
57
+about your environment:
58
+
59
+* `Npm-Scope` – If your project is scoped, this header will contain its
60
+ scope. In the future npm hopes to build registry features that use this
61
+ information to allow you to customize your experience for your
62
+ organization.
63
+* `Npm-In-CI` – Set to "true" if npm believes this install is running in a
64
+ continuous integration environment, "false" otherwise. This is detected by
65
+ looking for the following environment variables: `CI`, `TDDIUM`,
66
+ `JENKINS_URL`, `bamboo.buildKey`. If you'd like to learn more you may find
67
+ the [original PR](https://github.com/npm/npm-registry-client/pull/129)
68
+ interesting.
69
+ This is used to gather better metrics on how npm is used by humans, versus
70
+ build farms.
71
+
72
+The npm registry does not try to correlate the information in these headers
73
+with any authenticated accounts that may be used in the same requests.
74
+
75
+### How can I prevent my package from being published in the official registry?
76
+
77
+Set `"private": true` in your `package.json` to prevent it from being
78
+published at all, or
79
+`"publishConfig":{"registry":"http://my-internal-registry.local"}`
80
+to force it to be published only to your internal/private registry.
81
+
82
+See [`package.json`](/cli/v10/configuring-npm/package-json) for more info on what goes in the package.json file.
83
+
84
+### Where can I find my (and others') published packages?
85
+
86
+<https://www.npmjs.com/>
87
+
88
+### See also
89
+
90
+* [npm config](/cli/v10/commands/npm-config)
91
+* [config](/cli/v10/using-npm/config)
92
+* [npmrc](/cli/v10/configuring-npm/npmrc)
93
+* [npm developers](/cli/v10/using-npm/developers)
content/cli/v10/using-npm/removal.md
new
+75
@@ -0,0 +1,75 @@
1
+---
2
+title: removal
3
+section: 7
4
+description: Cleaning the Slate
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/using-npm/removal.md
8
+redirect_from:
9
+ - /cli-documentation/v10/misc/removal
10
+ - /cli-documentation/v10/misc/removing-npm
11
+ - /cli-documentation/v10/using-npm/removal
12
+ - /cli-documentation/v10/using-npm/removing-npm
13
+ - /cli/v10/misc/removal
14
+ - /cli/v10/misc/removing-npm
15
+ - /cli/v10/using-npm/removing-npm
16
+---
17
+
18
+### Synopsis
19
+
20
+So sad to see you go.
21
+
22
+```bash
23
+sudo npm uninstall npm -g
24
+```
25
+
26
+Or, if that fails, get the npm source code, and do:
27
+
28
+```bash
29
+sudo make uninstall
30
+```
31
+
32
+### More Severe Uninstalling
33
+
34
+Usually, the above instructions are sufficient. That will remove
35
+npm, but leave behind anything you've installed.
36
+
37
+If that doesn't work, or if you require more drastic measures,
38
+continue reading.
39
+
40
+Note that this is only necessary for globally-installed packages. Local
41
+installs are completely contained within a project's `node_modules`
42
+folder. Delete that folder, and everything is gone unless a package's
43
+install script is particularly ill-behaved.
44
+
45
+This assumes that you installed node and npm in the default place. If
46
+you configured node with a different `--prefix`, or installed npm with a
47
+different prefix setting, then adjust the paths accordingly, replacing
48
+`/usr/local` with your install prefix.
49
+
50
+To remove everything npm-related manually:
51
+
52
+```bash
53
+rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm*
54
+```
55
+
56
+If you installed things *with* npm, then your best bet is to uninstall
57
+them with npm first, and then install them again once you have a
58
+proper install. This can help find any symlinks that are lying
59
+around:
60
+
61
+```bash
62
+ls -laF /usr/local/{lib/node{,/.npm},bin,share/man} | grep npm
63
+```
64
+
65
+Prior to version 0.3, npm used shim files for executables and node
66
+modules. To track those down, you can do the following:
67
+
68
+```bash
69
+find /usr/local/{lib/node,bin} -exec grep -l npm \{\} \; ;
70
+```
71
+
72
+### See also
73
+
74
+* [npm uninstall](/cli/v10/commands/npm-uninstall)
75
+* [npm prune](/cli/v10/commands/npm-prune)
content/cli/v10/using-npm/scope.md
new
+154
@@ -0,0 +1,154 @@
1
+---
2
+title: scope
3
+section: 7
4
+description: Scoped packages
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/using-npm/scope.md
8
+redirect_from:
9
+ - /cli-documentation/v10/misc/npm-scope
10
+ - /cli-documentation/v10/misc/scope
11
+ - /cli-documentation/v10/using-npm/npm-scope
12
+ - /cli-documentation/v10/using-npm/scope
13
+ - /cli/v10/misc/npm-scope
14
+ - /cli/v10/misc/scope
15
+ - /cli/v10/using-npm/npm-scope
16
+---
17
+
18
+### Description
19
+
20
+All npm packages have a name. Some package names also have a scope. A scope
21
+follows the usual rules for package names (URL-safe characters, no leading dots
22
+or underscores). When used in package names, scopes are preceded by an `@` symbol
23
+and followed by a slash, e.g.
24
+
25
+```bash
26
+@somescope/somepackagename
27
+```
28
+
29
+Scopes are a way of grouping related packages together, and also affect a few
30
+things about the way npm treats the package.
31
+
32
+Each npm user/organization has their own scope, and only you can add packages
33
+in your scope. This means you don't have to worry about someone taking your
34
+package name ahead of you. Thus it is also a good way to signal official packages
35
+for organizations.
36
+
37
+Scoped packages can be published and installed as of `npm@2` and are supported
38
+by the primary npm registry. Unscoped packages can depend on scoped packages and
39
+vice versa. The npm client is backwards-compatible with unscoped registries,
40
+so it can be used to work with scoped and unscoped registries at the same time.
41
+
42
+### Installing scoped packages
43
+
44
+Scoped packages are installed to a sub-folder of the regular installation
45
+folder, e.g. if your other packages are installed in `node_modules/packagename`,
46
+scoped modules will be installed in `node_modules/@myorg/packagename`. The scope
47
+folder (`@myorg`) is simply the name of the scope preceded by an `@` symbol, and can
48
+contain any number of scoped packages.
49
+
50
+A scoped package is installed by referencing it by name, preceded by an
51
+`@` symbol, in `npm install`:
52
+
53
+```bash
54
+npm install @myorg/mypackage
55
+```
56
+
57
+Or in `package.json`:
58
+
59
+```json
60
+"dependencies": {
61
+ "@myorg/mypackage": "^1.3.0"
62
+}
63
+```
64
+
65
+Note that if the `@` symbol is omitted, in either case, npm will instead attempt to
66
+install from GitHub; see [`npm install`](/cli/v10/commands/npm-install).
67
+
68
+### Requiring scoped packages
69
+
70
+Because scoped packages are installed into a scope folder, you have to
71
+include the name of the scope when requiring them in your code, e.g.
72
+
73
+```javascript
74
+require('@myorg/mypackage')
75
+```
76
+
77
+There is nothing special about the way Node treats scope folders. This
78
+simply requires the `mypackage` module in the folder named `@myorg`.
79
+
80
+### Publishing scoped packages
81
+
82
+Scoped packages can be published from the CLI as of `npm@2` and can be
83
+published to any registry that supports them, including the primary npm
84
+registry.
85
+
86
+(As of 2015-04-19, and with npm 2.0 or better, the primary npm registry
87
+**does** support scoped packages.)
88
+
89
+If you wish, you may associate a scope with a registry; see below.
90
+
91
+#### Publishing public scoped packages to the primary npm registry
92
+
93
+Publishing to a scope, you have two options:
94
+
95
+- Publishing to your user scope (example: `@username/module`)
96
+- Publishing to an organization scope (example: `@org/module`)
97
+
98
+If publishing a public module to an organization scope, you must
99
+first either create an organization with the name of the scope
100
+that you'd like to publish to or be added to an existing organization
101
+with the appropriate permissions. For example, if you'd like to
102
+publish to `@org`, you would need to create the `org` organization
103
+on npmjs.com prior to trying to publish.
104
+
105
+Scoped packages are not public by default. You will need to specify
106
+`--access public` with the initial `npm publish` command. This will publish
107
+the package and set access to `public` as if you had run `npm access public`
108
+after publishing. You do not need to do this when publishing new versions of
109
+an existing scoped package.
110
+
111
+#### Publishing private scoped packages to the npm registry
112
+
113
+To publish a private scoped package to the npm registry, you must have
114
+an [npm Private Modules](https://docs.npmjs.com/private-modules/intro)
115
+account.
116
+
117
+You can then publish the module with `npm publish` or `npm publish
118
+--access restricted`, and it will be present in the npm registry, with
119
+restricted access. You can then change the access permissions, if
120
+desired, with `npm access` or on the npmjs.com website.
121
+
122
+### Associating a scope with a registry
123
+
124
+Scopes can be associated with a separate registry. This allows you to
125
+seamlessly use a mix of packages from the primary npm registry and one or more
126
+private registries, such as [GitHub Packages](https://github.com/features/packages) or the open source [Verdaccio](https://verdaccio.org)
127
+project.
128
+
129
+You can associate a scope with a registry at login, e.g.
130
+
131
+```bash
132
+npm login --registry=http://reg.example.com --scope=@myco
133
+```
134
+
135
+Scopes have a many-to-one relationship with registries: one registry can
136
+host multiple scopes, but a scope only ever points to one registry.
137
+
138
+You can also associate a scope with a registry using `npm config`:
139
+
140
+```bash
141
+npm config set @myco:registry http://reg.example.com
142
+```
143
+
144
+Once a scope is associated with a registry, any `npm install` for a package
145
+with that scope will request packages from that registry instead. Any
146
+`npm publish` for a package name that contains the scope will be published to
147
+that registry instead.
148
+
149
+### See also
150
+
151
+* [npm install](/cli/v10/commands/npm-install)
152
+* [npm publish](/cli/v10/commands/npm-publish)
153
+* [npm access](/cli/v10/commands/npm-access)
154
+* [npm registry](/cli/v10/using-npm/registry)
content/cli/v10/using-npm/scripts.md
new
+377
@@ -0,0 +1,377 @@
1
+---
2
+title: scripts
3
+section: 7
4
+description: How npm handles the "scripts" field
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/using-npm/scripts.md
8
+redirect_from:
9
+ - /cli-documentation/v10/misc/scripts
10
+ - /cli-documentation/v10/using-npm/scripts
11
+ - /cli/v10/misc/scripts
12
+---
13
+
14
+### Description
15
+
16
+The `"scripts"` property of your `package.json` file supports a number
17
+of built-in scripts and their preset life cycle events as well as
18
+arbitrary scripts. These all can be executed by running
19
+`npm run-script <stage>` or `npm run <stage>` for short. *Pre* and *post*
20
+commands with matching names will be run for those as well (e.g. `premyscript`,
21
+`myscript`, `postmyscript`). Scripts from dependencies can be run with
22
+`npm explore <pkg> -- npm run <stage>`.
23
+
24
+### Pre & Post Scripts
25
+
26
+To create "pre" or "post" scripts for any scripts defined in the
27
+`"scripts"` section of the `package.json`, simply create another script
28
+*with a matching name* and add "pre" or "post" to the beginning of them.
29
+
30
+```json
31
+{
32
+ "scripts": {
33
+ "precompress": "{{ executes BEFORE the `compress` script }}",
34
+ "compress": "{{ run command to compress files }}",
35
+ "postcompress": "{{ executes AFTER `compress` script }}"
36
+ }
37
+}
38
+```
39
+
40
+In this example `npm run compress` would execute these scripts as
41
+described.
42
+
43
+### Life Cycle Scripts
44
+
45
+There are some special life cycle scripts that happen only in certain
46
+situations. These scripts happen in addition to the `pre<event>`, `post<event>`, and
47
+`<event>` scripts.
48
+
49
+* `prepare`, `prepublish`, `prepublishOnly`, `prepack`, `postpack`, `dependencies`
50
+
51
+**prepare** (since `npm@4.0.0`)
52
+* Runs BEFORE the package is packed, i.e. during `npm publish`
53
+ and `npm pack`
54
+* Runs on local `npm install` without any arguments
55
+* Runs AFTER `prepublish`, but BEFORE `prepublishOnly`
56
+
57
+* NOTE: If a package being installed through git contains a `prepare`
58
+ script, its `dependencies` and `devDependencies` will be installed, and
59
+ the prepare script will be run, before the package is packaged and
60
+ installed.
61
+
62
+* As of `npm@7` these scripts run in the background.
63
+ To see the output, run with: `--foreground-scripts`.
64
+
65
+**prepublish** (DEPRECATED)
66
+* Does not run during `npm publish`, but does run during `npm ci`
67
+ and `npm install`. See below for more info.
68
+
69
+**prepublishOnly**
70
+* Runs BEFORE the package is prepared and packed, ONLY on `npm publish`.
71
+
72
+**prepack**
73
+* Runs BEFORE a tarball is packed (on "`npm pack`", "`npm publish`", and when installing a git dependency).
74
+* NOTE: "`npm run pack`" is NOT the same as "`npm pack`". "`npm run pack`" is an arbitrary user defined script name, where as, "`npm pack`" is a CLI defined command.
75
+
76
+**postpack**
77
+* Runs AFTER the tarball has been generated but before it is moved to its final destination (if at all, publish does not save the tarball locally)
78
+
79
+**dependencies**
80
+* Runs AFTER any operations that modify the `node_modules` directory IF changes occurred.
81
+* Does NOT run in global mode
82
+
83
+#### Prepare and Prepublish
84
+
85
+**Deprecation Note: prepublish**
86
+
87
+Since `npm@1.1.71`, the npm CLI has run the `prepublish` script for both `npm publish` and `npm install`, because it's a convenient way to prepare a package for use (some common use cases are described in the section below). It has also turned out to be, in practice, [very confusing](https://github.com/npm/npm/issues/10074). As of `npm@4.0.0`, a new event has been introduced, `prepare`, that preserves this existing behavior. A _new_ event, `prepublishOnly` has been added as a transitional strategy to allow users to avoid the confusing behavior of existing npm versions and only run on `npm publish` (for instance, running the tests one last time to ensure they're in good shape).
88
+
89
+See <https://github.com/npm/npm/issues/10074> for a much lengthier justification, with further reading, for this change.
90
+
91
+**Use Cases**
92
+
93
+If you need to perform operations on your package before it is used, in a way that is not dependent on the operating system or architecture of the target system, use a `prepublish` script. This includes tasks such as:
94
+
95
+* Compiling CoffeeScript source code into JavaScript.
96
+* Creating minified versions of JavaScript source code.
97
+* Fetching remote resources that your package will use.
98
+
99
+The advantage of doing these things at `prepublish` time is that they can be done once, in a single place, thus reducing complexity and variability. Additionally, this means that:
100
+
101
+* You can depend on `coffee-script` as a `devDependency`, and thus
102
+ your users don't need to have it installed.
103
+* You don't need to include minifiers in your package, reducing
104
+ the size for your users.
105
+* You don't need to rely on your users having `curl` or `wget` or
106
+ other system tools on the target machines.
107
+
108
+#### Dependencies
109
+
110
+The `dependencies` script is run any time an `npm` command causes changes to the `node_modules` directory. It is run AFTER the changes have been applied and the `package.json` and `package-lock.json` files have been updated.
111
+
112
+### Life Cycle Operation Order
113
+
114
+#### [`npm cache add`](/cli/v10/commands/npm-cache)
115
+
116
+* `prepare`
117
+
118
+#### [`npm ci`](/cli/v10/commands/npm-ci)
119
+
120
+* `preinstall`
121
+* `install`
122
+* `postinstall`
123
+* `prepublish`
124
+* `preprepare`
125
+* `prepare`
126
+* `postprepare`
127
+
128
+ These all run after the actual installation of modules into
129
+ `node_modules`, in order, with no internal actions happening in between
130
+
131
+#### [`npm diff`](/cli/v10/commands/npm-diff)
132
+
133
+* `prepare`
134
+
135
+#### [`npm install`](/cli/v10/commands/npm-install)
136
+
137
+These also run when you run `npm install -g <pkg-name>`
138
+
139
+* `preinstall`
140
+* `install`
141
+* `postinstall`
142
+* `prepublish`
143
+* `preprepare`
144
+* `prepare`
145
+* `postprepare`
146
+
147
+If there is a `binding.gyp` file in the root of your package and you
148
+haven't defined your own `install` or `preinstall` scripts, npm will
149
+default the `install` command to compile using node-gyp via `node-gyp
150
+rebuild`
151
+
152
+These are run from the scripts of `<pkg-name>`
153
+
154
+#### [`npm pack`](/cli/v10/commands/npm-pack)
155
+
156
+* `prepack`
157
+* `prepare`
158
+* `postpack`
159
+
160
+#### [`npm publish`](/cli/v10/commands/npm-publish)
161
+
162
+* `prepublishOnly`
163
+* `prepack`
164
+* `prepare`
165
+* `postpack`
166
+* `publish`
167
+* `postpublish`
168
+
169
+`prepare` will not run during `--dry-run`
170
+
171
+#### [`npm rebuild`](/cli/v10/commands/npm-rebuild)
172
+
173
+* `preinstall`
174
+* `install`
175
+* `postinstall`
176
+* `prepare`
177
+
178
+`prepare` is only run if the current directory is a symlink (e.g. with
179
+linked packages)
180
+
181
+#### [`npm restart`](/cli/v10/commands/npm-restart)
182
+
183
+If there is a `restart` script defined, these events are run, otherwise
184
+`stop` and `start` are both run if present, including their `pre` and
185
+`post` iterations)
186
+
187
+* `prerestart`
188
+* `restart`
189
+* `postrestart`
190
+
191
+#### [`npm run <user defined>`](/cli/v10/commands/npm-run-script)
192
+
193
+* `pre<user-defined>`
194
+* `<user-defined>`
195
+* `post<user-defined>`
196
+
197
+#### [`npm start`](/cli/v10/commands/npm-start)
198
+
199
+* `prestart`
200
+* `start`
201
+* `poststart`
202
+
203
+If there is a `server.js` file in the root of your package, then npm
204
+will default the `start` command to `node server.js`. `prestart` and
205
+`poststart` will still run in this case.
206
+
207
+#### [`npm stop`](/cli/v10/commands/npm-stop)
208
+
209
+* `prestop`
210
+* `stop`
211
+* `poststop`
212
+
213
+#### [`npm test`](/cli/v10/commands/npm-test)
214
+
215
+* `pretest`
216
+* `test`
217
+* `posttest`
218
+
219
+#### [`npm version`](/cli/v10/commands/npm-version)
220
+
221
+* `preversion`
222
+* `version`
223
+* `postversion`
224
+
225
+#### A Note on a lack of [`npm uninstall`](/cli/v10/commands/npm-uninstall) scripts
226
+
227
+While npm v6 had `uninstall` lifecycle scripts, npm v7 does not. Removal of a package can happen for a wide variety of reasons, and there's no clear way to currently give the script enough context to be useful.
228
+
229
+Reasons for a package removal include:
230
+
231
+* a user directly uninstalled this package
232
+* a user uninstalled a dependant package and so this dependency is being uninstalled
233
+* a user uninstalled a dependant package but another package also depends on this version
234
+* this version has been merged as a duplicate with another version
235
+* etc.
236
+
237
+Due to the lack of necessary context, `uninstall` lifecycle scripts are not implemented and will not function.
238
+
239
+### User
240
+
241
+When npm is run as root, scripts are always run with the effective uid
242
+and gid of the working directory owner.
243
+
244
+### Environment
245
+
246
+Package scripts run in an environment where many pieces of information
247
+are made available regarding the setup of npm and the current state of
248
+the process.
249
+
250
+#### path
251
+
252
+If you depend on modules that define executable scripts, like test
253
+suites, then those executables will be added to the `PATH` for
254
+executing the scripts. So, if your package.json has this:
255
+
256
+```json
257
+{
258
+ "name" : "foo",
259
+ "dependencies" : {
260
+ "bar" : "0.1.x"
261
+ },
262
+ "scripts": {
263
+ "start" : "bar ./test"
264
+ }
265
+}
266
+```
267
+
268
+then you could run `npm start` to execute the `bar` script, which is
269
+exported into the `node_modules/.bin` directory on `npm install`.
270
+
271
+#### package.json vars
272
+
273
+The package.json fields are tacked onto the `npm_package_` prefix. So,
274
+for instance, if you had `{"name":"foo", "version":"1.2.5"}` in your
275
+package.json file, then your package scripts would have the
276
+`npm_package_name` environment variable set to "foo", and the
277
+`npm_package_version` set to "1.2.5". You can access these variables
278
+in your code with `process.env.npm_package_name` and
279
+`process.env.npm_package_version`, and so on for other fields.
280
+
281
+See [`package.json`](/cli/v10/configuring-npm/package-json) for more on package configs.
282
+
283
+#### current lifecycle event
284
+
285
+Lastly, the `npm_lifecycle_event` environment variable is set to
286
+whichever stage of the cycle is being executed. So, you could have a
287
+single script used for different parts of the process which switches
288
+based on what's currently happening.
289
+
290
+Objects are flattened following this format, so if you had
291
+`{"scripts":{"install":"foo.js"}}` in your package.json, then you'd
292
+see this in the script:
293
+
294
+```bash
295
+process.env.npm_package_scripts_install === "foo.js"
296
+```
297
+
298
+### Examples
299
+
300
+For example, if your package.json contains this:
301
+
302
+```json
303
+{
304
+ "scripts" : {
305
+ "install" : "scripts/install.js",
306
+ "postinstall" : "scripts/install.js",
307
+ "uninstall" : "scripts/uninstall.js"
308
+ }
309
+}
310
+```
311
+
312
+then `scripts/install.js` will be called for the install
313
+and post-install stages of the lifecycle, and `scripts/uninstall.js`
314
+will be called when the package is uninstalled. Since
315
+`scripts/install.js` is running for two different phases, it would
316
+be wise in this case to look at the `npm_lifecycle_event` environment
317
+variable.
318
+
319
+If you want to run a make command, you can do so. This works just
320
+fine:
321
+
322
+```json
323
+{
324
+ "scripts" : {
325
+ "preinstall" : "./configure",
326
+ "install" : "make && make install",
327
+ "test" : "make test"
328
+ }
329
+}
330
+```
331
+
332
+### Exiting
333
+
334
+Scripts are run by passing the line as a script argument to `sh`.
335
+
336
+If the script exits with a code other than 0, then this will abort the
337
+process.
338
+
339
+Note that these script files don't have to be Node.js or even
340
+JavaScript programs. They just have to be some kind of executable
341
+file.
342
+
343
+### Best Practices
344
+
345
+* Don't exit with a non-zero error code unless you *really* mean it.
346
+ Except for uninstall scripts, this will cause the npm action to
347
+ fail, and potentially be rolled back. If the failure is minor or
348
+ only will prevent some optional features, then it's better to just
349
+ print a warning and exit successfully.
350
+* Try not to use scripts to do what npm can do for you. Read through
351
+ [`package.json`](/cli/v10/configuring-npm/package-json) to see all the things that you can specify and enable
352
+ by simply describing your package appropriately. In general, this
353
+ will lead to a more robust and consistent state.
354
+* Inspect the env to determine where to put things. For instance, if
355
+ the `npm_config_binroot` environment variable is set to `/home/user/bin`, then
356
+ don't try to install executables into `/usr/local/bin`. The user
357
+ probably set it up that way for a reason.
358
+* Don't prefix your script commands with "sudo". If root permissions
359
+ are required for some reason, then it'll fail with that error, and
360
+ the user will sudo the npm command in question.
361
+* Don't use `install`. Use a `.gyp` file for compilation, and `prepare`
362
+ for anything else. You should almost never have to explicitly set a
363
+ preinstall or install script. If you are doing this, please consider if
364
+ there is another option. The only valid use of `install` or `preinstall`
365
+ scripts is for compilation which must be done on the target architecture.
366
+* Scripts are run from the root of the package folder, regardless of what the
367
+ current working directory is when `npm` is invoked. If you want your
368
+ script to use different behavior based on what subdirectory you're in, you
369
+ can use the `INIT_CWD` environment variable, which holds the full path you
370
+ were in when you ran `npm run`.
371
+
372
+### See Also
373
+
374
+* [npm run-script](/cli/v10/commands/npm-run-script)
375
+* [package.json](/cli/v10/configuring-npm/package-json)
376
+* [npm developers](/cli/v10/using-npm/developers)
377
+* [npm install](/cli/v10/commands/npm-install)
content/cli/v10/using-npm/workspaces.md
new
+233
@@ -0,0 +1,233 @@
1
+---
2
+title: workspaces
3
+section: 7
4
+description: Working with workspaces
5
+github_repo: npm/cli
6
+github_branch: latest
7
+github_path: docs/lib/content/using-npm/workspaces.md
8
+redirect_from:
9
+ - /cli-documentation/v10/misc/workspaces
10
+ - /cli-documentation/v10/using-npm/workspaces
11
+ - /cli/v10/misc/workspaces
12
+---
13
+
14
+### Description
15
+
16
+**Workspaces** is a generic term that refers to the set of features in the
17
+npm cli that provides support to managing multiple packages from your local
18
+file system from within a singular top-level, root package.
19
+
20
+This set of features makes up for a much more streamlined workflow handling
21
+linked packages from the local file system. Automating the linking process
22
+as part of `npm install` and avoiding manually having to use `npm link` in
23
+order to add references to packages that should be symlinked into the current
24
+`node_modules` folder.
25
+
26
+We also refer to these packages being auto-symlinked during `npm install` as a
27
+single **workspace**, meaning it's a nested package within the current local
28
+file system that is explicitly defined in the [`package.json`](/cli/v10/configuring-npm/package-json#workspaces)
29
+`workspaces` configuration.
30
+
31
+### Defining workspaces
32
+
33
+Workspaces are usually defined via the `workspaces` property of the
34
+[`package.json`](/cli/v10/configuring-npm/package-json#workspaces) file, e.g:
35
+
36
+```json
37
+{
38
+ "name": "my-workspaces-powered-project",
39
+ "workspaces": [
40
+ "packages/a"
41
+ ]
42
+}
43
+```
44
+
45
+Given the above `package.json` example living at a current working
46
+directory `.` that contains a folder named `packages/a` that itself contains
47
+a `package.json` inside it, defining a Node.js package, e.g:
48
+
49
+```
50
+.
51
++-- package.json
52
+`-- packages
53
+ +-- a
54
+ | `-- package.json
55
+```
56
+
57
+The expected result once running `npm install` in this current working
58
+directory `.` is that the folder `packages/a` will get symlinked to the
59
+`node_modules` folder of the current working dir.
60
+
61
+Below is a post `npm install` example, given that same previous example
62
+structure of files and folders:
63
+
64
+```
65
+.
66
++-- node_modules
67
+| `-- a -> ../packages/a
68
++-- package-lock.json
69
++-- package.json
70
+`-- packages
71
+ +-- a
72
+ | `-- package.json
73
+```
74
+
75
+### Getting started with workspaces
76
+
77
+You may automate the required steps to define a new workspace using
78
+[npm init](/cli/v10/commands/npm-init). For example in a project that already has a
79
+`package.json` defined you can run:
80
+
81
+```
82
+npm init -w ./packages/a
83
+```
84
+
85
+This command will create the missing folders and a new `package.json`
86
+file (if needed) while also making sure to properly configure the
87
+`"workspaces"` property of your root project `package.json`.
88
+
89
+### Adding dependencies to a workspace
90
+
91
+It's possible to directly add/remove/update dependencies of your workspaces
92
+using the [`workspace` config](/cli/v10/using-npm/config#workspace).
93
+
94
+For example, assuming the following structure:
95
+
96
+```
97
+.
98
++-- package.json
99
+`-- packages
100
+ +-- a
101
+ | `-- package.json
102
+ `-- b
103
+ `-- package.json
104
+```
105
+
106
+If you want to add a dependency named `abbrev` from the registry as a
107
+dependency of your workspace **a**, you may use the workspace config to tell
108
+the npm installer that package should be added as a dependency of the provided
109
+workspace:
110
+
111
+```
112
+npm install abbrev -w a
113
+```
114
+
115
+Note: other installing commands such as `uninstall`, `ci`, etc will also
116
+respect the provided `workspace` configuration.
117
+
118
+### Using workspaces
119
+
120
+Given the [specifities of how Node.js handles module resolution](https://nodejs.org/dist/latest-v14.x/docs/api/modules.html#modules_all_together) it's possible to consume any defined workspace
121
+by its declared `package.json` `name`. Continuing from the example defined
122
+above, let's also create a Node.js script that will require the workspace `a`
123
+example module, e.g:
124
+
125
+```
126
+// ./packages/a/index.js
127
+module.exports = 'a'
128
+
129
+// ./lib/index.js
130
+const moduleA = require('a')
131
+console.log(moduleA) // -> a
132
+```
133
+
134
+When running it with:
135
+
136
+`node lib/index.js`
137
+
138
+This demonstrates how the nature of `node_modules` resolution allows for
139
+**workspaces** to enable a portable workflow for requiring each **workspace**
140
+in such a way that is also easy to [publish](/cli/v10/commands/npm-publish) these
141
+nested workspaces to be consumed elsewhere.
142
+
143
+### Running commands in the context of workspaces
144
+
145
+You can use the `workspace` configuration option to run commands in the context
146
+of a configured workspace.
147
+Additionally, if your current directory is in a workspace, the `workspace`
148
+configuration is implicitly set, and `prefix` is set to the root workspace.
149
+
150
+Following is a quick example on how to use the `npm run` command in the context
151
+of nested workspaces. For a project containing multiple workspaces, e.g:
152
+
153
+```
154
+.
155
++-- package.json
156
+`-- packages
157
+ +-- a
158
+ | `-- package.json
159
+ `-- b
160
+ `-- package.json
161
+```
162
+
163
+By running a command using the `workspace` option, it's possible to run the
164
+given command in the context of that specific workspace. e.g:
165
+
166
+```
167
+npm run test --workspace=a
168
+```
169
+
170
+You could also run the command within the workspace.
171
+
172
+```
173
+cd packages/a && npm run test
174
+```
175
+
176
+Either will run the `test` script defined within the
177
+`./packages/a/package.json` file.
178
+
179
+Please note that you can also specify this argument multiple times in the
180
+command-line in order to target multiple workspaces, e.g:
181
+
182
+```
183
+npm run test --workspace=a --workspace=b
184
+```
185
+
186
+Or run the command for each workspace within the 'packages' folder:
187
+```
188
+npm run test --workspace=packages
189
+```
190
+
191
+It's also possible to use the `workspaces` (plural) configuration option to
192
+enable the same behavior but running that command in the context of **all**
193
+configured workspaces. e.g:
194
+
195
+```
196
+npm run test --workspaces
197
+```
198
+
199
+Will run the `test` script in both `./packages/a` and `./packages/b`.
200
+
201
+Commands will be run in each workspace in the order they appear in your `package.json`
202
+
203
+```
204
+{
205
+ "workspaces": [ "packages/a", "packages/b" ]
206
+}
207
+```
208
+
209
+Order of run is different with:
210
+
211
+```
212
+{
213
+ "workspaces": [ "packages/b", "packages/a" ]
214
+}
215
+```
216
+
217
+### Ignoring missing scripts
218
+
219
+It is not required for all of the workspaces to implement scripts run with the `npm run` command.
220
+
221
+By running the command with the `--if-present` flag, npm will ignore workspaces missing target script.
222
+
223
+```
224
+npm run test --workspaces --if-present
225
+```
226
+
227
+### See also
228
+
229
+* [npm install](/cli/v10/commands/npm-install)
230
+* [npm publish](/cli/v10/commands/npm-publish)
231
+* [npm run-script](/cli/v10/commands/npm-run-script)
232
+* [config](/cli/v10/using-npm/config)
233
+
src/theme/nav.yml
+266
@@ -1321,3 +1321,269 @@
1321
- title: Changelog
1322
url: /cli/v9/using-npm/changelog
1323
description: Changelog notes for each version
1324
+ - title: Version 10.0.0 (Current Release)
1325
+ shortName: v10
1326
+ url: /cli/v10
1327
+ default: false
1328
+ children:
1329
+ - title: CLI Commands
1330
+ shortName: Commands
1331
+ url: /cli/v10/commands
1332
+ children:
1333
+ - title: npm
1334
+ url: /cli/v10/commands/npm
1335
+ description: JavaScript package manager
1336
+ - title: npm access
1337
+ url: /cli/v10/commands/npm-access
1338
+ description: Set access level on published packages
1339
+ - title: npm adduser
1340
+ url: /cli/v10/commands/npm-adduser
1341
+ description: Add a registry user account
1342
+ - title: npm audit
1343
+ url: /cli/v10/commands/npm-audit
1344
+ description: Run a security audit
1345
+ - title: npm bugs
1346
+ url: /cli/v10/commands/npm-bugs
1347
+ description: Bugs for a package in a web browser maybe
1348
+ - title: npm cache
1349
+ url: /cli/v10/commands/npm-cache
1350
+ description: Manipulates packages cache
1351
+ - title: npm ci
1352
+ url: /cli/v10/commands/npm-ci
1353
+ description: Install a project with a clean slate
1354
+ - title: npm completion
1355
+ url: /cli/v10/commands/npm-completion
1356
+ description: Tab completion for npm
1357
+ - title: npm config
1358
+ url: /cli/v10/commands/npm-config
1359
+ description: Manage the npm configuration files
1360
+ - title: npm dedupe
1361
+ url: /cli/v10/commands/npm-dedupe
1362
+ description: Reduce duplication
1363
+ - title: npm deprecate
1364
+ url: /cli/v10/commands/npm-deprecate
1365
+ description: Deprecate a version of a package
1366
+ - title: npm diff
1367
+ url: /cli/v10/commands/npm-diff
1368
+ description: The registry diff command
1369
+ - title: npm dist-tag
1370
+ url: /cli/v10/commands/npm-dist-tag
1371
+ description: Modify package distribution tags
1372
+ - title: npm docs
1373
+ url: /cli/v10/commands/npm-docs
1374
+ description: Docs for a package in a web browser maybe
1375
+ - title: npm doctor
1376
+ url: /cli/v10/commands/npm-doctor
1377
+ description: Check your environments
1378
+ - title: npm edit
1379
+ url: /cli/v10/commands/npm-edit
1380
+ description: Edit an installed package
1381
+ - title: npm exec
1382
+ url: /cli/v10/commands/npm-exec
1383
+ description: Run a command from an npm package
1384
+ - title: npm explain
1385
+ url: /cli/v10/commands/npm-explain
1386
+ description: Explain installed packages
1387
+ - title: npm explore
1388
+ url: /cli/v10/commands/npm-explore
1389
+ description: Browse an installed package
1390
+ - title: npm find-dupes
1391
+ url: /cli/v10/commands/npm-find-dupes
1392
+ description: Find duplication in the package tree
1393
+ - title: npm fund
1394
+ url: /cli/v10/commands/npm-fund
1395
+ description: Retrieve funding information
1396
+ - title: npm help
1397
+ url: /cli/v10/commands/npm-help
1398
+ description: Search npm help documentation
1399
+ - title: npm help-search
1400
+ url: /cli/v10/commands/npm-help-search
1401
+ description: Get help on npm
1402
+ - title: npm hook
1403
+ url: /cli/v10/commands/npm-hook
1404
+ description: Manage registry hooks
1405
+ - title: npm init
1406
+ url: /cli/v10/commands/npm-init
1407
+ description: Create a package.json file
1408
+ - title: npm install
1409
+ url: /cli/v10/commands/npm-install
1410
+ description: Install a package
1411
+ - title: npm install-ci-test
1412
+ url: /cli/v10/commands/npm-install-ci-test
1413
+ description: Install a project with a clean slate and run tests
1414
+ - title: npm install-test
1415
+ url: /cli/v10/commands/npm-install-test
1416
+ description: Install package(s) and run tests
1417
+ - title: npm link
1418
+ url: /cli/v10/commands/npm-link
1419
+ description: Symlink a package folder
1420
+ - title: npm login
1421
+ url: /cli/v10/commands/npm-login
1422
+ description: Login to a registry user account
1423
+ - title: npm logout
1424
+ url: /cli/v10/commands/npm-logout
1425
+ description: Log out of the registry
1426
+ - title: npm ls
1427
+ url: /cli/v10/commands/npm-ls
1428
+ description: List installed packages
1429
+ - title: npm org
1430
+ url: /cli/v10/commands/npm-org
1431
+ description: Manage orgs
1432
+ - title: npm outdated
1433
+ url: /cli/v10/commands/npm-outdated
1434
+ description: Check for outdated packages
1435
+ - title: npm owner
1436
+ url: /cli/v10/commands/npm-owner
1437
+ description: Manage package owners
1438
+ - title: npm pack
1439
+ url: /cli/v10/commands/npm-pack
1440
+ description: Create a tarball from a package
1441
+ - title: npm ping
1442
+ url: /cli/v10/commands/npm-ping
1443
+ description: Ping npm registry
1444
+ - title: npm pkg
1445
+ url: /cli/v10/commands/npm-pkg
1446
+ description: Manages your package.json
1447
+ - title: npm prefix
1448
+ url: /cli/v10/commands/npm-prefix
1449
+ description: Display prefix
1450
+ - title: npm profile
1451
+ url: /cli/v10/commands/npm-profile
1452
+ description: Change settings on your registry profile
1453
+ - title: npm prune
1454
+ url: /cli/v10/commands/npm-prune
1455
+ description: Remove extraneous packages
1456
+ - title: npm publish
1457
+ url: /cli/v10/commands/npm-publish
1458
+ description: Publish a package
1459
+ - title: npm query
1460
+ url: /cli/v10/commands/npm-query
1461
+ description: Retrieve a filtered list of packages
1462
+ - title: npm rebuild
1463
+ url: /cli/v10/commands/npm-rebuild
1464
+ description: Rebuild a package
1465
+ - title: npm repo
1466
+ url: /cli/v10/commands/npm-repo
1467
+ description: Open package repository page in the browser
1468
+ - title: npm restart
1469
+ url: /cli/v10/commands/npm-restart
1470
+ description: Restart a package
1471
+ - title: npm root
1472
+ url: /cli/v10/commands/npm-root
1473
+ description: Display npm root
1474
+ - title: npm run-script
1475
+ url: /cli/v10/commands/npm-run-script
1476
+ description: Run arbitrary package scripts
1477
+ - title: npm search
1478
+ url: /cli/v10/commands/npm-search
1479
+ description: Search for packages
1480
+ - title: npm shrinkwrap
1481
+ url: /cli/v10/commands/npm-shrinkwrap
1482
+ description: Lock down dependency versions for publication
1483
+ - title: npm star
1484
+ url: /cli/v10/commands/npm-star
1485
+ description: Mark your favorite packages
1486
+ - title: npm stars
1487
+ url: /cli/v10/commands/npm-stars
1488
+ description: View packages marked as favorites
1489
+ - title: npm start
1490
+ url: /cli/v10/commands/npm-start
1491
+ description: Start a package
1492
+ - title: npm stop
1493
+ url: /cli/v10/commands/npm-stop
1494
+ description: Stop a package
1495
+ - title: npm team
1496
+ url: /cli/v10/commands/npm-team
1497
+ description: Manage organization teams and team memberships
1498
+ - title: npm test
1499
+ url: /cli/v10/commands/npm-test
1500
+ description: Test a package
1501
+ - title: npm token
1502
+ url: /cli/v10/commands/npm-token
1503
+ description: Manage your authentication tokens
1504
+ - title: npm uninstall
1505
+ url: /cli/v10/commands/npm-uninstall
1506
+ description: Remove a package
1507
+ - title: npm unpublish
1508
+ url: /cli/v10/commands/npm-unpublish
1509
+ description: Remove a package from the registry
1510
+ - title: npm unstar
1511
+ url: /cli/v10/commands/npm-unstar
1512
+ description: Remove an item from your favorite packages
1513
+ - title: npm update
1514
+ url: /cli/v10/commands/npm-update
1515
+ description: Update a package
1516
+ - title: npm version
1517
+ url: /cli/v10/commands/npm-version
1518
+ description: Bump a package version
1519
+ - title: npm view
1520
+ url: /cli/v10/commands/npm-view
1521
+ description: View registry info
1522
+ - title: npm whoami
1523
+ url: /cli/v10/commands/npm-whoami
1524
+ description: Display npm username
1525
+ - title: npx
1526
+ url: /cli/v10/commands/npx
1527
+ description: Run a command from an npm package
1528
+ - title: Configuring npm
1529
+ shortName: Configuring
1530
+ url: /cli/v10/configuring-npm
1531
+ children:
1532
+ - title: Install
1533
+ url: /cli/v10/configuring-npm/install
1534
+ description: Download and install node and npm
1535
+ - title: Folders
1536
+ url: /cli/v10/configuring-npm/folders
1537
+ description: Folder structures used by npm
1538
+ - title: .npmrc
1539
+ url: /cli/v10/configuring-npm/npmrc
1540
+ description: The npm config files
1541
+ - title: npm-shrinkwrap.json
1542
+ url: /cli/v10/configuring-npm/npm-shrinkwrap-json
1543
+ description: A publishable lockfile
1544
+ - title: package.json
1545
+ url: /cli/v10/configuring-npm/package-json
1546
+ description: Specifics of npm's package.json handling
1547
+ - title: package-lock.json
1548
+ url: /cli/v10/configuring-npm/package-lock-json
1549
+ description: A manifestation of the manifest
1550
+ - title: Using npm
1551
+ shortName: Using
1552
+ url: /cli/v10/using-npm
1553
+ children:
1554
+ - title: Registry
1555
+ url: /cli/v10/using-npm/registry
1556
+ description: The JavaScript Package Registry
1557
+ - title: Package spec
1558
+ url: /cli/v10/using-npm/package-spec
1559
+ description: Package name specifier
1560
+ - title: Config
1561
+ url: /cli/v10/using-npm/config
1562
+ description: About npm configuration
1563
+ - title: Logging
1564
+ url: /cli/v10/using-npm/logging
1565
+ description: Why, What & How we Log
1566
+ - title: Scope
1567
+ url: /cli/v10/using-npm/scope
1568
+ description: Scoped packages
1569
+ - title: Scripts
1570
+ url: /cli/v10/using-npm/scripts
1571
+ description: How npm handles the "scripts" field
1572
+ - title: Workspaces
1573
+ url: /cli/v10/using-npm/workspaces
1574
+ description: Working with workspaces
1575
+ - title: Organizations
1576
+ url: /cli/v10/using-npm/orgs
1577
+ description: Working with teams & organizations
1578
+ - title: Dependency Selectors
1579
+ url: /cli/v10/using-npm/dependency-selectors
1580
+ description: Dependency Selector Syntax & Querying
1581
+ - title: Developers
1582
+ url: /cli/v10/using-npm/developers
1583
+ description: Developer guide
1584
+ - title: Removal
1585
+ url: /cli/v10/using-npm/removal
1586
+ description: Cleaning the slate
1587
+ - title: Changelog
1588
+ url: /cli/v10/using-npm/changelog
1589
+ description: Changelog notes for each version