跳到主要内容

pnpm why

列出所有依赖某个软件包的软件包。

警告

If the Dependencies Tree has more than 10 results (end leaves), the output will be truncated to 10 end leaves.

This makes the output more readable and avoids memory issues.

参数

--recursive, -r

Show the dependency tree for the specified package on every package in subdirectories or on every workspace package when executed inside a workspace.

--json

以 JSON 格式显示信息。

--long

输出详细信息i。

--parseable

显示可解析的输出而不是树状视图。

--global, -g

列出全局安装目录下(而不是当前项目下)的所有软件包。

--prod, -P

仅列出 dependencies 字段中定义的软件包的依赖树。

--dev, -D

仅列出 devDependencies 字段中定义的软件包的依赖树。

--depth <number>

Display only dependencies within a specific depth.

--only-projects

Display only dependencies that are also projects within the workspace.

--filter <package_selector>

更多信息参见此链接。