What is package-lock.json?

Is there any kind of teacher who can answer my question above?

FYI I use WebStorm and do with node.js I installed the npm module like nconf and package-lock.json. I was expecting package.json to be created.

Thanks.

+5
source share
2 answers

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 so that subsequent installations can generate the same trees regardless of intermediate dependency updates.

This file is intended for fixing in the source repositories and serves for various purposes:

Describe a single view of the dependency tree so that teams, deployments, and continuous integration ensure that exactly the same dependencies are installed.

To provide users with the ability to "move in time" to the previous state of node_modules without having to fix the directory itself.

To facilitate greater visibility of tree changes using readable versioning differences.

And streamline the installation process by allowing npm to skip re-metadata permissions for previously installed packages.

More info: npm documentation

+5
source

The Package-lock.json file contains the dependencies listed in the package.json file and a specific version of the dependency that must be installed

+1
source

Source: https://habr.com/ru/post/1271157/


All Articles