Versions and dependencies
Read version ranges
Predict which releases satisfy caret, tilde, exact, comparison, tag, and prerelease specifications.
9 minute lesson
Start from the behavior you can observe. The package deliberately allows compatible patch and minor updates for one dependency while pinning a fragile build tool.
A dependency range is an update policy encoded in the manifest, not a decorative prefix. The useful target is not encyclopedic coverage. Make one deliberate choice, observe its consequences, and know which requirement would make you revise it.
It is tempting to copy ranges without checking what future versions they admit. That trades a clear decision for an assumption you will eventually have to debug. The stronger move is to expand each important range into its actual lower and upper bounds and choose it from compatibility risk. Make the boundary explicit in code and in the project notes.
Tie the decision back to the larger job: Make dependency and version choices that communicate compatibility rather than merely making installation succeed. Record enough evidence that another developer can repeat the result without relying on your memory.
Use npm tooling to test candidate versions against several ranges, including a zero-major and a prerelease. Repeat it once with an invalid or hostile condition and write down the boundary the failure revealed.
Lesson completed