You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: deps/npm/docs/content/commands/npm-cache.md
+30-32Lines changed: 30 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -11,59 +11,56 @@ npm cache add <package-spec>
11
11
npm cache clean [<key>]
12
12
npm cache ls [<name>@<version>]
13
13
npm cache verify
14
+
npm cache npx ls
15
+
npm cache npx rm [<key>...]
16
+
npm cache npx info <key>...
14
17
```
15
18
16
19
Note: This command is unaware of workspaces.
17
20
18
21
### Description
19
22
20
-
Used to add, list, or clean the npm cache folder.
23
+
Used to add, list, or clean the `npm cache` folder.
24
+
Also used to view info about entries in the `npm exec` (aka `npx`) cache folder.
25
+
26
+
#### `npm cache`
21
27
22
28
* add:
23
-
Add the specified packages to the local cache. This command is primarily
24
-
intended to be used internally by npm, but it can provide a way to
25
-
add data to the local installation cache explicitly.
29
+
Add the specified packages to the local cache. This command is primarily intended to be used internally by npm, but it can provide a way to add data to the local installation cache explicitly.
26
30
27
31
* clean:
28
-
Delete all data out of the cache folder. Note that this is typically
29
-
unnecessary, as npm's cache is self-healing and resistant to data
30
-
corruption issues.
32
+
Delete a single entry or all entries out of the cache folder. Note that this is typically unnecessary, as npm's cache is self-healing and resistant to data corruption issues.
33
+
34
+
* ls:
35
+
List given entries or all entries in the local cache.
31
36
32
37
* verify:
33
-
Verify the contents of the cache folder, garbage collecting any unneeded
34
-
data, and verifying the integrity of the cache index and all cached data.
38
+
Verify the contents of the cache folder, garbage collecting any unneeded data, and verifying the integrity of the cache index and all cached data.
39
+
40
+
#### `npm cache npx`
41
+
42
+
* ls:
43
+
List all entries in the npx cache.
44
+
45
+
* rm:
46
+
Remove given entries or all entries from the npx cache.
47
+
48
+
* info:
49
+
Get detailed information about given entries in the npx cache.
35
50
36
51
### Details
37
52
38
-
npm stores cache data in an opaque directory within the configured `cache`,
39
-
named `_cacache`. This directory is a
40
-
[`cacache`](http://npm.im/cacache)-based content-addressable cache that
41
-
stores all http request data as well as other package-related data. This
42
-
directory is primarily accessed through `pacote`, the library responsible
43
-
for all package fetching as of npm@5.
53
+
npm stores cache data in an opaque directory within the configured `cache`, named `_cacache`. This directory is a [`cacache`](http://npm.im/cacache)-based content-addressable cache that stores all http request data as well as other package-related data. This directory is primarily accessed through `pacote`, the library responsible for all package fetching as of npm@5.
44
54
45
-
All data that passes through the cache is fully verified for integrity on
46
-
both insertion and extraction. Cache corruption will either trigger an
47
-
error, or signal to `pacote` that the data must be refetched, which it will
48
-
do automatically. For this reason, it should never be necessary to clear
49
-
the cache for any reason other than reclaiming disk space, thus why `clean`
50
-
now requires `--force` to run.
55
+
All data that passes through the cache is fully verified for integrity on both insertion and extraction. Cache corruption will either trigger an error, or signal to `pacote` that the data must be refetched, which it will do automatically. For this reason, it should never be necessary to clear the cache for any reason other than reclaiming disk space, thus why `clean` now requires `--force` to run.
51
56
52
-
There is currently no method exposed through npm to inspect or directly
53
-
manage the contents of this cache. In order to access it, `cacache` must be
54
-
used directly.
57
+
There is currently no method exposed through npm to inspect or directly manage the contents of this cache. In order to access it, `cacache` must be used directly.
55
58
56
-
npm will not remove data by itself: the cache will grow as new packages are
57
-
installed.
59
+
npm will not remove data by itself: the cache will grow as new packages are installed.
58
60
59
61
### A note about the cache's design
60
62
61
-
The npm cache is strictly a cache: it should not be relied upon as a
62
-
persistent and reliable data store for package data. npm makes no guarantee
63
-
that a previously-cached piece of data will be available later, and will
64
-
automatically delete corrupted contents. The primary guarantee that the
65
-
cache makes is that, if it does return data, that data will be exactly the
66
-
data that was inserted.
63
+
The npm cache is strictly a cache: it should not be relied upon as a persistent and reliable data store for package data. npm makes no guarantee that a previously-cached piece of data will be available later, and will automatically delete corrupted contents. The primary guarantee that the cache makes is that, if it does return data, that data will be exactly the data that was inserted.
67
64
68
65
To run an offline verification of existing cache contents, use `npm cache
69
66
verify`.
@@ -88,6 +85,7 @@ The location of npm's cache directory.
<divid="_table_of_contents"><ul><li><ahref="#synopsis">Synopsis</a></li><li><ahref="#description">Description</a></li><li><ahref="#details">Details</a></li><li><ahref="#a-note-about-the-caches-design">A note about the cache's design</a></li><li><ahref="#configuration">Configuration</a></li><ul><li><ahref="#cache"><code>cache</code></a></li></ul><li><ahref="#see-also">See Also</a></li></ul></div>
153
+
<divid="_table_of_contents"><ul><li><ahref="#synopsis">Synopsis</a></li><li><ahref="#description">Description</a></li><ul><li><ahref="#npm-cache"><code>npm cache</code></a></li><li><ahref="#npm-cache-npx"><code>npm cache npx</code></a></li></ul><li><ahref="#details">Details</a></li><li><ahref="#a-note-about-the-caches-design">A note about the cache's design</a></li><li><ahref="#configuration">Configuration</a></li><ul><li><ahref="#cache"><code>cache</code></a></li></ul><li><ahref="#see-also">See Also</a></li></ul></div>
<p>Note: This command is unaware of workspaces.</p>
163
166
<h3id="description">Description</h3>
164
-
<p>Used to add, list, or clean the npm cache folder.</p>
167
+
<p>Used to add, list, or clean the <code>npm cache</code> folder.
168
+
Also used to view info about entries in the <code>npm exec</code> (aka <code>npx</code>) cache folder.</p>
169
+
<h4id="npm-cache"><code>npm cache</code></h4>
165
170
<ul>
166
171
<li>
167
172
<p>add:
168
-
Add the specified packages to the local cache. This command is primarily
169
-
intended to be used internally by npm, but it can provide a way to
170
-
add data to the local installation cache explicitly.</p>
173
+
Add the specified packages to the local cache. This command is primarily intended to be used internally by npm, but it can provide a way to add data to the local installation cache explicitly.</p>
171
174
</li>
172
175
<li>
173
176
<p>clean:
174
-
Delete all data out of the cache folder. Note that this is typically
175
-
unnecessary, as npm's cache is self-healing and resistant to data
176
-
corruption issues.</p>
177
+
Delete a single entry or all entries out of the cache folder. Note that this is typically unnecessary, as npm's cache is self-healing and resistant to data corruption issues.</p>
178
+
</li>
179
+
<li>
180
+
<p>ls:
181
+
List given entries or all entries in the local cache.</p>
177
182
</li>
178
183
<li>
179
184
<p>verify:
180
-
Verify the contents of the cache folder, garbage collecting any unneeded
181
-
data, and verifying the integrity of the cache index and all cached data.</p>
185
+
Verify the contents of the cache folder, garbage collecting any unneeded data, and verifying the integrity of the cache index and all cached data.</p>
Remove given entries or all entries from the npx cache.</p>
197
+
</li>
198
+
<li>
199
+
<p>info:
200
+
Get detailed information about given entries in the npx cache.</p>
182
201
</li>
183
202
</ul>
184
203
<h3id="details">Details</h3>
185
-
<p>npm stores cache data in an opaque directory within the configured <code>cache</code>,
186
-
named <code>_cacache</code>. This directory is a
187
-
<ahref="http://npm.im/cacache"><code>cacache</code></a>-based content-addressable cache that
188
-
stores all http request data as well as other package-related data. This
189
-
directory is primarily accessed through <code>pacote</code>, the library responsible
190
-
for all package fetching as of npm@5.</p>
191
-
<p>All data that passes through the cache is fully verified for integrity on
192
-
both insertion and extraction. Cache corruption will either trigger an
193
-
error, or signal to <code>pacote</code> that the data must be refetched, which it will
194
-
do automatically. For this reason, it should never be necessary to clear
195
-
the cache for any reason other than reclaiming disk space, thus why <code>clean</code>
196
-
now requires <code>--force</code> to run.</p>
197
-
<p>There is currently no method exposed through npm to inspect or directly
198
-
manage the contents of this cache. In order to access it, <code>cacache</code> must be
199
-
used directly.</p>
200
-
<p>npm will not remove data by itself: the cache will grow as new packages are
201
-
installed.</p>
204
+
<p>npm stores cache data in an opaque directory within the configured <code>cache</code>, named <code>_cacache</code>. This directory is a <ahref="http://npm.im/cacache"><code>cacache</code></a>-based content-addressable cache that stores all http request data as well as other package-related data. This directory is primarily accessed through <code>pacote</code>, the library responsible for all package fetching as of npm@5.</p>
205
+
<p>All data that passes through the cache is fully verified for integrity on both insertion and extraction. Cache corruption will either trigger an error, or signal to <code>pacote</code> that the data must be refetched, which it will do automatically. For this reason, it should never be necessary to clear the cache for any reason other than reclaiming disk space, thus why <code>clean</code> now requires <code>--force</code> to run.</p>
206
+
<p>There is currently no method exposed through npm to inspect or directly manage the contents of this cache. In order to access it, <code>cacache</code> must be used directly.</p>
207
+
<p>npm will not remove data by itself: the cache will grow as new packages are installed.</p>
202
208
<h3id="a-note-about-the-caches-design">A note about the cache's design</h3>
203
-
<p>The npm cache is strictly a cache: it should not be relied upon as a
204
-
persistent and reliable data store for package data. npm makes no guarantee
205
-
that a previously-cached piece of data will be available later, and will
206
-
automatically delete corrupted contents. The primary guarantee that the
207
-
cache makes is that, if it does return data, that data will be exactly the
208
-
data that was inserted.</p>
209
+
<p>The npm cache is strictly a cache: it should not be relied upon as a persistent and reliable data store for package data. npm makes no guarantee that a previously-cached piece of data will be available later, and will automatically delete corrupted contents. The primary guarantee that the cache makes is that, if it does return data, that data will be exactly the data that was inserted.</p>
209
210
<p>To run an offline verification of existing cache contents, use <code>npm cache verify</code>.</p>
0 commit comments