How has the left-pad incident been avoided in the future?

Back in 2016, the maintainer of the left-pad package caused chaos by removing it from NPM, resulting in numerous broken builds. Fortunately, NPM intervened and re-published the package before things got too out of hand.

Read more about it here

What measures have been implemented to prevent similar incidents in the future? Have there been any changes in how node_modules files are handled locally or bundled? Has NPM altered their policies regarding open-source collaboration? Is there a push to revise how open-source development operates to address potential issues like this one?

Edit: I originally wanted to spark a broader discussion, but since that may not be suitable for StackOverflow, I have adjusted my query accordingly.

Answer №1

npm Implements Stricter Unpublishing Rules

In a notable incident, the maintainer of left-pad was able to remove the package from npm, causing disruption due to its widespread use in the community.

Following this event on March 23rd, 2016, npm released a detailed post-mortem report outlining their plans for preventing similar issues:

To prevent breakage of other packages, we are implementing stricter measures when it comes to unpublishing versions of packages.

An update was rolled out by npm on March 29th, 2016:

If an unpublished version is older than 24 hours, the attempt will fail and users will be directed to contact [email protected].

More recently, in January 2020, npm announced an even more stringent update, which is still in effect today as outlined in their unpublish policy:

Packages published less than 72 hours ago

Newly published packages can be removed within the first 72 hours provided no other packages depend on them in the registry.

Packages published more than 72 hours ago

For older packages, they can only be unpublished if they meet specific criteria such as no dependencies, low downloads, and being owned by a single maintainer.

This updated policy effectively prevents critical packages like left-pad from being removed abruptly.

npm Protects Against Malicious Package Publishing

Another important change addressed by npm was the prevention of malicious packages being uploaded under abandoned names, a potential security risk that thankfully did not happen with left-pad. This safeguard was put into place following the same incident mentioned earlier in the initial post-mortem report:

If a widely used package is unpublished, npm will replace it with a placeholder package to deter immediate adoption of the name. Interested parties can still obtain the abandoned name by contacting npm support.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Can a web application determine if Microsoft Excel has been installed?

Currently, I am developing a web application using ASP.NET that includes certain functionalities which rely on Microsoft Excel being installed on the user's device. In case Excel is not available, I would prefer to deactivate these features. I am foc ...

The child directive has the ability to interact with every parent directive

I am attempting to create a slider using angularJS. Within this slider, I have implemented a child directive with event listeners. Whenever the main event (mousedown) is triggered, it invokes a function from the parent directive through a controller and up ...

Using discord.js to conveniently set up a guild along with channels that are equipped with custom

When Discord devs introduced this feature, I can't seem to wrap my head around how they intended Discord.GuildManager#create to function. How could they possibly have expected it to work with Discord.GuildCreateOptions#channels[0], for instance, { ...

The function putImageData does not have the capability to render images on the canvas

After breaking down the tileset The tiles still refuse to appear on the <canvas>, although I can see that they are stored in the tileData[] array because it outputs ImageData in the console.log(tileData[1]). $(document).ready(function () { var til ...

displaying a PDF file in Safari

Is there a way to display a PDF document within an HTML page without encountering a missing plugin error? I attempted to use the following code, but the error persists. Interestingly, if I drag the same PDF file directly into my browser, it displays perfe ...

Is there a way to update the version of an npm package in Azure DevOps without causing a new pipeline to be

Our Current Project Automation Utilizing Azure Pipelines (azure-pipelines.yml) for ci/cd automation, we have a configuration segment dedicated to finalizing the project versioning process before publishing to Azure Artifacts. Our goal is to seamlessly upd ...

Discover ways to circumvent using multiple conditions in a switch statement for a solitary object

Receiving an object from the client side in this format: var condition={"bedrooms":"1,2,3,4","Inhibition":"1,6","possession":"3","id":"8",toilets:"1,2",...,} The object must have the same keys and only be a single object, but its length can vary (1/2 ...

Retrieving the values of multiple selected options from various select fields simultaneously

Picture having a dynamic number of select fields (the value of this variable is not fixed). I am looking to extract the values of the selected option from each select field using jQuery (or vanilla JavaScript). This is my approach: var cars = $(".sele ...

Encountered an error in production mode with Angular 7: Uncaught ReferenceError - "environment" variable

During development, my application runs smoothly, and ng build --prod --source-map successfully compiles the application. However, when attempting to access it through the browser, an error occurs: app.module.ts:47 Uncaught ReferenceError: env is not defi ...

Implement a new aggregate function for tooltips in the Kendo chart

I am currently utilizing a kendo chart with a date x-axis. Each point on the graph corresponds to different dates, but the x-axis displays only a monthly view. To showcase the last data point for each month, I have implemented a custom aggregate function a ...

Encountering a problem when looping through a JSON response

After making an Ajax call, I received the JSON response below. studentList: { "currentStudent":0, "totalStudent":11, "studentDetails": [{ "adId":1, "adName":"BMB X5", "sfImage":{ "imageName":"Desert", "image ...

Display search results in Rails without needing to refresh the entire tab

I have a search functionality incorporated within a Bootstrap tab, and I aim to display the search results dynamically without reloading the entire page, specifically within the tab itself. Despite adding 'remote: true' to the form_tag and incor ...

Attempting to activate template rendering with Meteor session

I'm currently facing an issue with Meteor sessions and how my code is triggering the rendering of a template. At the moment, I have a session that sets its ._id to whatever is clicked. Template.sidebar.events({ /* on click of current sidecat class ch ...

The contrast between FormData and jQuery's serialize() method: Exploring the distinctions

Recently I came across a situation where I needed to submit a form using AJAX. While researching the most efficient method, I discovered two popular approaches - some developers were utilizing jQuery#serialize() while others were opting for FormData. Here ...

Issue with displaying marker information on Angular Google Maps

https://i.stack.imgur.com/qUyRo.png I'm in a bit of a pickle trying to figure out how to properly display the information when clicking on a marker. I attempted to include $scope.info in the onClick function, but it still refuses to show up. Could s ...

Steps for creating a JavaScript session expiry notification:

Ensuring user session continuity is essential, especially before it expires. In a recent quest on Stack Overflow, I inquired about detecting a dead session and alerting the user. A solution involving AJAX/JSON was proposed, but it inadvertently kept the s ...

Retrieve the selected date from the date picker widget

Welcome to my custom datepicker! Here is the HTML code: <div class="field-birthday field-return" id="birthday-edit" style="display:none;"> <div class="birthdaypicker"></div> <input class="hidden" name="birthday" type="hidden" ...

Using both PHP and jQuery to add a class upon changing the URL

I am struggling to implement sorting functionality on my webpage, as the active class is not being added to the selected sorting option... Check out my code snippet below: <ul class="nav nav-tabs"> <li class="menusel active" name="hlavni" on ...

Ensure that the form is validated even when setState is not executed immediately

I am currently working on a form in React and I am facing an issue with validation. When the Submit Form button is clicked without filling in the input fields, an error should be displayed. This part is functioning correctly. However, even when the fields ...

How can data be transferred between web pages using jQuery or JavaScript?

Imagine having two different pages on a Classified car website: The first page is the search page, which displays a list of all cars. Check out a sample search page here The second page is the details page, where you can find specific information about a ...