Files
tldr/pages.zh/common/npm-dedupe.md

28 lines
568 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# npm dedupe
> 减少 `node_modules` 目录中的重复。
> 更多信息:<https://docs.npmjs.com/cli/commands/npm-dedupe>。
-`node_modules` 中去重包:
`npm dedupe`
- 在去重过程中遵循 `package-lock.json``npm-shrinkwrap.json`
`npm dedupe --lock`
- 以严格模式运行去重:
`npm dedupe --strict`
- 在去重过程中跳过可选/同级依赖:
`npm dedupe --omit={{optional|peer}}`
- 启用详细日志以便于故障排除:
`npm dedupe --loglevel=verbose`
- 将去重限制为特定包:
`npm dedupe {{package_name}}`