-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yarn handling of unpublished packages in lock files #6694
Comments
Not that I'm aware of. I believe there are simply a lot of people using har-validator as a N-level dependency (usually through |
Anyone running Unpublishing is imo a last-resort weapon that should never be used for simply patching bugs (which fixing the Node compatibility is), especially if your package has 35M downloads per month. It's almost guaranteed to cause pain to your users. |
Is yarn doing anything different than npm here? In npm, removing the package-lock.json file and re-running I think the reason that more yarn users complained in that thread is because only instructions to fix the issue in npm were posted (no one posted "delete yarn.lock and run Users complaining that the issue only suddenly popped up days/weeks after the har-validator versions were unpublished probably installed har-validator 5.1.1/5.1.2 back while they were still published, had the lockfile generated with one of those versions, had those versions cached on their machine, and only ran into the issue when trying to install the dependencies on a new machine (ie. many of the users in the thread talk about CI systems or heroku) or locally after their local cache was wiped. I'm not sure there's any evidence that har-validator 5.1.1/5.1.2 was added into anyone's lockfiles after they were unpublished. (I just tested publishing a new version of a package, unpublishing the latest version, and then checking that |
I'm the maintainer of
har-vlidator
which is a direct dependency ofrequest
(and hence exists as an upstream dependency to many many packages, including yarn itself and npm cli!)I un-published two versions from the npm registry, namely:
5.1.1
,5.1.2
to remedy the backward support for Node <= 6 and browsers.Details of what lead to un-publishing
Last week, during a maintenance and clean up cycle, I updated a bunch of packages I maintain, to remove security warnings through bumping upstream dependencies.
The relevant change was
[email protected]
to[email protected]
. which was published under[email protected]
🔍 ahmadnassri/node-har-validator@v5.1.0...v5.1.1#diff-b9cfc7f2cdf78a7f4b91a753d10865a2L43
according to the AJV docs, the major version bump was mainly an API change, and their docs still indicated support for "browsers and Node.js 0.10-8.x" (at the time of writing, this is still the case)_ and changelogs didn't indicate dropping support for Node <= 6 which is where the problems started.
dropping support lead to issues for downstream libraries including
request
and (specifically in compiling for browsers)so, I made the decision to un-publish the released versions, namely:
5.1.1
,5.1.2
to remedy the backward support for Node <= 6 and browsers.Reports started coming in, people seem to be having problems with their install step failing due to yarn looking for a
404
package version.From my understanding: This means the
yarn.lock
for downstream users must have been updated to point at new version, which must be a user action! How else would downstream apps seem to be looking for5.1.2
specifically?so users must have manually executed
yarn upgrade
?however, the indication from the community is that they didn't touch their lock files and installs "suddenly" stopped working.
I don't think there is a bug here, but I do think there is potentially mis-alignment and mis-communication on the workflows and documentation as it relates to lock files. so I'm concerned with both the install / add behavior and documentation relating to lock files and dependency pinning.
also, I'm not certain if there is some workflow path that lock files are somehow updated without the user specifically taking action?
What's more puzzling: while
har-validator
is a dependency of many packages, onlyrequest
is the connection to all the problems reported and all the downstream issues discussed.and
request
is still pointing to~5.1.0
so how come people's install steps are looking for newer versions ofhar-validator
?so the problem must be only limited to people who initiated a new project between the publishing and and un-publishing events however, that doesn't seem to be the case from the conversations and issues surfaced.
I'm tempted to just release a
5.1.2
and5.1.1
duplicates of5.1.0
to stop the noise. but honestly, I'm baffled to how broken the yarn process is here and how badly lock files are misunderstood! and most importantly this doesn't address the vuln / security warnings people are getting from deep nested dependencies.The Question:
I'm looking for guidance here on what / why and how un-publishing a package and communicating back the community needs to look like.
as dependency management tooling, Yarn could provide a more seamless path to deal with 404 on a deep dependency buried in
yarn.lock
(vs. a direct dependency in yourpackage.json
)References:
Affected Packages (that I've been linked to)
on un-publishing packages
several people have pointed out best practices / ideas / opinions on why un-publishing packages should not be allowed, but it is, and it is part of the registry workflow and therefor a valid and legitimate step to take for package maintainers as they see fit.
we can debate opinions about best practices, but I think that's beside the point.
I do not think I've done anything technically wrong in un-publishing, and if I have, I would love to learn "why" without waving into opinions on versioning and best practices.
not to devalue a discussion on best practices, I very much welcome such a discussion, but wanted to keep the context here to any technical challenge to yarn.
yarn vs. npm
this topic can equally be opened with
npm cli
, however, most of the reporters and people with issues areyarn
users, so I decided to post it here.thank you all for your help!
The text was updated successfully, but these errors were encountered: