yarn.lock文件

原文地址:https://blog.csdn.net/mangoyiy/article/details/79972759

Yarn是一个快速可靠安全的依赖管理工具。
主要的三个特点:

极其快速,Yarn会缓存它下载的每个包,所以无需重复下载。它还能并行化操作以最大化资源利用率。
特别安全,Yarn会在每个安装包被执行前校验其完整性
超级可靠, Yarn使用格式详尽而又简洁的lockfile文件和确定性算法来安装依赖,能够保证在一个系统上的运行的安装过程也会以同样的方式运行在其他系统上

关于yarn.lock文件,官网的解释如下:

Managed by Yarn
Your yarn.lock file is auto-generated and should be handled entirely by Yarn. As you add/upgrade/remove dependencies with the Yarn CLI, it will automatically update your yarn.lock file. Do not edit this file directly as it is easy to break something.

Current package only
During install Yarn will only use the top-level yarn.lock file and will ignore any yarn.lock files that exist within dependencies. The top-level yarn.lock file includes everything Yarn needs to lock the versions of all packages in the entire dependency tree.

yarn.lock的具体的作用是什么?它能给项目带来什么作用?

Yarn使用确定性算法,在将文件放置到需要的位置之前构建整个依赖关系树。安装过程中重要信息存储到yarn.lock文件中,以便可以在安装依赖关系的每个系统之间共享!此文件包含有关已安装的每个依赖项的确切版本的信息以及代码的校验和以确保代码完全相同。
此文件会锁定你安装的每个依赖项的版本,这可以确保你不会意外获得不良依赖;
并且会避免由于开发人员意外更改或则更新版本,而导致糟糕的情况!

原文地址:https://www.cnblogs.com/panpanwelcome/p/12564464.html