0
在一个项目中,我用纱代替了npm,以获得它的好处,并且强制我们的依赖关系通过yarn.lock
被锁定。当package.json和yarn.lock不同步时,如何在纱线安装时发生纱线故障?
现在,开发人员添加了一个npm @ 4库,它只改变了package.json,当然不是yarn.lock。
我本来预计yarn install
命令会在构建服务器上崩溃,但纱线对我来说意外的行为却是 - 在最新版本中添加这些库,然后更新远程上的yarn.lock:
$ yarn install
warning ../package.json: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
warning [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 5.07s.
除了我打算的目的,因为构建作业不会将yarn.lock返回到存储库。我希望每个开发者对他们正在检查的版本负责。
因此,如果package.json和yarn.lock不同步,是否有办法让yarn install
退出并显示错误代码?
我打开[纱线的GitHub库的问题(https://github.com/yarnpkg/yarn/issues/4147) – k0pernikus