DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk3 min

Left-pad Incident Explained: How 11 Lines of JavaScript Disrupted npm

In March 2016, an unpublished version of left-pad triggered widespread npm installation failures through transitive dependency chains. Here’s what happened and why a replacement version could not immediately fix it.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

On March 22, 2016, npm experienced widespread installation failures after the tiny JavaScript package left-pad was abruptly unpublished. Projects including Babel and Atom were affected through dependency chains—not necessarily because they depended on left-pad directly. npm reported that the disruption lasted 2.5 hours and later restored the missing version.

What happened in the left-pad incident?

The incident began with a dispute over the unscoped npm package name kik between its maintainer, Azer Koçulu, and the company Kik. npm says it applied its package-name dispute policy by deciding Kik should maintain that name. Its usual approach at the time was to leave existing package versions available to projects that depended on them.

As an Amazon Associate I earn from qualifying purchases.

Koçulu responded by unpublishing kik and 272 other packages, including left-pad. Shortly after 2:30 p.m. Pacific Time on Tuesday, March 22, npm observed hundreds of failures per minute as projects requested the now-missing dependency. npm described the impact as affecting many thousands of projects, not as a precise project count. npm’s March 23, 2016 postmortem said: “It was abrupt unpublishing, not our resolution policy, that led to yesterday’s disruptions.”

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why did left-pad break Babel and other projects?

The package was small, but its position in dependency chains gave it a much wider reach than its size suggested. A project can depend on a library that depends on another library, which in turn requests a small utility. If that utility disappears, installations can fail even when the top-level project never named it.

Direct and transitive dependencies

A direct dependency is listed by a project itself. A transitive dependency is brought in by one of its dependencies. npm cited Babel and Atom as examples of projects whose chains included line-numbers, which explicitly requested left-pad version 0.0.3. The failure therefore spread through dependencies rather than requiring every affected project to use left-pad directly.

Why a new version did not fix existing requests

Cameron Westland published a functionally identical replacement as [email protected] within ten minutes. But line-numbers requested 0.0.3, and a request for that specific version is not satisfied by publishing a different version. The package’s code could be replaced quickly; the exact version expected by dependent projects was still absent.

How npm restored service

npm used a backup to restore the original [email protected]. It announced that plan at 4:05 p.m. Pacific Time and reported the restoration complete by 4:55 p.m. The postmortem gave the disruption’s total duration as 2.5 hours.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

npm also acknowledged its role in the platform’s vulnerability: “We dropped the ball in not protecting you from a disruption caused by unrestricted unpublishing.” The incident was not evidence that the entire registry went offline; npm described widespread failures when installations requested an unpublished dependency.

What left-pad did—and what to use instead

left-pad was a string-padding utility: it added characters to the beginning of a string until it reached a target width, such as filling with spaces or zeroes. Its archived, read-only repository labels the package deprecated and recommends the native JavaScript method String.prototype.padStart(). That repository guidance makes padStart() the appropriate starting point for new code rather than adopting the archived package.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What the incident teaches about dependencies

  • Small packages can have outsized effects. A minimal utility can become part of many projects’ installation paths through transitive dependencies.
  • Version requirements matter. A replacement published under a new version does not automatically satisfy consumers that request an older version.
  • Removal and ownership are different issues. npm said its naming-policy decision would ordinarily leave existing versions available; the abrupt unpublishing removed the version requested by dependent projects.
  • Registries are part of software reliability. Developers rely not only on package code but also on the continued availability of the versions their dependency chains request.

The policy details discussed in npm’s 2016 postmortem are historical, not a description of today’s rules. npm’s March 29, 2016 unpublish-policy announcement states that the policy was updated on January 30, 2020; it should not be treated as the current policy without consulting npm’s current documentation.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.