1 ---
2 title: npm-find-dupes
3 section: 1
4 description: Find duplication in the package tree
5 github_repo: npm/cli
6 github_branch: latest
7 github_path: docs/lib/content/commands/npm-find-dupes.md
8 redirect_from:
9 - /cli-commands/find-dupes
10 - /cli-commands/npm-find-dupes
11 - /cli-documentation/cli-commands/find-dupes
12 - /cli-documentation/cli-commands/npm-find-dupes
13 - /cli-documentation/commands/find-dupes
14 - /cli-documentation/commands/npm-find-dupes
15 - /cli-documentation/find-dupes
16 - /cli-documentation/npm-find-dupes
17 - /cli-documentation/v10/cli-commands/find-dupes
18 - /cli-documentation/v10/cli-commands/npm-find-dupes
19 - /cli-documentation/v10/commands/find-dupes
20 - /cli-documentation/v10/commands/npm-find-dupes
21 - /cli-documentation/v10/find-dupes
22 - /cli-documentation/v10/npm-find-dupes
23 - /cli/cli-commands/find-dupes
24 - /cli/cli-commands/npm-find-dupes
25 - /cli/commands/find-dupes
26 - /cli/commands/npm-find-dupes
27 - /cli/find-dupes
28 - /cli/npm-find-dupes
29 - /cli/v10/cli-commands/find-dupes
30 - /cli/v10/cli-commands/npm-find-dupes
31 - /cli/v10/commands/find-dupes
32 - /cli/v10/find-dupes
33 - /cli/v10/npm-find-dupes
34 - /commands/find-dupes
35 - /commands/npm-find-dupes
36 ---
37
38 ### Synopsis
39
40 ```bash
41 npm find-dupes
42 ```
43
44 ### Description
45
46 Runs `npm dedupe` in `--dry-run` mode, making npm only output the duplications, without actually changing the package tree.
47
48 ### Configuration
49
50 #### `install-strategy`
51
52 - Default: "hoisted"
53 - Type: "hoisted", "nested", "shallow", or "linked"
54
55 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.
56
57 #### `legacy-bundling`
58
59 - Default: false
60 - Type: Boolean
61 - DEPRECATED: This option has been deprecated in favor of `--install-strategy=nested`
62
63 Instead of hoisting package installs in `node_modules`, 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 `--install-strategy=nested`.
64
65 #### `global-style`
66
67 - Default: false
68 - Type: Boolean
69 - DEPRECATED: This option has been deprecated in favor of `--install-strategy=shallow`
70
71 Only install direct dependencies in the top level `node_modules`, but hoist on deeper dependencies. Sets `--install-strategy=shallow`.
72
73 #### `strict-peer-deps`
74
75 - Default: false
76 - Type: Boolean
77
78 If set to `true`, and `--legacy-peer-deps` is not set, then _any_ conflicting `peerDependencies` will be treated as an install failure, even if npm could reasonably guess the appropriate resolution based on non-peer dependency relationships.
79
80 By default, conflicting `peerDependencies` 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 `peerDependencies` object.
81
82 When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If `--strict-peer-deps` is set, then this warning is treated as a failure.
83
84 #### `package-lock`
85
86 - Default: true
87 - Type: Boolean
88
89 If set to false, then ignore `package-lock.json` files when installing. This will also prevent _writing_ `package-lock.json` if `save` is true.
90
91 #### `omit`
92
93 - Default: 'dev' if the `NODE_ENV` environment variable is set to 'production', otherwise empty.
94 - Type: "dev", "optional", or "peer" (can be set multiple times)
95
96 Dependency types to omit from the installation tree on disk.
97
98 Note that these dependencies _are_ still resolved and added to the `package-lock.json` or `npm-shrinkwrap.json` file. They are just not physically installed on disk.
99
100 If a package type appears in both the `--include` and `--omit` lists, then it will be included.
101
102 If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts.
103
104 #### `include`
105
106 - Default:
107 - Type: "prod", "dev", "optional", or "peer" (can be set multiple times)
108
109 Option that allows for defining which types of dependencies to install.
110
111 This is the inverse of `--omit=<type>`.
112
113 Dependency types specified in `--include` will not be omitted, regardless of the order in which omit/include are specified on the command-line.
114
115 #### `ignore-scripts`
116
117 - Default: false
118 - Type: Boolean
119
120 If true, npm does not run scripts specified in package.json files.
121
122 Note that commands explicitly intended to run a particular script, such as `npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script` will still run their intended script if `ignore-scripts` is set, but they will _not_ run any pre- or post-scripts.
123
124 #### `audit`
125
126 - Default: true
127 - Type: Boolean
128
129 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 audit`](/cli/v10/commands/npm-audit) for details on what is submitted.
130
131 #### `bin-links`
132
133 - Default: true
134 - Type: Boolean
135
136 Tells npm to create symlinks (or `.cmd` shims on Windows) for package executables.
137
138 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.
139
140 #### `fund`
141
142 - Default: true
143 - Type: Boolean
144
145 When "true" displays the message at the end of each `npm install` acknowledging the number of dependencies looking for funding. See [`npm fund`](/cli/v10/commands/npm-fund) for details.
146
147 #### `workspace`
148
149 - Default:
150 - Type: String (can be set multiple times)
151
152 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.
153
154 Valid values for the `workspace` config are either:
155
156 - Workspace names
157 - Path to a workspace directory
158 - Path to a parent workspace directory (will result in selecting all workspaces within that folder)
159
160 When set for the `npm init` 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.
161
162 This value is not exported to the environment for child processes.
163
164 #### `workspaces`
165
166 - Default: null
167 - Type: null or Boolean
168
169 Set to true to run the command in the context of **all** configured workspaces.
170
171 Explicitly setting this to false will cause commands like `install` to ignore workspaces altogether. When not set explicitly:
172
173 - Commands that operate on the `node_modules` tree (install, update, etc.) will link workspaces into the `node_modules` folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, _unless_ one or more workspaces are specified in the `workspace` config.
174
175 This value is not exported to the environment for child processes.
176
177 #### `include-workspace-root`
178
179 - Default: false
180 - Type: Boolean
181
182 Include the workspace root when workspaces are enabled for a command.
183
184 When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project.
185
186 This value is not exported to the environment for child processes.
187
188 #### `install-links`
189
190 - Default: false
191 - Type: Boolean
192
193 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.
194
195 ### See Also
196
197 - [npm dedupe](/cli/v10/commands/npm-dedupe)
198 - [npm ls](/cli/v10/commands/npm-ls)
199 - [npm update](/cli/v10/commands/npm-update)
200 - [npm install](/cli/v10/commands/npm-install)