[英]Do I still need a package-lock.json if I am not using caret(^) or tilde(~) in my package.json?
If I am always using definite versions of packages inside my package.json, what is the need of package-lock.json. 如果我总是在package.json中使用明确版本的包,那么package-lock.json的需求是什么。 Or other way to put this question is , If someone wants to use package-lock.json, why can't they just use definite versions of packages(1.2.3 and not ^1.2.3) inside package.json.
或者提出这个问题的其他方法是,如果有人想使用package-lock.json,为什么他们不能在package.json中使用明确版本的包(1.2.3而不是^ 1.2.3)。
The use of package-lock.json
optimize the installation process because the full dependency tree is already calculated : package-lock.json
的使用优化了安装过程,因为已经计算了完整的依赖关系树:
optimize the installation process by allowing npm to skip repeated metadata resolutions for previously-installed packages.
通过允许npm跳过以前安装的包的重复元数据解析来优化安装过程。 doc
DOC
And as @imjared mentionned, definite versions of package can still have dependencies on caret versions. 正如@imjared所提到的,包的确定版本仍然可以依赖于插入符号版本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.