3 <title>npm-cache</title>
4 <meta http-equiv="content-type" value="text/html;utf-8">
5 <link rel="stylesheet" type="text/css" href="../../static/style.css">
6 <link rel="canonical" href="https://www.npmjs.org/doc/cli/npm-cache.html">
7 <script async=true src="../../static/toc.js"></script>
12 <h1><a href="../cli/npm-cache.html">npm-cache</a></h1> <p>Manipulates packages cache</p>
13 <h2 id="synopsis">SYNOPSIS</h2>
14 <pre><code>npm cache add <tarball file>
15 npm cache add <folder>
16 npm cache add <tarball url>
17 npm cache add <name>@<version>
19 npm cache ls [<path>]
21 npm cache clean [<path>]
22 </code></pre><h2 id="description">DESCRIPTION</h2>
23 <p>Used to add, list, or clear the npm cache folder.</p>
26 Add the specified package to the local cache. This command is primarily
27 intended to be used internally by npm, but it can provide a way to
28 add data to the local installation cache explicitly.</p>
31 Show the data in the cache. Argument is a path to show in the cache
32 folder. Works a bit like the <code>find</code> program, but limited by the
33 <code>depth</code> config.</p>
36 Delete data out of the cache folder. If an argument is provided, then
37 it specifies a subpath to delete. If no argument is provided, then
38 the entire cache is cleared.</p>
41 <h2 id="details">DETAILS</h2>
42 <p>npm stores cache data in the directory specified in <code>npm config get cache</code>.
43 For each package that is added to the cache, three pieces of information are
44 stored in <code>{cache}/{name}/{version}</code>:</p>
47 A folder containing the package contents as they appear in the tarball.</li>
49 The package.json file, as npm sees it, with overlays applied and a _id attribute.</li>
51 The tarball for that version.</li>
53 <p>Additionally, whenever a registry request is made, a <code>.cache.json</code> file
54 is placed at the corresponding URI, to store the ETag and the requested
56 <p>Commands that make non-essential registry requests (such as <code>search</code> and
57 <code>view</code>, or the completion scripts) generally specify a minimum timeout.
58 If the <code>.cache.json</code> file is younger than the specified timeout, then
59 they do not make an HTTP request to the registry.</p>
60 <h2 id="configuration">CONFIGURATION</h2>
61 <h3 id="cache">cache</h3>
62 <p>Default: <code>~/.npm</code> on Posix, or <code>%AppData%/npm-cache</code> on Windows.</p>
63 <p>The root cache folder.</p>
64 <h2 id="see-also">SEE ALSO</h2>
66 <li><a href="../files/npm-folders.html">npm-folders(5)</a></li>
67 <li><a href="../cli/npm-config.html">npm-config(1)</a></li>
68 <li><a href="../misc/npm-config.html">npm-config(7)</a></li>
69 <li><a href="../files/npmrc.html">npmrc(5)</a></li>
70 <li><a href="../cli/npm-install.html">npm-install(1)</a></li>
71 <li><a href="../cli/npm-publish.html">npm-publish(1)</a></li>
72 <li><a href="../cli/npm-pack.html">npm-pack(1)</a></li>
77 <table border=0 cellspacing=0 cellpadding=0 id=npmlogo>
78 <tr><td style="width:180px;height:10px;background:rgb(237,127,127)" colspan=18> </td></tr>
79 <tr><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)"> </td><td style="width:40px;height:10px;background:#fff" colspan=4> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4> </td><td style="width:40px;height:10px;background:#fff" colspan=4> </td><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)"> </td><td colspan=6 style="width:60px;height:10px;background:#fff"> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4> </td></tr>
80 <tr><td colspan=2 style="width:20px;height:30px;background:#fff" rowspan=3> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3> </td><td style="width:10px;height:10px;background:#fff" rowspan=3> </td><td style="width:20px;height:10px;background:#fff" rowspan=4 colspan=2> </td><td style="width:10px;height:20px;background:rgb(237,127,127)" rowspan=2> </td><td style="width:10px;height:10px;background:#fff" rowspan=3> </td><td style="width:20px;height:10px;background:#fff" rowspan=3 colspan=2> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3> </td><td style="width:10px;height:10px;background:#fff" rowspan=3> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3> </td></tr>
81 <tr><td style="width:10px;height:10px;background:#fff" rowspan=2> </td></tr>
82 <tr><td style="width:10px;height:10px;background:#fff"> </td></tr>
83 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
84 <tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
86 <p id="footer">npm-cache — npm@1.4.10</p>