Why does running yarn on windows changes yarn.lock

谁都会走 提交于 2019-12-11 04:54:33

问题


I ran yarn on my project on mac, generated a yarn.lock and committed it to git.

Now I open the same project on a Windows machine, and run yarn to get the dependencies. It outputs

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.

And indeed modifies yarn.lock.

Why does this happen, and what should I do about it?

Note: Windows isn't our main dev environment, we're developing mostly on macs and prod is linux. I'm hesitant to change my dependencies due to a Windows issue.


回答1:


When you installed the yarn on your system then you need to use the --frozen-lockfile option to prevent the lock file from getting changed.

You can find the issue reported here and here.



来源:https://stackoverflow.com/questions/51669211/why-does-running-yarn-on-windows-changes-yarn-lock

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!