Carrying on from this earlier question What is the role of the package-lock.json?
We make regular use of package-lock.json
to pin our package versions (and to audit which registry they resolved from, as we use a private one).
As part of our CI/CD process, this has been a practice for many years. Now however, we've started to publish our own NPM packages - and a senior engineer is stating that "there's no value in using package-lock.json
for libraries".
Their explanation was, that when included in another app's package.json
that app will only use the semvar from the published package's own package.json
, and the lock file is completely ignored / unused.
- Is this really the case?
- We fairly frequently encounter package changes that break semvar (not sure if this is because we develop and build on different platforms, or if the non-locked dependency chain has a semvar range that isn't pinned)? If our
package.json
versions are already pinned, are there other ways to avoid that? - Is there still value in using the lock file for packages (even if it's to dual-build the app to detect drift)?