logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Configuration

       <!-- AUTOGENERATED CONFIG DESCRIPTIONS -->

Description

       Searches the local package tree and attempts to simplify the overall
       structure by moving dependencies further up the tree, where they can
       be more effectively shared by multiple dependent packages.

       For example, consider this dependency graph:
         a
         +-- b <-- depends on c@1.0.x
         |   `-- c@1.0.3
         `-- d <-- depends on c@~1.0.9
             `-- c@1.0.10

       In this case, npmdedupe will transform the tree to:
         a
         +-- b
         +-- d
         `-- c@1.0.10

       Because of the hierarchical nature of node's module lookup, b and d
       will both get their dependency met by the single c package at the root
       level of the tree.

       In some cases, you may have a dependency graph like this:
         a
         +-- b <-- depends on c@1.0.x
         +-- c@1.0.3
         `-- d <-- depends on c@1.x
             `-- c@1.9.9

       During the installation process, the c@1.0.3 dependency for b was
       placed in the root of the tree.  Though d's dependency on c@1.x could
       have been satisfied by c@1.0.3, the newer c@1.9.0 dependency was used,
       because npm favors updates by default, even when doing so causes
       duplication.

       Running npmdedupe will cause npm to note the duplication and
       re-evaluate, deleting the nested c module, because the one in the root is
       sufficient.

       To prefer deduplication over novelty during the installation process, run
       npminstall--prefer-dedupe or npmconfigsetprefer-dedupetrue.

       Arguments are ignored. Dedupe always acts on the entire tree.

       Note that this operation transforms the dependency tree, but will never
       result in new modules being installed.

       Using npmfind-dupes will run the command in --dry-run mode.

       Note: npmdedupe will never update the semver values of direct
       dependencies in your project package.json, if you want to update
       values in package.json you can run: npmupdate--save instead.

Name

npm-dedupe

See Also

        • npm find-dupes

        • npm ls

        • npm update

        • npm install

9.2.0                                               May 2024                                       NPM-DEDUPE(1)

Synopsis

       <!-- AUTOGENERATED USAGE DESCRIPTIONS -->

See Also