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