在一个项目中,我用 yarn 替换了 npm 以获得它的好处,并且还强制我们的依赖项通过yarn.lock
.
现在,开发人员添加了一个带有 npm@4 的库,它只更改package.json
了yarn.lock
.
我原以为该yarn install
命令会在构建服务器上崩溃,但 yarn 有——对我来说出乎意料的行为——在它们的最新版本中添加这些库,然后yarn.lock
在远程更新:
$ yarn install
[1/4] Resolving packages...
[2/4] Fetching packages...
warning fsevents@1.1.2: The platform "linux" is incompatible with this module.
info "fsevents@1.1.2" 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
回存储库,也不应该。
我希望每个开发人员对他们签入的版本负责。
因此,如果and不同步,有没有办法以yarn install
错误代码退出?package.json
yarn.lock