npm 5 was released today and one of the new features include deterministic installs with the creation of a package-lock.json
file.
Is this file supposed to be kept in source control?
I'm assuming it's similar to yarn.lock
and composer.lock
, both of which are supposed to be kept in source control.
You can check the npm's official docs.
Yes, you can commit this file.
package-lock.json
is automatically generated for any operations wherenpm
modifies either thenode_modules
tree, orpackage.json
. It describes the exact tree that was generated, such that subsequent installs are able to generate identical trees, regardless of intermediate dependency updates.