代码之家  ›  专栏  ›  技术社区  ›  ripper234 Jonathan

为什么在windows上运行yarn会改变yarn.lock

  •  1
  • ripper234 Jonathan  · 技术社区  · 8 年前

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

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

    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.
    

    而且确实能改变纱线。锁。

    为什么会这样,我该怎么办?

    注意:Windows不是我们的主要开发环境,我们主要在macs上开发,prod是linux。由于Windows问题,我对更改依赖关系犹豫不决。

    1 回复  |  直到 8 年前
        1
  •  0
  •   Rahul Tripathi    8 年前

    当您在系统上安装纱线时,需要使用 --frozen-lockfile 选项以防止更改锁定文件。

    你可以找到报告的问题 here here .