What a yank does not do
It does not remove an artifact that is already installed, and it does not fix a running box. It changes what future resolves pick. Existing deployments need their own migration.
Sometimes a release has to be withdrawn: it has a bug that cannot be fixed without breaking the contract. Semantic versioning has a word for that, yanked, meaning 'this version exists in history but must not be resolved'. The point is to make the withdrawal visible, not to delete it.
About 1 min of reading
Yank a version and watch the resolver skip it
Tag the bad release
Before you run it, say out loud what it will print. Then open the answer.
Record the yank
Before you run it, say out loud what it will print. Then open the answer.
Resolve with the yank in place
Before you run it, say out loud what it will print. Then open the answer.
Check no pointer moved back
Before you run it, say out loud what it will print. Then open the answer.
It does not remove an artifact that is already installed, and it does not fix a running box. It changes what future resolves pick. Existing deployments need their own migration.
If you can ship a version that works, ship it and yank the bad one. Yank alone only when there is no working version to point at.
Deleting a release from a registry leaves consumers with a version they cannot re-fetch and a build that will not resolve. Marking it yanked keeps the history and fails the resolve with a clear message.
A range >=1.4.0,<2.0.0 with 1.4.3 yanked resolves to the highest non-yanked version. Consumers get a working version and a log line saying one was skipped.
The yank carries a reason string. That string is what a reader needs six months later to know whether the fix landed in 1.4.4 or whether they must change code.
Each one is defined here on this site. Open the entry for the full definition and the other words it points at.