Hacker News new | ask | show | jobs
by scottmf 3087 days ago
What would you gain by storing the commit in the lock file?

You can reference commits in package.json already.

1 comments

For the purpose of reproducible `node_modules` tree.

Ideally if all packages would use commits, and the installation algorithm will never change, then there will be no need for lock files.

In reality some packages will use NPM existing mechanism, so "git-based algorithm" will need to accommodate for that by reading git repo of the NPM package and referring to a specific commit, which should be store in `package-lock.json`.