使用 Yarn 安装时,是否也检查了所有依赖项的锁?

When installing with Yarn, is the lock of all dependencies checked also?

通过Yarn安装包时,是否会获取依赖项的锁定版本?

例如我在包含包 A 的根目录中有一个 package.json + 锁,它也包含一个锁。 Yarn 现在会考虑两种锁吗?还是只有根锁?是否可以告诉 Yarn 忽略 2 级锁?

仅考虑顶级 Yarn.lock 文件

During install Yarn will only use the top-level yarn.lock file and will ignore any yarn.lock files that exist within dependencies. The top-level yarn.lock file includes everything Yarn needs to lock the versions of all packages in the entire dependency tree.

(Yarn documentation)

您不需要告诉 Yarn 忽略较低级别的锁定文件,因为它已经这样做了。 Yarn.lock 文件是所有依赖信息的 单一 来源——它们不会被递归处理。