This Tuesday, the 22nd, thousands were faced with broken builds and installations due to the removal of more than 250 modules from NPM, including the extremely widely used 11-line module, left-pad. Just hours ago, Azer Koçulu removed over 250 of his modules from NPM, i.e. Node Package Manager, used for installing dependencies for Node projects.

Apparently one of Koçulu's modules, kik, received attention from the lawyers of an instant messaging app, also called Kik. Since the app and the Node module lie in totally different fields of interest, naturally Koçulu refused to take down the module. The next step from Kik's lawyers was to contact NPM's administrators, claiming brand infringement. When NPM obliged and took down the module, Koçulu responded by taking down all of his code, which ammounted to over 250 modules.

Koçulu published some of his thoughts on the matter on his blog:

NPM is no longer a place that I’ll share my open source work at, so, I’ve just unpublished all my modules.
This is not a knee-jerk action. I love open source and believe that open source community will eventually create a truly free alternative for NPM.

One of those 250 modules which was removed was left-pad, a simple 11-line piece of code for padding-out the lefthand-side of strings with zeroes or spaces. This module, shown below, was depended-upon by thousands of projects including Node and Babel, and had had 2,486,696 downloads world-wide in just the last month.

module.exports = leftpad;
function leftpad (str, len, ch) {
  str = String(str);
  var i = -1;
  if (!ch && ch !== 0) ch = ' ';
  len = len - str.length;
  while (++i < len) {
    str = ch + str;
  return str;

Thousands world-wide have been left with error message like this:

npm ERR! 404 Registry returned 404 for GET on
npm ERR! 404 
npm ERR! 404 'left-pad' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)

In attempt to solve the issue, CTO and cofounder of NPM, Laurie Voss, chose to restore the unpublished left-pad module 0.0.3 which so many apps depended on without the consent of the developer. Voss issued the following statement:

Un-un-publishing is an unprecedented action that we're taking given the severity and widespread nature of breakage, and isn't done lightly.
This action puts the wider interests of the community of NPM users at odds with the wishes of one author; we picked the needs of the many. This whole situation sucks. We will be carefully considering the issues raised by and publishing a post-mortem later.
In the meantime, several thousand open source projects have been repaired, and I'm sleeping fine tonight.

A new maintainer has stepped forward to look after the restored module, and the original work by Koçulu is available on his GitHub account. If your code still won't build after the left-pad revival, try the following command:

npm cache clear