-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Add note about using EOL release versions #6913
Comments
This could also help conscientious maintenance engineers make the case to their managers that they need to invest the time to upgrade to a new node version, or at least to do the work required to stay protected if they're not going to. |
I’m personally not in agreement with pinning version as a strategy because users would still be exposed to nested dependency changes. In fact, the only solution is for maintainers to bump the major when dropping a supported engine. |
This is incorrect. It does protect against nested dependency changes, because npm prioritizes selecting versions that do not have an engines mismatch. The only case where it would be a problem is if a transitive dependency restricts its engines, but the direct dependency does not, then the direct dep starts requiring the new transitive dep, and you install the new version of the direct dependency. But if you're not updating anything (because you're pinning deps) then this can't happen. For library authors, you can solve the problem by setting |
Welp, apparently I'm wrong about that. It's not properly prioritizing engine matches over mismatches when it should result in a lower version number being selected. That's confusing, because the code has been there for a long time to do this, but apparently it's busted or being overridden or something. |
Indeed, if npm worked that way, then dropping engine support wouldn't be a semver-major. |
Ah, it's this bug, that I tried to fix 3 years ago: npm/npm-pick-manifest#33 |
@isaacs should we still make a PR to apply the patch from the opening post? Sorry I didn't get if the comments here resolved the initial concerns or not 🤔 |
@ovflowd Because of the npm-pick-manifest issue I linked to, the advice is not as complete as I'd thought. Ie, when I told @mcollina he was incorrect, I was in fact the incorrect one. (I was correct about the intended design of the code in question, but it has a bug that has not been fixed.) It is still enough for app devs to lock down or vendor their dependencies, assuming they're very careful about all updates from that point forward, but it's not as trivial as it should be to avoid engine mismatches. If someone wants to open a PR with the patch I presented here, that's of course fine with me. |
Wouldn't using a lockfile be a better strategy than pinning deps? I doesn't help libraries, but the patch clearly mentions "application". |
I think this can be closed. |
Enter your suggestions in details:
I can't send a PR, because GitHub thinks I already have a fork. (Perhaps this was originally mine from back in the day? I'm not sure.)
Here's the patch, which can be landed with
git am
: https://gist.github.com/isaacs/47ced4e0fa13469b847dbfa19bd376a4The text was updated successfully, but these errors were encountered: