2024-10-31 20:34:22 +05:30
|
|
|
# npm find-dupes
|
|
|
|
|
|
|
|
> Identify duplicate dependencies in `node_modules`.
|
|
|
|
> More information: <https://docs.npmjs.com/cli/commands/npm-find-dupes>.
|
|
|
|
|
|
|
|
- List all duplicate packages within `node_modules`:
|
|
|
|
|
|
|
|
`npm find-dupes`
|
|
|
|
|
|
|
|
- Include `devDependencies` in duplicate detection:
|
|
|
|
|
2025-04-22 06:20:48 +03:00
|
|
|
`npm find-dupes --include dev`
|
2024-10-31 20:34:22 +05:30
|
|
|
|
|
|
|
- List all duplicate instances of a specific package in `node-modules`:
|
|
|
|
|
|
|
|
`npm find-dupes {{package_name}}`
|
|
|
|
|
|
|
|
- Exclude optional dependencies from duplicate detection:
|
|
|
|
|
2025-04-22 06:20:48 +03:00
|
|
|
`npm find-dupes --omit optional`
|
2024-10-31 20:34:22 +05:30
|
|
|
|
|
|
|
- Set the logging level for output:
|
|
|
|
|
2025-04-22 06:20:48 +03:00
|
|
|
`npm find-dupes --loglevel {{silent|error|warn|info|verbose}}`
|
2024-10-31 20:34:22 +05:30
|
|
|
|
|
|
|
- Output duplicate information in JSON format:
|
|
|
|
|
|
|
|
`npm find-dupes --json`
|
|
|
|
|
|
|
|
- Limit duplicate search to specific scopes:
|
|
|
|
|
2025-04-22 06:20:48 +03:00
|
|
|
`npm find-dupes --scope {{@scope1,@scope2}}`
|
2024-10-31 20:34:22 +05:30
|
|
|
|
|
|
|
- Exclude specific scopes from duplicate detection:
|
|
|
|
|
2025-04-22 06:20:48 +03:00
|
|
|
`npm find-dupes --omit-scope {{@scope1,@scope2}}`
|