npm-cache.1 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. .TH "NPM\-CACHE" "1" "October 2021" "" ""
  2. .SH "NAME"
  3. \fBnpm-cache\fR \- Manipulates packages cache
  4. .SS Synopsis
  5. .P
  6. .RS 2
  7. .nf
  8. npm cache add <tarball file>\.\.\.
  9. npm cache add <folder>\.\.\.
  10. npm cache add <tarball url>\.\.\.
  11. npm cache add <name>@<version>\.\.\.
  12. npm cache clean
  13. aliases: npm cache clear, npm cache rm
  14. npm cache verify
  15. .fi
  16. .RE
  17. .P
  18. Note: This command is unaware of workspaces\.
  19. .SS Description
  20. .P
  21. Used to add, list, or clean the npm cache folder\.
  22. .RS 0
  23. .IP \(bu 2
  24. add:
  25. Add the specified packages to the local cache\. This command is primarily
  26. intended to be used internally by npm, but it can provide a way to
  27. add data to the local installation cache explicitly\.
  28. .IP \(bu 2
  29. clean:
  30. Delete all data out of the cache folder\. Note that this is typically
  31. unnecessary, as npm's cache is self\-healing and resistant to data
  32. corruption issues\.
  33. .IP \(bu 2
  34. verify:
  35. Verify the contents of the cache folder, garbage collecting any unneeded
  36. data, and verifying the integrity of the cache index and all cached data\.
  37. .RE
  38. .SS Details
  39. .P
  40. npm stores cache data in an opaque directory within the configured \fBcache\fP,
  41. named \fB_cacache\fP\|\. This directory is a
  42. \fBcacache\fP \fIhttp://npm\.im/cacache\fR\-based content\-addressable cache that
  43. stores all http request data as well as other package\-related data\. This
  44. directory is primarily accessed through \fBpacote\fP, the library responsible
  45. for all package fetching as of npm@5\.
  46. .P
  47. All data that passes through the cache is fully verified for integrity on
  48. both insertion and extraction\. Cache corruption will either trigger an
  49. error, or signal to \fBpacote\fP that the data must be refetched, which it will
  50. do automatically\. For this reason, it should never be necessary to clear
  51. the cache for any reason other than reclaiming disk space, thus why \fBclean\fP
  52. now requires \fB\-\-force\fP to run\.
  53. .P
  54. There is currently no method exposed through npm to inspect or directly
  55. manage the contents of this cache\. In order to access it, \fBcacache\fP must be
  56. used directly\.
  57. .P
  58. npm will not remove data by itself: the cache will grow as new packages are
  59. installed\.
  60. .SS A note about the cache's design
  61. .P
  62. The npm cache is strictly a cache: it should not be relied upon as a
  63. persistent and reliable data store for package data\. npm makes no guarantee
  64. that a previously\-cached piece of data will be available later, and will
  65. automatically delete corrupted contents\. The primary guarantee that the
  66. cache makes is that, if it does return data, that data will be exactly the
  67. data that was inserted\.
  68. .P
  69. To run an offline verification of existing cache contents, use \fBnpm cache
  70. verify\fP\|\.
  71. .SS Configuration
  72. <!\-\- AUTOGENERATED CONFIG DESCRIPTIONS START \-\->
  73. <!\-\- automatically generated, do not edit manually \-\->
  74. <!\-\- see lib/utils/config/definitions\.js \-\->
  75. .SS \fBcache\fP
  76. .RS 0
  77. .IP \(bu 2
  78. Default: Windows: \fB%LocalAppData%\\npm\-cache\fP, Posix: \fB~/\.npm\fP
  79. .IP \(bu 2
  80. Type: Path
  81. .RE
  82. .P
  83. The location of npm's cache directory\. See npm help \fBnpm
  84. cache\fP
  85. <!\-\- automatically generated, do not edit manually \-\->
  86. <!\-\- see lib/utils/config/definitions\.js \-\->
  87. <!\-\- AUTOGENERATED CONFIG DESCRIPTIONS END \-\->
  88. .SS See Also
  89. .RS 0
  90. .IP \(bu 2
  91. npm help folders
  92. .IP \(bu 2
  93. npm help config
  94. .IP \(bu 2
  95. npm help npmrc
  96. .IP \(bu 2
  97. npm help install
  98. .IP \(bu 2
  99. npm help publish
  100. .IP \(bu 2
  101. npm help pack
  102. .IP \(bu 2
  103. https://npm\.im/cacache
  104. .IP \(bu 2
  105. https://npm\.im/pacote
  106. .IP \(bu 2
  107. https://npm\.im/@npmcli/arborist
  108. .IP \(bu 2
  109. https://npm\.im/make\-fetch\-happen
  110. .RE