🛠️Lockfile
Also known as Lock File, package-lock.json, Dependency Lock File, poetry.lock
A file that lists the exact version of each package you use. You keep it in Git.
Think of it like
It is like a photo of a toy you built. Anyone can build it again with the same bricks.
Example
Lucy's app works on her laptop but breaks on the server. The server had no lockfile, so it installed newer versions.
Why it matters
It stops the classic bug where it works on one computer but not another. Every install gets the same code.
Definition
Example code
console
$ npm ciCommon mistake
Key takeaways
- 1Exact versions. Every package, down to the last one.
- 2Written for you. The package manager keeps it current.
- 3Commit it. So every computer installs the same code.