npm-find-dupes.1 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. .TH "NPM-FIND-DUPES" "1" "March 2026" "NPM@11.12.0" ""
  2. .SH "NAME"
  3. \fBnpm-find-dupes\fR - Find duplication in the package tree
  4. .SS "Synopsis"
  5. .P
  6. .RS 2
  7. .nf
  8. npm find-dupes
  9. .fi
  10. .RE
  11. .SS "Description"
  12. .P
  13. Runs \fBnpm dedupe\fR in \fB--dry-run\fR mode, making npm only output the duplications, without actually changing the package tree.
  14. .SS "Configuration"
  15. .SS "\fBinstall-strategy\fR"
  16. .RS 0
  17. .IP \(bu 4
  18. Default: "hoisted"
  19. .IP \(bu 4
  20. Type: "hoisted", "nested", "shallow", or "linked"
  21. .RE 0
  22. .P
  23. Sets the strategy for installing packages in node_modules. hoisted (default): Install non-duplicated in top-level, and duplicated as necessary within directory structure. nested: (formerly --legacy-bundling) install in place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted.
  24. .SS "\fBlegacy-bundling\fR"
  25. .RS 0
  26. .IP \(bu 4
  27. Default: false
  28. .IP \(bu 4
  29. Type: Boolean
  30. .IP \(bu 4
  31. DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=nested\fR
  32. .RE 0
  33. .P
  34. Instead of hoisting package installs in \fBnode_modules\fR, install packages in the same manner that they are depended on. This may cause very deep directory structures and duplicate package installs as there is no de-duplicating. Sets \fB--install-strategy=nested\fR.
  35. .SS "\fBglobal-style\fR"
  36. .RS 0
  37. .IP \(bu 4
  38. Default: false
  39. .IP \(bu 4
  40. Type: Boolean
  41. .IP \(bu 4
  42. DEPRECATED: This option has been deprecated in favor of \fB--install-strategy=shallow\fR
  43. .RE 0
  44. .P
  45. Only install direct dependencies in the top level \fBnode_modules\fR, but hoist on deeper dependencies. Sets \fB--install-strategy=shallow\fR.
  46. .SS "\fBstrict-peer-deps\fR"
  47. .RS 0
  48. .IP \(bu 4
  49. Default: false
  50. .IP \(bu 4
  51. Type: Boolean
  52. .RE 0
  53. .P
  54. If set to \fBtrue\fR, and \fB--legacy-peer-deps\fR is not set, then \fIany\fR conflicting \fBpeerDependencies\fR will be treated as an install failure, even if npm could reasonably guess the appropriate resolution based on non-peer dependency relationships.
  55. .P
  56. By default, conflicting \fBpeerDependencies\fR deep in the dependency graph will be resolved using the nearest non-peer dependency specification, even if doing so will result in some packages receiving a peer dependency outside the range set in their package's \fBpeerDependencies\fR object.
  57. .P
  58. When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If \fB--strict-peer-deps\fR is set, then this warning is treated as a failure.
  59. .SS "\fBpackage-lock\fR"
  60. .RS 0
  61. .IP \(bu 4
  62. Default: true
  63. .IP \(bu 4
  64. Type: Boolean
  65. .RE 0
  66. .P
  67. If set to false, then ignore \fBpackage-lock.json\fR files when installing. This will also prevent \fIwriting\fR \fBpackage-lock.json\fR if \fBsave\fR is true.
  68. .SS "\fBomit\fR"
  69. .RS 0
  70. .IP \(bu 4
  71. Default: 'dev' if the \fBNODE_ENV\fR environment variable is set to 'production'; otherwise, empty.
  72. .IP \(bu 4
  73. Type: "dev", "optional", or "peer" (can be set multiple times)
  74. .RE 0
  75. .P
  76. Dependency types to omit from the installation tree on disk.
  77. .P
  78. Note that these dependencies \fIare\fR still resolved and added to the \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR file. They are just not physically installed on disk.
  79. .P
  80. If a package type appears in both the \fB--include\fR and \fB--omit\fR lists, then it will be included.
  81. .P
  82. If the resulting omit list includes \fB'dev'\fR, then the \fBNODE_ENV\fR environment variable will be set to \fB'production'\fR for all lifecycle scripts.
  83. .SS "\fBinclude\fR"
  84. .RS 0
  85. .IP \(bu 4
  86. Default:
  87. .IP \(bu 4
  88. Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
  89. .RE 0
  90. .P
  91. Option that allows for defining which types of dependencies to install.
  92. .P
  93. This is the inverse of \fB--omit=<type>\fR.
  94. .P
  95. Dependency types specified in \fB--include\fR will not be omitted, regardless of the order in which omit/include are specified on the command-line.
  96. .SS "\fBignore-scripts\fR"
  97. .RS 0
  98. .IP \(bu 4
  99. Default: false
  100. .IP \(bu 4
  101. Type: Boolean
  102. .RE 0
  103. .P
  104. If true, npm does not run scripts specified in package.json files.
  105. .P
  106. Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts.
  107. .SS "\fBaudit\fR"
  108. .RS 0
  109. .IP \(bu 4
  110. Default: true
  111. .IP \(bu 4
  112. Type: Boolean
  113. .RE 0
  114. .P
  115. When "true" submit audit reports alongside the current npm command to the default registry and all registries configured for scopes. See the documentation for npm help audit for details on what is submitted.
  116. .SS "\fBbin-links\fR"
  117. .RS 0
  118. .IP \(bu 4
  119. Default: true
  120. .IP \(bu 4
  121. Type: Boolean
  122. .RE 0
  123. .P
  124. Tells npm to create symlinks (or \fB.cmd\fR shims on Windows) for package executables.
  125. .P
  126. Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems.
  127. .SS "\fBfund\fR"
  128. .RS 0
  129. .IP \(bu 4
  130. Default: true
  131. .IP \(bu 4
  132. Type: Boolean
  133. .RE 0
  134. .P
  135. When "true" displays the message at the end of each \fBnpm install\fR acknowledging the number of dependencies looking for funding. See npm help fund for details.
  136. .SS "\fBworkspace\fR"
  137. .RS 0
  138. .IP \(bu 4
  139. Default:
  140. .IP \(bu 4
  141. Type: String (can be set multiple times)
  142. .RE 0
  143. .P
  144. Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option.
  145. .P
  146. Valid values for the \fBworkspace\fR config are either:
  147. .RS 0
  148. .IP \(bu 4
  149. Workspace names
  150. .IP \(bu 4
  151. Path to a workspace directory
  152. .IP \(bu 4
  153. Path to a parent workspace directory (will result in selecting all workspaces within that folder)
  154. .RE 0
  155. .P
  156. When set for the \fBnpm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project.
  157. .P
  158. This value is not exported to the environment for child processes.
  159. .SS "\fBworkspaces\fR"
  160. .RS 0
  161. .IP \(bu 4
  162. Default: null
  163. .IP \(bu 4
  164. Type: null or Boolean
  165. .RE 0
  166. .P
  167. Set to true to run the command in the context of \fBall\fR configured workspaces.
  168. .P
  169. Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly:
  170. .RS 0
  171. .IP \(bu 4
  172. Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config.
  173. .RE 0
  174. .P
  175. This value is not exported to the environment for child processes.
  176. .SS "\fBinclude-workspace-root\fR"
  177. .RS 0
  178. .IP \(bu 4
  179. Default: false
  180. .IP \(bu 4
  181. Type: Boolean
  182. .RE 0
  183. .P
  184. Include the workspace root when workspaces are enabled for a command.
  185. .P
  186. When false, specifying individual workspaces via the \fBworkspace\fR config, or all workspaces via the \fBworkspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project.
  187. .P
  188. This value is not exported to the environment for child processes.
  189. .SS "\fBinstall-links\fR"
  190. .RS 0
  191. .IP \(bu 4
  192. Default: false
  193. .IP \(bu 4
  194. Type: Boolean
  195. .RE 0
  196. .P
  197. When set file: protocol dependencies will be packed and installed as regular dependencies instead of creating a symlink. This option has no effect on workspaces.
  198. .SS "See Also"
  199. .RS 0
  200. .IP \(bu 4
  201. npm help dedupe
  202. .IP \(bu 4
  203. npm help ls
  204. .IP \(bu 4
  205. npm help update
  206. .IP \(bu 4
  207. npm help install
  208. .RE 0