node.js - 什么是 package-lock.json?

标签 node.js npm webstorm web-project nconf

有哪位好心的老师可以回答我上面的问题吗?

仅供引用,我正在使用 WebStorm 并使用 node.js 制作 我安装了像 nconf 和 package-lock.json 这样的 npm 模块。 我预计 package.json 会被制作出来。

谢谢。

最佳答案

描述给定时刻的依赖关系树,因此通过此描述,可以完全按照原来的方式再次创建所有依赖关系,这确保了依赖关系的预期行为。

npm documentation你可以阅读:

package-lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json. It describes the exact tree that was generated, such that subsequent installs are able to generate identical trees, regardless of intermediate dependency updates.

This file is intended to be committed into source repositories, and serves various purposes:

Describe a single representation of a dependency tree such that teammates, deployments, and continuous integration are guaranteed to install exactly the same dependencies.

Provide a facility for users to "time-travel" to previous states of node_modules without having to commit the directory itself.

To facilitate greater visibility of tree changes through readable source control diffs.

And optimize the installation process by allowing npm to skip repeated metadata resolutions for previously-installed packages.

关于node.js - 什么是 package-lock.json?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45841596/

相关文章:

javascript - Expressjs 将用户重定向到错误的路线

javascript - Windows 上 npm 运行脚本错误

npm - 可以使用 pnpm 仅使用一个软件包版本吗?

javascript - png 文件直接打开 html 文件时无法加载,但从 webstorm 打开时会加载

dart - WebStorm 11 EAP- Dart 单元测试抛出错误

node.js - Redux - 通过键在状态数组中查找对象并更新其另一个键

performance - Loggly 的最大吞吐量是多少?

npm - 将 Gatsby v4 升级到 v5

php - Webstorm 不会在 Chrome 中调试 .php 文件

node.js - 如何在 React 应用程序中使用 promise 的功能