P-2.5 Dependencies and Reproducible Environments
You can add a third-party library to a project, pin its version so a colleague gets the same one, and explain why a project that works on your machine fails on another.
It works on my machine is not a joke about carelessness, it is what happens when the set of installed libraries is part of the program and nobody wrote it down. This topic is about writing it down: manifests, lock files, isolated environments and version ranges. The idea that takes longest to land is that a version range is a promise about compatibility that the library author might break.
Work through these
A package manager, a manifest and a lock file
The manifest records what your project asked for and the lock file records exactly what it got, down to the version. Committing the second is what makes an install reproducible.
Isolated environments: keeping one project's libraries out of another's
Two projects on one machine often need different versions of the same library, and installing everything globally guarantees that one of them breaks. Isolation per project is the standard answer in every language.
Version numbers, ranges, and what a compatible update is meant to promise
A version number is a statement about compatibility, so accepting a range means trusting authors to keep that promise. They usually do and occasionally do not, which is exactly why the lock file exists.
Deciding whether to add a dependency at all
Every library added is code you did not write, must update, and are exposed to. For genuinely small problems the honest comparison is against twenty lines of your own.
Reproduce your project from nothing on a clean machine
Clone the repository somewhere fresh, follow only what is written down, and see whether it runs. Whatever you had to remember rather than read is the documentation that is missing.
Sign in to keep your progress.
Free resources
Links last checked 31 Aug 2026.
Stuck here?
Ask a mentor. A real person answers, and they can see exactly which topic you're on. Usually within a couple of working days.
Checking your session…
Topics shown in module order.