仍然是许多团队在包管理器上的默认选择。我们对 Yarn 2的面世感到兴奋,它是一次全新的发布,包括大量的更新和改进。除了可用性优化和工作区的改进外,Yarn 2还引入了 zero-installs 的概念,它可以让开发者在克隆项目后直接运行项目。但是,Yarn 2也带来一些破坏性的变化,这让升级过程。而且它默认是(PnP)环境,同时不支持 React Native PnP 环境。当然,团队可以选择退出 PnP 环境,或者停留在 Yarn 1。但他们应该意识到,Yarn 1目前已经处于维护模式。
is a fast, reliable and secured package manager for JavaScript. Using a lock file and a deterministic algorithm, Yarn is able to guarantee that an installation that worked on one system will work exactly the same way on any other system. By efficiently queuing up requests, Yarn maximizes network utilization and as a result we’ve seen faster package downloads. Yarn continues to be our tool of choice for JavaScript package management in spite of the latest improvements in npm (version 5).
is a new package manager that replaces the existing workflow for the npm client while remaining compatible with the npm registry. With the npm client, we may end up with a different tree structure under node_modules based on the order that dependencies are installed. This nondeterministic nature can cause "works on my machine" problems. By breaking the installation steps into resolution, fetching and linking, Yarn avoids these issues using deterministic algorithms and lockfiles and thus guarantees repeatable installations. We've also seen significantly faster builds in our continuous integration (CI) environment because of Yarn caching all the packages it downloads.
is a new package manager that replaces the existing workflow for the npm client while remaining compatible with the npm registry. With the npm client, we may end up with a different tree structure under node_modules based on the order that dependencies are installed. This nondeterministic nature can cause "works on my machine" problems. By breaking the installation steps into resolution, fetching and linking, Yarn avoids these issues using deterministic algorithms and lockfiles and thus guarantees repeatable installations. We've also seen significantly faster builds in our continuous integration (CI) environment because of Yarn caching all the packages it downloads.