CLI documentation update from CI
npm CLI robot committed
Feb 28, 2024 at 17:59 UTC
9f88d8d9a583e2de5965fe6d318f39d4bee0ed85
23 files changed
+203
-32
content/cli/v10/commands/npm-audit.mdx
+1
-1
@@ -307,7 +307,7 @@ Dependency types specified in `--include` will not be omitted, regardless of the
307
308
#### `foreground-scripts`
309
310
-- Default: false
310
+- Default: `false` unless when using `npm pack` or `npm publish` where it defaults to `true`
311
- Type: Boolean
312
313
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process.
content/cli/v10/commands/npm-ci.mdx
+1
-1
@@ -149,7 +149,7 @@ When such an override is performed, a warning is printed, explaining the conflic
149
150
#### `foreground-scripts`
151
152
-- Default: false
152
+- Default: `false` unless when using `npm pack` or `npm publish` where it defaults to `true`
153
- Type: Boolean
154
155
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process.
content/cli/v10/commands/npm-install-ci-test.mdx
+1
-1
@@ -109,7 +109,7 @@ When such an override is performed, a warning is printed, explaining the conflic
109
110
#### `foreground-scripts`
111
112
-- Default: false
112
+- Default: `false` unless when using `npm pack` or `npm publish` where it defaults to `true`
113
- Type: Boolean
114
115
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process.
content/cli/v10/commands/npm-install-test.mdx
+1
-1
@@ -163,7 +163,7 @@ For `list` this means the output will be based on the tree described by the `pac
163
164
#### `foreground-scripts`
165
166
-- Default: false
166
+- Default: `false` unless when using `npm pack` or `npm publish` where it defaults to `true`
167
- Type: Boolean
168
169
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process.
content/cli/v10/commands/npm-install.mdx
+1
-1
@@ -446,7 +446,7 @@ For `list` this means the output will be based on the tree described by the `pac
446
447
#### `foreground-scripts`
448
449
-- Default: false
449
+- Default: `false` unless when using `npm pack` or `npm publish` where it defaults to `true`
450
- Type: Boolean
451
452
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process.
content/cli/v10/commands/npm-ls.mdx
+1
-1
@@ -52,7 +52,7 @@ Note: to get a "bottoms up" view of why a given package is included in the tree
52
Positional arguments are `name@version-range` identifiers, which will limit the results to only the paths to the packages named. Note that nested packages will _also_ show the paths to the specified packages. For example, running `npm ls promzard` in npm's source tree will show:
53
54
```bash
55
-npm@10.4.0 /path/to/npm
55
+npm@10.5.0 /path/to/npm
56
└─┬ init-package-json@0.0.4
57
└── promzard@0.1.5
58
```
content/cli/v10/commands/npm-prune.mdx
+1
-1
@@ -103,7 +103,7 @@ Not supported by all npm commands.
103
104
#### `foreground-scripts`
105
106
-- Default: false
106
+- Default: `false` unless when using `npm pack` or `npm publish` where it defaults to `true`
107
- Type: Boolean
108
109
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process.
content/cli/v10/commands/npm-query.mdx
+30
-2
@@ -166,9 +166,19 @@ npm query ":type(git)" | jq 'map(.name)' | xargs -I {} npm why {}
166
...
167
```
168
169
-### Package lock only mode
169
+### Expecting a certain number of results
170
171
-If package-lock-only is enabled, only the information in the package lock (or shrinkwrap) is loaded. This means that information from the package.json files of your dependencies will not be included in the result set (e.g. description, homepage, engines).
171
+One common use of `npm query` is to make sure there is only one version of a certain dependency in your tree. This is especially common for ecosystems like that rely on `typescript` where having state split across two different but identically-named packages causes bugs. You can use the `--expect-results` or `--expect-result-count` in your setup to ensure that npm will exit with an exit code if your tree doesn't look like you want it to.
172
+
173
+```sh
174
+$ npm query '#react' --expect-result-count=1
175
+```
176
+
177
+Perhaps you want to quickly check if there are any production dependencies that could be updated:
178
+
179
+```sh
180
+$ npm query ':root>:outdated(in-range).prod' --no-expect-results
181
+```
182
183
### Package lock only mode
184
@@ -239,6 +249,24 @@ For `update` this means only the `package-lock.json` will be updated, instead of
249
250
For `list` this means the output will be based on the tree described by the `package-lock.json`, rather than the contents of `node_modules`.
251
252
+#### `expect-results`
253
+
254
+- Default: null
255
+- Type: null or Boolean
256
+
257
+Tells npm whether or not to expect results from the command. Can be either true (expect some results) or false (expect no results).
258
+
259
+This config can not be used with: `expect-result-count`
260
+
261
+#### `expect-result-count`
262
+
263
+- Default: null
264
+- Type: null or Number
265
+
266
+Tells to expect a specific number of results from the command.
267
+
268
+This config can not be used with: `expect-results`
269
+
270
## See Also
271
272
- [dependency selectors](/cli/v10/using-npm/dependency-selectors)
content/cli/v10/commands/npm-rebuild.mdx
+1
-1
@@ -93,7 +93,7 @@ Set to false to have it not do this. This can be used to work around the fact th
93
94
#### `foreground-scripts`
95
96
-- Default: false
96
+- Default: `false` unless when using `npm pack` or `npm publish` where it defaults to `true`
97
- Type: Boolean
98
99
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process.
content/cli/v10/commands/npm-run-script.mdx
+1
-1
@@ -192,7 +192,7 @@ Note that commands explicitly intended to run a particular script, such as `npm
192
193
#### `foreground-scripts`
194
195
-- Default: false
195
+- Default: `false` unless when using `npm pack` or `npm publish` where it defaults to `true`
196
- Type: Boolean
197
198
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process.
content/cli/v10/commands/npm-update.mdx
+1
-1
@@ -248,7 +248,7 @@ If set to false, then ignore `package-lock.json` files when installing. This wil
248
249
#### `foreground-scripts`
250
251
-- Default: false
251
+- Default: `false` unless when using `npm pack` or `npm publish` where it defaults to `true`
252
- Type: Boolean
253
254
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process.
content/cli/v10/commands/npm.mdx
+1
-1
@@ -31,7 +31,7 @@ Note: This command is unaware of workspaces.
31
32
### Version
33
34
-10.4.0
34
+10.5.0
35
36
### Description
37
content/cli/v10/using-npm/changelog.mdx
+48
@@ -15,6 +15,54 @@ redirect_from:
15
- /using-npm/changelog
16
---
17
18
+## [10.5.0](https://github.com/npm/cli/compare/v10.4.0...v10.5.0) (2024-02-28)
19
+
20
+### Features
21
+
22
+- [`2366edc`](https://github.com/npm/cli/commit/2366edcaf2b32b5d1c6a7c03184c59eef0e08eae) [#7218](https://github.com/npm/cli/pull/7218) query: add :vuln pseudo selector (@wraithgar)
23
+- [`4f3ddbb`](https://github.com/npm/cli/commit/4f3ddbbe88df7c94d1e06e660928a962e973f332) [#5966](https://github.com/npm/cli/pull/5966) add --expect-entries to `npm query` (@wraithgar)
24
+
25
+### Bug Fixes
26
+
27
+- [`818957c`](https://github.com/npm/cli/commit/818957c0f88c859bf3ea90ff440ec5d9d9e990b9) [#7158](https://github.com/npm/cli/pull/7158) pack, publish: default foreground-scripts to true (#7158) (@ljharb)
28
+- [`d04111d`](https://github.com/npm/cli/commit/d04111d48ca59fce27909712b328fe5cfc4d016d) [#7197](https://github.com/npm/cli/pull/7197) view: filter out invalid semver (#7197) (@wraithgar)
29
+- [`b0a3ba0`](https://github.com/npm/cli/commit/b0a3ba0b99ce5920722244f1ccb8b830826abef4) [#7195](https://github.com/npm/cli/pull/7195) prevent adding invalid dist-tag (#7195) (@wraithgar)
30
+
31
+### Documentation
32
+
33
+- [`c4741fe`](https://github.com/npm/cli/commit/c4741fee8b4e6cdca90c6773385ff710c8b3f7f5) [#7254](https://github.com/npm/cli/pull/7254) Remove additional example and comments about uninstall script (#7254) (@rveerd)
34
+- [`686a622`](https://github.com/npm/cli/commit/686a622480d32eabf2d69982e422ba3dcd8a6f7c) [#7247](https://github.com/npm/cli/pull/7247) scope: update example command to work in windows (#7247) (@robertobasile84)
35
+- [`95b5057`](https://github.com/npm/cli/commit/95b505738a73ba740227a41b8c7c87013af5acaf) [#5966](https://github.com/npm/cli/pull/5966) clarify in-range and out-of-range in dependency selectors (@wraithgar)
36
+- [`5b7184f`](https://github.com/npm/cli/commit/5b7184f3aaf5a9ca58418b6d029616088964ed0a) [#7190](https://github.com/npm/cli/pull/7190) workspaces: fix grammar (#7190) (@alekstech)
37
+- [`0dd03f9`](https://github.com/npm/cli/commit/0dd03f9450e0cf57fa85ad2ef74b5a54f3c775a9) [#7182](https://github.com/npm/cli/pull/7182) fix typos (#7182) (@GoodDaisy)
38
+
39
+### Dependencies
40
+
41
+- [`16d4c9f`](https://github.com/npm/cli/commit/16d4c9f0e48a18719f1461460504a4228f8f663d) [#7218](https://github.com/npm/cli/pull/7218) `@npmcli/query@3.1.0`
42
+- [`06247d1`](https://github.com/npm/cli/commit/06247d18fd3573d48b220512e84f87eaab06210a) [#7242](https://github.com/npm/cli/pull/7242) `spdx-license-ids@3.0.17`
43
+- [`79d1e0b`](https://github.com/npm/cli/commit/79d1e0bc9f781b02af876f0615595976958ca410) [#7242](https://github.com/npm/cli/pull/7242) `spdx-exceptions@2.5.0`
44
+- [`67e853a`](https://github.com/npm/cli/commit/67e853a507ab31af5b82fd3fcbcb2fe2f18cad5d) [#7242](https://github.com/npm/cli/pull/7242) `socks@2.8.0`
45
+- [`4c9fe4b`](https://github.com/npm/cli/commit/4c9fe4be4df39960cfadef2ca07465c90d9ee414) [#7242](https://github.com/npm/cli/pull/7242) `lru-cache@10.2.0`
46
+- [`4a50c5a`](https://github.com/npm/cli/commit/4a50c5adaa0f28a8e9f6433c34b0eedfc73885a1) [#7242](https://github.com/npm/cli/pull/7242) `https-proxy-agent@7.0.4`
47
+- [`ed3f254`](https://github.com/npm/cli/commit/ed3f254a09d8f0da49e927e8b7fbd81c1232208e) [#7242](https://github.com/npm/cli/pull/7242) `http-proxy-agent@7.0.2`
48
+- [`8ec4fd5`](https://github.com/npm/cli/commit/8ec4fd541be937a965e685ad4dbbfb57ae3b2462) [#7242](https://github.com/npm/cli/pull/7242) `hasown@2.0.1`
49
+- [`98b1189`](https://github.com/npm/cli/commit/98b11894b770065979c8fefb87861c156ad0c895) [#7242](https://github.com/npm/cli/pull/7242) `@npmcli/agent@2.2.1`
50
+- [`dafa903`](https://github.com/npm/cli/commit/dafa903fe9083343fd17bdd3a5acc6f9acc8f356) [#7242](https://github.com/npm/cli/pull/7242) `sigstore@2.2.2`
51
+- [`d0bcb76`](https://github.com/npm/cli/commit/d0bcb76bd635eefcb1fae39e831e227a1852ef68) [#7242](https://github.com/npm/cli/pull/7242) `diff@5.2.0`
52
+- [`a13808e`](https://github.com/npm/cli/commit/a13808e2e8ed0507e12ad27f8b212e5b0b6ccae8) [#7242](https://github.com/npm/cli/pull/7242) `semver@7.6.0`
53
+- [`d6521ac`](https://github.com/npm/cli/commit/d6521ac9c43ccf909ff4d1564dffa0f07e260503) [#7242](https://github.com/npm/cli/pull/7242) `@sigstore/tuf@2.3.1`
54
+- [`43cac2f`](https://github.com/npm/cli/commit/43cac2f990aefca283d49e26ff83ba5d6fb28313) [#7242](https://github.com/npm/cli/pull/7242) `ip@2.0.1`
55
+- [workspace](https://github.com/npm/cli/releases/tag/arborist-v7.4.0): `@npmcli/arborist@7.4.0`
56
+- [workspace](https://github.com/npm/cli/releases/tag/config-v8.2.0): `@npmcli/config@8.2.0`
57
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v6.0.7): `libnpmdiff@6.0.7`
58
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v7.0.8): `libnpmexec@7.0.8`
59
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v5.0.5): `libnpmfund@5.0.5`
60
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v6.0.7): `libnpmpack@6.0.7`
61
+
62
+### Chores
63
+
64
+- [`d6bc684`](https://github.com/npm/cli/commit/d6bc6840edce1957c0ea0ed618819cbfe23fa611) [#7242](https://github.com/npm/cli/pull/7242) update devDependencies in lockfile (@wraithgar)
65
+
66
## [10.4.0](https://github.com/npm/cli/compare/v10.3.0...v10.4.0) (2024-01-24)
67
68
### Features
content/cli/v10/using-npm/config.mdx
+19
-1
@@ -371,6 +371,24 @@ If set to true, then npm will stubbornly refuse to install (or even consider ins
371
372
This can be overridden by setting the `--force` flag.
373
374
+#### `expect-result-count`
375
+
376
+- Default: null
377
+- Type: null or Number
378
+
379
+Tells to expect a specific number of results from the command.
380
+
381
+This config can not be used with: `expect-results`
382
+
383
+#### `expect-results`
384
+
385
+- Default: null
386
+- Type: null or Boolean
387
+
388
+Tells npm whether or not to expect results from the command. Can be either true (expect some results) or false (expect no results).
389
+
390
+This config can not be used with: `expect-result-count`
391
+
392
#### `fetch-retries`
393
394
- Default: 2
@@ -431,7 +449,7 @@ If you don't have a clear idea of what you want to do, it is strongly recommende
449
450
#### `foreground-scripts`
451
434
-- Default: false
452
+- Default: `false` unless when using `npm pack` or `npm publish` where it defaults to `true`
453
- Type: Boolean
454
455
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process.
content/cli/v10/using-npm/dependency-selectors.mdx
+21
-5
@@ -26,7 +26,7 @@ The [`npm query`](/cli/v10/commands/npm-query) command exposes a new dependency
26
- Unlocks the ability to answer complex, multi-faceted questions about dependencies, their relationships & associative metadata
27
- Consolidates redundant logic of similar query commands in `npm` (ex. `npm fund`, `npm ls`, `npm outdated`, `npm audit` ...)
28
29
-### Dependency Selector Syntax `v1.0.0`
29
+### Dependency Selector Syntax
30
31
#### Overview:
32
@@ -76,6 +76,7 @@ The [`npm query`](/cli/v10/commands/npm-query) command exposes a new dependency
76
- `:path(<path>)` [glob](https://www.npmjs.com/package/glob) matching based on dependencies path relative to the project
77
- `:type(<type>)` [based on currently recognized types](https://github.com/npm/npm-package-arg#result-object)
78
- `:outdated(<type>)` when a dependency is outdated
79
+- `:vuln(<selector>)` when a dependency has a known vulnerability
80
81
##### `:semver(<spec>, [selector], [function])`
82
@@ -98,8 +99,8 @@ Some examples:
99
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:
100
101
- `any` (default) a version exists that is greater than the current one
101
-- `in-range` a version exists that is greater than the current one, and satisfies at least one if its dependents
102
-- `out-of-range` a version exists that is greater than the current one, does not satisfy at least one of its dependents
102
+- `in-range` a version exists that is greater than the current one, and satisfies at least one if its parent's dependencies
103
+- `out-of-range` a version exists that is greater than the current one, does not satisfy at least one of its parent's dependencies
104
- `major` a version exists that is a semver major greater than the current one
105
- `minor` a version exists that is a semver minor greater than the current one
106
- `patch` a version exists that is a semver patch greater than the current one
@@ -113,14 +114,29 @@ In addition to the filtering performed by the pseudo selector, some extra data i
114
Some examples:
115
116
- `:root > :outdated(major)` returns every direct dependency that has a new semver major release
116
-- `.prod:outdated(in-range)` returns production dependencies that have a new release that satisfies at least one of its edges in
117
+- `.prod:outdated(in-range)` returns production dependencies that have a new release that satisfies at least one of its parent's dependencies
118
+
119
+##### `:vuln`
120
+
121
+The `:vuln` pseudo selector retrieves data from the registry and returns information about which if your dependencies has a known vulnerability. Only dependencies whose current version matches a vulnerability will be returned. For example if you have `semver@7.6.0` in your tree, a vulnerability for `semver` which affects versions `<=6.3.1` will not match.
122
+
123
+You can also filter results by certain attributes in advisories. Currently that includes `severity` and `cwe`. Note that severity filtering is done per severity, it does not include severities "higher" or "lower" than the one specified.
124
+
125
+In addition to the filtering performed by the pseudo selector, info about each relevant advisory will be added to the `queryContext` attribute of each node under the `advisories` attribute.
126
+
127
+Some examples:
128
+
129
+- `:root > .prod:vuln` returns direct production dependencies with any known vulnerability
130
+- `:vuln([severity=high])` returns only dependencies with a vulnerability with a `high` severity.
131
+- `:vuln([severity=high],[severity=moderate])` returns only dependencies with a vulnerability with a `high` or `moderate` severity.
132
+- `:vuln([cwe=1333])` returns only dependencies with a vulnerability that includes CWE-1333 (ReDoS)
133
134
#### [Attribute Selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors)
135
136
The attribute selector evaluates the key/value pairs in `package.json` if they are `String`s.
137
138
- `[]` attribute selector (ie. existence of attribute)
123
-- `[attribute=value]` attribute value is equivalant...
139
+- `[attribute=value]` attribute value is equivalent...
140
- `[attribute~=value]` attribute value contains word...
141
- `[attribute*=value]` attribute value contains string...
142
- `[attribute|=value]` attribute value is equal to or starts with...
content/cli/v10/using-npm/scope.mdx
+1
-1
@@ -111,7 +111,7 @@ Scopes have a many-to-one relationship with registries: one registry can host mu
111
You can also associate a scope with a registry using `npm config`:
112
113
```bash
114
-npm config set @myco:registry http://reg.example.com
114
+npm config set @myco:registry=http://reg.example.com
115
```
116
117
Once a scope is associated with a registry, any `npm install` for a package with that scope will request packages from that registry instead. Any `npm publish` for a package name that contains the scope will be published to that registry instead.
content/cli/v10/using-npm/scripts.mdx
+3
-4
@@ -267,13 +267,12 @@ For example, if your package.json contains this:
267
{
268
"scripts": {
269
"install": "scripts/install.js",
270
- "postinstall": "scripts/install.js",
271
- "uninstall": "scripts/uninstall.js"
270
+ "postinstall": "scripts/install.js"
271
}
272
}
273
```
274
276
-then `scripts/install.js` will be called for the install and post-install stages of the lifecycle, and `scripts/uninstall.js` will be called when the package is uninstalled. Since `scripts/install.js` is running for two different phases, it would be wise in this case to look at the `npm_lifecycle_event` environment variable.
275
+then `scripts/install.js` will be called for the install and post-install stages of the lifecycle. Since `scripts/install.js` is running for two different phases, it would be wise in this case to look at the `npm_lifecycle_event` environment variable.
276
277
If you want to run a make command, you can do so. This works just fine:
278
@@ -297,7 +296,7 @@ Note that these script files don't have to be Node.js or even JavaScript program
296
297
### Best Practices
298
300
-- Don't exit with a non-zero error code unless you _really_ mean it. Except for uninstall scripts, this will cause the npm action to fail, and potentially be rolled back. If the failure is minor or only will prevent some optional features, then it's better to just print a warning and exit successfully.
299
+- Don't exit with a non-zero error code unless you _really_ mean it. If the failure is minor or only will prevent some optional features, then it's better to just print a warning and exit successfully.
300
- Try not to use scripts to do what npm can do for you. Read through [`package.json`](/cli/v10/configuring-npm/package-json) to see all the things that you can specify and enable by simply describing your package appropriately. In general, this will lead to a more robust and consistent state.
301
- Inspect the env to determine where to put things. For instance, if the `npm_config_binroot` environment variable is set to `/home/user/bin`, then don't try to install executables into `/usr/local/bin`. The user probably set it up that way for a reason.
302
- Don't prefix your script commands with "sudo". If root permissions are required for some reason, then it'll fail with that error, and the user will sudo the npm command in question.
content/cli/v10/using-npm/workspaces.mdx
+3
-3
@@ -19,9 +19,9 @@ redirect_from:
19
20
### Description
21
22
-**Workspaces** is a generic term that refers to the set of features in the npm cli that provides support to managing multiple packages from your local file system from within a singular top-level, root package.
22
+**Workspaces** is a generic term that refers to the set of features in the npm cli that provides support for managing multiple packages from your local file system from within a singular top-level, root package.
23
24
-This set of features makes up for a much more streamlined workflow handling linked packages from the local file system. Automating the linking process as part of `npm install` and avoiding manually having to use `npm link` in order to add references to packages that should be symlinked into the current `node_modules` folder.
24
+This set of features makes up for a much more streamlined workflow handling linked packages from the local file system. It automates the linking process as part of `npm install` and removes the need to manually use `npm link` in order to add references to packages that should be symlinked into the current `node_modules` folder.
25
26
We also refer to these packages being auto-symlinked during `npm install` as a single **workspace**, meaning it's a nested package within the current local file system that is explicitly defined in the [`package.json`](/cli/v10/configuring-npm/package-json#workspaces) `workspaces` configuration.
27
@@ -97,7 +97,7 @@ Note: other installing commands such as `uninstall`, `ci`, etc will also respect
97
98
### Using workspaces
99
100
-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 by its declared `package.json` `name`. Continuing from the example defined above, let's also create a Node.js script that will require the workspace `a` example module, e.g:
100
+Given the [specifics 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 by its declared `package.json` `name`. Continuing from the example defined above, let's also create a Node.js script that will require the workspace `a` example module, e.g:
101
102
```
103
// ./packages/a/index.js
content/cli/v9/commands/npm-ls.mdx
+1
-1
@@ -36,7 +36,7 @@ Note: to get a "bottoms up" view of why a given package is included in the tree
36
Positional arguments are `name@version-range` identifiers, which will limit the results to only the paths to the packages named. Note that nested packages will _also_ show the paths to the specified packages. For example, running `npm ls promzard` in npm's source tree will show:
37
38
```bash
39
-npm@9.9.2 /path/to/npm
39
+npm@9.9.3 /path/to/npm
40
└─┬ init-package-json@0.0.4
41
└── promzard@0.1.5
42
```
content/cli/v9/commands/npm-unpublish.mdx
+3
-1
@@ -37,7 +37,9 @@ This removes a package version from the registry, deleting its entry and removin
37
38
The npm registry will return an error if you are not [logged in](/cli/v9/commands/npm-adduser).
39
40
-If you do not specify a version or if you remove all of a package's versions then the registry will remove the root package entry entirely.
40
+If you do not specify a package name at all, the name and version to be unpublished will be pulled from the project in the current directory.
41
+
42
+If you specify a package name but do not specify a version or if you remove all of a package's versions then the registry will remove the root package entry entirely.
43
44
Even if you unpublish a package version, that specific name and version combination can never be reused. In order to publish the package again, you must use a new version number. If you unpublish the entire package, you may not publish any new versions of that package until 24 hours have passed.
45
content/cli/v9/commands/npm.mdx
+1
-1
@@ -23,7 +23,7 @@ Note: This command is unaware of workspaces.
23
24
### Version
25
26
-9.9.2
26
+9.9.3
27
28
### Description
29
content/cli/v9/using-npm/changelog.mdx
+60
@@ -9,6 +9,66 @@ redirect_from:
9
- /cli/v9/misc/changelog
10
---
11
12
+## [9.9.3](https://github.com/npm/cli/compare/v9.9.2...v9.9.3) (2024-02-26)
13
+
14
+### Bug Fixes
15
+
16
+- [`88ea8c7`](https://github.com/npm/cli/commit/88ea8c772661056aae8d52870b56defed058b9b9) [#7010](https://github.com/npm/cli/pull/7010) set objectMode for search filter stream (@lukekarrys)
17
+- [`8d9d735`](https://github.com/npm/cli/commit/8d9d7351f5f9cfd7028a9f47cde520ca393218dd) [#7010](https://github.com/npm/cli/pull/7010) unpublish: bubble up all errors parsing local package.json (#7049) (@wraithgar)
18
+- [`e0e75e5`](https://github.com/npm/cli/commit/e0e75e5c153581b31a8a473e8b5823064716cfe0) [#7010](https://github.com/npm/cli/pull/7010) unpublish bugfixes (#7039) (@wraithgar)
19
+- [`4d59ce1`](https://github.com/npm/cli/commit/4d59ce1826efaaa4d23f807a3c303c78d28d4195) [#7047](https://github.com/npm/cli/pull/7047) reverse direction of SPDX SBOM dep rels (#7047) (@bdehamer, @antonbauhofer)
20
+- [`878f22b`](https://github.com/npm/cli/commit/878f22b5323554540ab48271b6ddd5502de97845) [#7008](https://github.com/npm/cli/pull/7008) properly catch missing url opener error (@wraithgar)
21
+- [`91a8eca`](https://github.com/npm/cli/commit/91a8eca99457092389ee22ff7491b6886cf30654) [#7008](https://github.com/npm/cli/pull/7008) properly catch missing url opener error on interactive prompt (@wraithgar)
22
+
23
+### Dependencies
24
+
25
+- [`1968e0e`](https://github.com/npm/cli/commit/1968e0e1d2f3b70be638b4d102a2a4d87782cd9b) [#7010](https://github.com/npm/cli/pull/7010) `spdx-license-ids@3.0.17`
26
+- [`d130576`](https://github.com/npm/cli/commit/d1305763d7981fb0d818f5ad0997ae57a431c991) [#7010](https://github.com/npm/cli/pull/7010) `spdx-exceptions@2.5.0`
27
+- [`00f28b8`](https://github.com/npm/cli/commit/00f28b8fdea49a4630b1379f859de7dc55ba20c1) [#7010](https://github.com/npm/cli/pull/7010) `signal-exit@4.1.0`
28
+- [`57096c3`](https://github.com/npm/cli/commit/57096c3fc771a8464c61401439bc1ec90f2a1b96) [#7010](https://github.com/npm/cli/pull/7010) `postcss-selector-parser@6.0.15`
29
+- [`3ce677e`](https://github.com/npm/cli/commit/3ce677ece00b0dc9fa0aa7e307efe81fbcdbf8f5) [#7010](https://github.com/npm/cli/pull/7010) `minipass-fetch@3.0.4`
30
+- [`89757ed`](https://github.com/npm/cli/commit/89757ed1dadae3f852dfaa6e34357d093607769a) [#7010](https://github.com/npm/cli/pull/7010) `is-core-module@2.13.1`
31
+- [`bc1e841`](https://github.com/npm/cli/commit/bc1e841a7048da2ee2dd4ee002f5b5b9ac00099d) [#7010](https://github.com/npm/cli/pull/7010) `socks@2.8.1`
32
+- [`01f4049`](https://github.com/npm/cli/commit/01f40496ce5c8f07f0afc768e01141ef2d72e775) [#7010](https://github.com/npm/cli/pull/7010) `ignore-walk@6.0.4`
33
+- [`15f8982`](https://github.com/npm/cli/commit/15f8982000e07afd8dcf3b4c5f8a08daf028ee12) [#7010](https://github.com/npm/cli/pull/7010) `function-bind@1.1.2`
34
+- [`88ff949`](https://github.com/npm/cli/commit/88ff949e3ad9a1a3d3253ff90b9e698532d72997) [#7010](https://github.com/npm/cli/pull/7010) `cmd-shim@6.0.2`
35
+- [`3e298f6`](https://github.com/npm/cli/commit/3e298f6d23889dc32f5b152385c5d71941340f5b) [#7010](https://github.com/npm/cli/pull/7010) `bin-links@4.0.3`
36
+- [`35a6286`](https://github.com/npm/cli/commit/35a6286ec140f8c33c4d414c8382dd793631db39) [#7010](https://github.com/npm/cli/pull/7010) `are-we-there-yet@4.0.2`
37
+- [`aeb28c4`](https://github.com/npm/cli/commit/aeb28c4047bb3f19a1f493e82687344108e9e976) [#7010](https://github.com/npm/cli/pull/7010) `agentkeepalive@4.5.0`
38
+- [`edc7e23`](https://github.com/npm/cli/commit/edc7e230c52f74f2027c08b52e6a87f9d4f80cab) [#7010](https://github.com/npm/cli/pull/7010) `@npmcli/query@3.1.0`
39
+- [`00a3a08`](https://github.com/npm/cli/commit/00a3a085041ef40685d6db340c5b0034d350963c) [#7010](https://github.com/npm/cli/pull/7010) `tar@6.2.0`
40
+- [`7f424c3`](https://github.com/npm/cli/commit/7f424c3a8a2fc6e297f78b6f53d44787299aa1e0) [#7010](https://github.com/npm/cli/pull/7010) `ssri@10.0.5`
41
+- [`79b8538`](https://github.com/npm/cli/commit/79b8538356691742c414fd4e08b41618a500ec25) [#7010](https://github.com/npm/cli/pull/7010) `semver@7.6.0`
42
+- [`b5faf10`](https://github.com/npm/cli/commit/b5faf10efd9869d789e7165e8ab22e73b4c888c0) [#7010](https://github.com/npm/cli/pull/7010) `npm-install-checks@6.3.0`
43
+- [`2c62266`](https://github.com/npm/cli/commit/2c62266ea09452dc623522d61cb10dea351dfea4) [#7010](https://github.com/npm/cli/pull/7010) `node-gyp@9.4.1`
44
+- [`cc0516b`](https://github.com/npm/cli/commit/cc0516b952180b241e090d4286d7245bb936aea2) [#7010](https://github.com/npm/cli/pull/7010) `minipass@7.0.4`
45
+- [`651d362`](https://github.com/npm/cli/commit/651d3620a53af92ba2e5bee1f2d601af05999fc0) [#7010](https://github.com/npm/cli/pull/7010) `json-parse-even-better-errors@3.0.1`
46
+- [`4b239c6`](https://github.com/npm/cli/commit/4b239c6025606e1f29adb6dd9c25c3feb488796c) [#7010](https://github.com/npm/cli/pull/7010) `glob@10.3.10`
47
+- [`2f65b46`](https://github.com/npm/cli/commit/2f65b4664ff32748a95be75de40e60e5bea4a5a1) [#7010](https://github.com/npm/cli/pull/7010) `fs-minipass@3.0.3`
48
+- [`6c73ddf`](https://github.com/npm/cli/commit/6c73ddf6cbc3facfba5e3619e26c7a1b16670ee8) [#7010](https://github.com/npm/cli/pull/7010) `diff@5.2.0`
49
+- [`73ee6cc`](https://github.com/npm/cli/commit/73ee6cc17da99ccc1018f325cf3d95e6762c7224) [#7010](https://github.com/npm/cli/pull/7010) `ci-info@4.0.0`
50
+- [`64715a4`](https://github.com/npm/cli/commit/64715a424e433dfdb7432b8fcd36fb2054f4628e) [#7010](https://github.com/npm/cli/pull/7010) `cacache@17.1.4`
51
+- [workspace](https://github.com/npm/cli/releases/tag/arborist-v6.5.1): `@npmcli/arborist@6.5.1`
52
+- [workspace](https://github.com/npm/cli/releases/tag/config-v6.4.1): `@npmcli/config@6.4.1`
53
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmaccess-v7.0.3): `libnpmaccess@7.0.3`
54
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.21): `libnpmdiff@5.0.21`
55
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v6.0.5): `libnpmexec@6.0.5`
56
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.2.2): `libnpmfund@4.2.2`
57
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmhook-v9.0.4): `libnpmhook@9.0.4`
58
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmorg-v5.0.5): `libnpmorg@5.0.5`
59
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.21): `libnpmpack@5.0.21`
60
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v7.5.2): `libnpmpublish@7.5.2`
61
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmsearch-v6.0.3): `libnpmsearch@6.0.3`
62
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmteam-v5.0.4): `libnpmteam@5.0.4`
63
+- [workspace](https://github.com/npm/cli/releases/tag/libnpmversion-v4.0.3): `libnpmversion@4.0.3`
64
+
65
+### Chores
66
+
67
+- [`77fa150`](https://github.com/npm/cli/commit/77fa1502bf9236de79aaf6a9610b46f70bf5c99e) [#7252](https://github.com/npm/cli/pull/7252) release: do not exclude docs directory from CLI release commits (#7162) (@lukekarrys)
68
+- [`1d4c464`](https://github.com/npm/cli/commit/1d4c464b42814c08eda7e716ca424757bf94a76d) [#7252](https://github.com/npm/cli/pull/7252) `@npmcli/template-oss@4.21.3` (@lukekarrys)
69
+- [`6780643`](https://github.com/npm/cli/commit/678064360ca928d1ae67d06f9f5e6bbaa735984f) [#7010](https://github.com/npm/cli/pull/7010) dev dependency updates (@wraithgar)
70
+- [`ce701e9`](https://github.com/npm/cli/commit/ce701e9470552ba3e648993f636dd5235b7d6783) [#7048](https://github.com/npm/cli/pull/7048) fix tests for zlib differences between node versions (#7048) (@wraithgar)
71
+
72
## [9.9.2](https://github.com/npm/cli/compare/v9.9.1...v9.9.2) (2023-11-14)
73
74
### Bug Fixes
content/nav.yml
+2
-2
@@ -1054,7 +1054,7 @@
1054
- title: Changelog
1055
url: /cli/v8/using-npm/changelog
1056
description: Changelog notes for each version
1057
- - title: Version 9.9.2
1057
+ - title: Version 9.9.3
1058
shortName: v9
1059
url: /cli/v9
1060
default: false
@@ -1324,7 +1324,7 @@
1324
- title: Changelog
1325
url: /cli/v9/using-npm/changelog
1326
description: Changelog notes for each version
1327
- - title: Version 10.4.0
1327
+ - title: Version 10.5.0
1328
shortName: v10
1329
url: /cli/v10
1330
default: true