Do I commit the package-lock.json file created by

2019-01-04 04:24发布

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.

7条回答
唯我独甜
2楼-- · 2019-01-04 05:20

You can check the npm's official docs.

Yes, you can commit this file. 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.

查看更多
登录 后发表回答