| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 | .TH "NPM\-DEDUPE" "1" "August 2021" "" "".SH "NAME"\fBnpm-dedupe\fR \- Reduce duplication.SS Synopsis.P.RS 2.nfnpm dedupenpm ddpaliases: find\-dupes, ddp.fi.RE.SS Description.PSearches the local package tree and attempts to simplify the overallstructure by moving dependencies further up the tree, where they canbe more effectively shared by multiple dependent packages\..PFor example, consider this dependency graph:.P.RS 2.nfa+\-\- b <\-\- depends on c@1\.0\.x|   `\-\- c@1\.0\.3`\-\- d <\-\- depends on c@~1\.0\.9    `\-\- c@1\.0\.10.fi.RE.PIn this case, \fBnpm dedupe\fP will transform the tree to:.P.RS 2.nfa+\-\- b+\-\- d`\-\- c@1\.0\.10.fi.RE.PBecause of the hierarchical nature of node's module lookup, b and dwill both get their dependency met by the single c package at the rootlevel of the tree\..PThe deduplication algorithm walks the tree, moving each dependency as farup in the tree as possible, even if duplicates are not found\. This willresult in both a flat and deduplicated tree\..PIf a suitable version exists at the target location in the treealready, then it will be left untouched, but the other duplicates willbe deleted\..PArguments are ignored\. Dedupe always acts on the entire tree\..PModules.PNote that this operation transforms the dependency tree, but will neverresult in new modules being installed\..SS See Also.RS 0.IP \(bu 2npm help ls.IP \(bu 2npm help update.IP \(bu 2npm help install.RE
 |