NPM 过时的命令未显示完整列表

OrA*_*yag 5 npm npm-cli npm-outdated

当我在我的终端上执行操作时: npm outdated -g 我得到了一个具有可用更新的全局包列表,这很好:

Package              Current  Wanted  Latest  Location
create-next-app       10.0.3  10.0.4  10.0.4  global
eslint-plugin-react   7.21.5  7.22.0  7.22.0  global
firebase-tools         9.0.1   9.1.0   9.1.0  global
Run Code Online (Sandbox Code Playgroud)

在我安装完所有这些之后,我想确保我更新了所有软件包,所以我再次点击了相同的命令,但不小心点击了npm outdated -g\. 这次我拿到了一个之前没有列出的包:

Package                 Current  Wanted  Latest  Location
eslint-plugin-flowtype    3.9.1  3.13.0   5.2.0  global
Run Code Online (Sandbox Code Playgroud)

我再次击中npm outdated -g并没有结果,并用反斜杠重复并得到了这个包。
我检查了这个,没有看到任何相关的东西。有谁知道是什么问题?当然我可以看到这个eslint-plugin-flowtype包有破坏性的变化(3.x vs 5.x),但它怎么没有显示在原始npm outdated -g命令中?

谢谢。

小智 0

如文档中所示,npm outdated默认深度为 0,因此除非您覆盖它,否则您将始终只看到过时的顶级依赖项。您可以运行类似npm outdated --depth 9999查看全部的操作。