Yarn v1.13.0 发布了,这是一个 Facebook 推出的 JavaScript 包管理器。该版本主要是修复了 bug,但也包括功能改进和新增功能,具体如下:
Implements a new
package.json
field:peerDependenciesMeta
#6671 - Maël NisonAdds an
optional
settings topeerDependenciesMeta
to silence missing peer dependency warnings #6671 - Maël NisonImplements
yarn policies set-version [range]
. Check the documentation for usage & tips. #6673 - Maël NisonFixes a resolution issue when a package had an invalid
main
entry #6682 - Maël NisonDecreases the size of the generated
$PATH
environment variable for a better Windows support #6683 - Rowan LonsdaleFixes postinstall scripts for third-party packages when they were referencing a binary from their own dependencies #6712 - Maël Nison
Fixes yarn audit exit code overflow #6748 - Andrey Vetlugin
Stops automatically unplugging packages with postinstall script when running under
--ignore-scripts
#6820 - Maël NisonAdds transparent support for the
resolve
package when using Plug'n'Play #6816 - Maël Nison扫描二维码关注公众号,回复: 4561257 查看本文章Properly reports the error codes when the npm registry throws 500's #6817 - Maël Nison
Yarn 是 Facebook 推出的 JavaScript 包管理器,旨在提供 npm 之外的另一种选择方案。Yarn 具有极佳的伸缩性,可以支持成千上万个直接或间接的包依赖。Yarn 的设计初衷是保证稳定性、弹性和高性能。
那么 Yarn 和 npm 有什么不同呢?两者最大的不同在于安装包的方式,Yarn 用到了 lockfiles 和确定性算法。Lockfile 会把安装的包版本进行锁定,保证了 node_modules 目录在不同设备上的安装结果是一致的,同时支持并行操作,大大加快安装进程。此外,Yarn 还声明同时兼容 npm 和 Bower,支持两个仓库混合使用,同时支持包的离线安装(只要你曾经安装过这个包)。
Yarn 1.0 的发布时间是 2017 年 9 月,可点此查看更新内容。
Yarn 1.13.0 源码下载 https://github.com/yarnpkg/yarn/releases/tag/v1.13.0