Day 10
passedpricebook 1.4.2
The build installs, tests and ships.
Module 42 · Dependencies
Most of an app is packages other people wrote, stacked on each other. Here you install Larkspur’s shop app from a made-up registry, pull crates out of its tower, and pick how it takes updates.
The whole idea in one example
pricebook 1.4.2
The build installs, tests and ships.
pricebook 1.4.3
A new patch slipped in through a caret range. Nobody changed a line.
Every package, version and day here is fictional, from a registry written for this module.
How it works
Name 5, get the ones they need too
The same ranges install newer releases a week later
npm’s version-range rules expand ^1.2.3 to >=1.2.3 <2.0.0, ^0.2.3 to >=0.2.3 <0.3.0, and ~1.2.3 to >=1.2.3 <1.3.0.
Source, checked 30 October 2026
Installs repeat until a tested update moves it
npm’s docs say its lockfile describes the exact tree installed, so later installs can build identical trees whatever new releases come out in between, and it is meant to be saved with the code.
Source, checked 30 October 2026
Pins and scripts off miss it; the lockfile keeps it out
npm’s write-up says an attacker took over maintainership of event-stream and, on 9 September 2018, added a dependency, flatmap-stream, whose version 0.1.1 hid code aimed at a bitcoin wallet app; it was reported on 26 November 2018.
Source, checked 28 October 2026
The story
Larkspur’s shop app pulls in packages it did not write; one morning its build breaks without a code change, and the team learns that a range lets updates in and the lockfile decides when. You’re on the team that owns the shop’s build.
Your path



Chapter 3 · done
What happens when two packages need different versions of one?




Anyone whose product ships code it did not write, which is nearly everyone, and who wants to know why a build breaks overnight and what a lockfile, the list of exact versions, is for. Git covers history and merging; this module covers versions and how an install picks them.