使用相同的 nodejs 版本和 yarn.lock,安装 frozen-lockfile 在 Ubuntu 上运行但在 Mac 上失败

With same nodejs version and yarn.lock, install frozen-lockfile works on Ubuntu but fail on Mac

这是我对yarn nodejs 包管理工作原理的理解

-> 当你 运行 yarn install

时,当前 OS 不会影响 yarn.lock 里面的包

我做了什么:

并且安装失败。但是当我在 Mac 上使用不同版本的 nodejs 时,运行ning yarn install --frozen-lockfile 有效。

这是否意味着:

无法保证安装适用于所有 OS?

yarn.lock it won't work 100% on other platforms until unless all dependencies support cross platforms

刚刚检查了我的 yarn.lock 他们添加了一些基于操作系统的依赖项,在我的例子中是 is-windows 添加了模块

检查所有包是否支持跨平台,因为有时许多包是特定于平台的,您可以检查该包 packages.json 的所有依赖项

如果您在不同的操作系统上使用该应用程序,请不要推送 yarn.lock