npm:找出哪些依赖项使用给定的包(间接)

npm: find out which dependencies use a given package (indirectly)

我目前正在从事一个 node.js 项目,并且在开发过程中我一直在关注最新的节点版本。现在节点 6 出来了,我想看看我是否也可以做出那个决定。

原来我使用的一些模块依赖于不支持节点 6 的 graceful-fs 的旧版本。我在安装和执行我的应用程序时收到警告,但我无法确定在哪里graceful-fs 包正在被使用(间接)。

我怎样才能知道?

我很确定这就是你想要的:

npm ls graceful-fs

See documentation here.

复制自@Soufiane Ghzal 的评论和 npm-ls 文档:

To get a "bottoms up" view of why a given package is included in the tree at all, use npm explain.