.TH "NPM\-CACHE" "1" "November 2023" "9.2.0" .SH "NAME" \fBnpm-cache\fR .SH Synopsis .P Note: This command is unaware of workspaces\. .SH Description .P Used to add, list, or clean the npm cache folder\. .RS 1 .IP \(bu 2 add: .br Add the specified packages to the local cache\. This command is primarily .br intended to be used internally by npm, but it can provide a way to .br add data to the local installation cache explicitly\. .IP \(bu 2 clean: .br Delete all data out of the cache folder\. Note that this is typically .br unnecessary, as npm's cache is self\-healing and resistant to data .br corruption issues\. .IP \(bu 2 verify: .br Verify the contents of the cache folder, garbage collecting any unneeded .br data, and verifying the integrity of the cache index and all cached data\. .RE .SH Details .P npm stores cache data in an opaque directory within the configured \fBcache\fP, .br named \fB_cacache\fP\|\. This directory is a .br \fBcacache\fP\-based content\-addressable cache that .br stores all http request data as well as other package\-related data\. This .br directory is primarily accessed through \fBpacote\fP, the library responsible .br for all package fetching as of npm@5\. .P All data that passes through the cache is fully verified for integrity on .br both insertion and extraction\. Cache corruption will either trigger an .br error, or signal to \fBpacote\fP that the data must be refetched, which it will .br do automatically\. For this reason, it should never be necessary to clear .br the cache for any reason other than reclaiming disk space, thus why \fBclean\fP .br now requires \fB\-\-force\fP to run\. .P There is currently no method exposed through npm to inspect or directly .br manage the contents of this cache\. In order to access it, \fBcacache\fP must be .br used directly\. .P npm will not remove data by itself: the cache will grow as new packages are .br installed\. .SH A note about the cache's design .P The npm cache is strictly a cache: it should not be relied upon as a .br persistent and reliable data store for package data\. npm makes no guarantee .br that a previously\-cached piece of data will be available later, and will .br automatically delete corrupted contents\. The primary guarantee that the .br cache makes is that, if it does return data, that data will be exactly the .br data that was inserted\. .P To run an offline verification of existing cache contents, use \fBnpm cache verify\fP\|\. .SH Configuration .SH See Also .RS 1 .IP \(bu 2 package spec .IP \(bu 2 npm folders .IP \(bu 2 npm config .IP \(bu 2 npmrc .IP \(bu 2 npm install .IP \(bu 2 npm publish .IP \(bu 2 npm pack .IP \(bu 2 https://npm.im/cacache .IP \(bu 2 https://npm.im/pacote .IP \(bu 2 https://npm.im/@npmcli/arborist .IP \(bu 2 https://npm.im/make-fetch-happen .RE