【问题标题】:Why does running yarn on windows changes yarn.lock为什么在 windows 上运行 yarn 会改变 yarn.lock
【发布时间】:2019-01-11 03:29:44
【问题描述】:

我在 Mac 上的项目上运行了 yarn,生成了一个 yarn.lock 并将其提交给 git。

现在我在 Windows 机器上打开同一个项目,然后运行 ​​yarn 来获取依赖项。它输出

yarn install v0.24.5
[1/4] Resolving packages...
[2/4] Fetching packages...
warning fsevents@1.2.4: The platform "win32" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.

并且确实修改了 yarn.lock。

为什么会发生这种情况,我应该怎么做?

注意:Windows 不是我们的主要开发环境,我们主要在 mac 上进行开发,prod 是 linux。由于 Windows 问题,我犹豫是否要更改我的依赖项。

【问题讨论】:

    标签: yarnpkg


    【解决方案1】:

    当您在系统上安装了 yarn 后,您需要使用 --frozen-lockfile 选项来防止锁定文件被更改。

    您可以找到herehere 报告的问题。

    【讨论】:

      猜你喜欢
      • 2019-12-09
      • 2018-07-17
      • 2019-12-18
      • 1970-01-01
      • 1970-01-01
      • 2018-08-29
      • 2011-08-02
      • 1970-01-01
      • 2022-11-11
      相关资源
      最近更新 更多