[英]Determine npm package dependency chain
I run npm install
on a project and get a deprecation error for an underlying dependency.我在一个项目上运行
npm install
并收到一个底层依赖项的弃用错误。
It is not a direct dependency, it's in node_modules.它不是直接依赖,它在 node_modules 中。 How can I easily figure out which of my dependencies eventually depends on the problematic library?
如何轻松确定我的哪些依赖项最终取决于有问题的库?
A first-pass solution is to use grep, but 2 issues:第一次通过的解决方案是使用 grep,但有两个问题:
What's wrong with using npm ls
?使用
npm ls
什么问题? Here's sample output for a module:以下是模块的示例输出:
➜ node-address-rfc2821 git:(master) npm ls
address-rfc2821@2.0.0 /Users/matt/git/node-address-rfc2821
├─┬ nearley@2.20.1
│ ├── commander@2.20.3
│ ├── moo@0.5.1
│ ├── railroad-diagrams@1.0.0
│ └─┬ randexp@0.4.6
│ ├── discontinuous-range@1.0.0
│ └── ret@0.1.15
└── punycode@2.1.1
The command npm ls
has been around since at least 2011命令
npm ls
至少从2011 年就已经存在
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.