Skip to content
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

Remove "engines" fields from all package.json files for improved backwards compatibility with unmaintained package managers #4130

Open
jacobp100 opened this issue Jun 12, 2024 · 4 comments

Comments

@jacobp100
Copy link

Is it possible to better support Yarn v1?

I speak from having the exact same experience at my last 6 or 7 companies: they don't want to use NPM because it has a lot of bugs throughout the versions. They all use Yarn 1, and almost all of them also faced this Yarn bug stopping them running yarn add. Everyone who did face it just ignores it by manually adding packages to the package.json, then running yarn. There is no appetite for upgrading to yarn 3

The docs suggest yarn add sharp --ignore-engines. As mentioned earlier, yarn add doesn't work for a lot of people

Happy to help out if some context is provided why yarn 3 was put as the minimum version

(Node v20.11.0)

@lovell
Copy link
Owner

lovell commented Jun 12, 2024

Please ensure you've read and understood #3750 for context.

I continue to recommend that those who wish to use yarn as their package manager should upgrade to its latest version. https://mastodon.social/@lovell/111726943907221407

("They all use Yarn 1, and almost all of them also faced this Yarn bug" and "they don't want to use NPM because it has a lot of bugs" is quite the juxtaposition 😅 .)

@jacobp100
Copy link
Author

Thanks for the fast reply 😄 I certainly remember NPM issues like packages magically updating themselves when you install new packages, and it was never really possible to stop it happening. I will say I never questioned why people use yarn since I prefer it anyway. To emphasise, I didn't set up Yarn 1 at these companies, that's what they were using before I joined. I was contracting for quite a few years, I've only seen one company using something other than Yarn 1 since 2015. It's still really popular in industry. I think the reality is Yarn is facing it's Python 3 moment, and I'd be surprised if it wasn't the same situation in a decade 😅

I did find and read that PR via git blame etc. - but I can't really work out why the version is set to 3. It seems like it works with yarn 1 - as long as that flag is provided - and the only issue is that the minimum engine is set higher than it needs to be. At least locally, I only have the binaries that are strictly necessary. What are the actual issues stopping the engine requirement being lower?

@lovell
Copy link
Owner

lovell commented Jun 13, 2024

I did a quick search for the sort of error message that yarn v1 users might see to assess the impact:

https://github.com/search?q=%22The+engine+glibc+appears+to+be+invalid%22&type=issues

Clearly this is causing some pain for other open source maintainers, so for that reason let's see what we can do.

I think the easiest thing to do is remove the engines field entirely (we'll need to move the glibc and macos keys somewhere else) and update the docs. Leave this with me.

I'm still of the opinion that the sooner someone presses the official end-of-life button on yarn v1, the better. The maintainers of the official Node Docker images are considering removing it - see nodejs/docker-node#1979

@lovell lovell changed the title Support Yarn V1 Remove "engines" fields from all package.json files for improved backwards compatibility with unmaintained package managers Jun 13, 2024
lovell added a commit to lovell/sharp-libvips that referenced this issue Jun 13, 2024
@lovell
Copy link
Owner

lovell commented Jun 13, 2024

Work-in-progress for this is at 7146a9c but it will depend on lovell/sharp-libvips@459b35f and newer, not-yet-published versions of the @img/sharp-libvips-* packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants