Lock File
PronunciationLOK fyl
Definition
A lock file records the exact version of every installed dependency, including indirect ones, so everyone installs identical packages.
Where you hear it
In package-lock.json, poetry.lock and uv.lock, in deployment pipelines, and in "works on my machine" investigations.
Examples
Commit the lock file so the server installs the same versions.
The build broke after a new release; the lock file would have prevented it.
The lock file pins requests to 2.31.0, so the build installs the same version as yesterday.
Common mistake
Editing it by hand or ignoring it in git. It is generated by the tool and should be committed.
Don't confuse with
requirements.txt with loose versions, which allows different installs over time. A lock file removes that freedom.
Say it at work
- In a meeting or chat
Regenerate the lock file after changing dependencies.
- In an email or ticket
CI installs strictly from the lock file.
Keep exploring
More in DevOps & Cloud