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

Soft Engines Check #69

Closed
wants to merge 1 commit into from
Closed

Soft Engines Check #69

wants to merge 1 commit into from

Conversation

gsklee
Copy link

@gsklee gsklee commented Jun 14, 2017

See here.

Copy link

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the proper default; thanks!

@sebmck
Copy link

sebmck commented Jun 14, 2017

We specifically chose a strict engine check with Yarn to encourage the ecosystem to properly use the engines field. Relaxing this would make the engines field useless and encourage already rampant misuse of it.

This justification in this RFC for relaxing this is mostly "npm doesn't do this and have deprecated it". Obviously we aren't adherent to the changes of npm and we deliberately deviated.

@samccone
Copy link
Member

samccone commented Jun 14, 2017

When this was initially discussed, (throwing a hard warning on engine mismatch) we knew it was going to cause some friction, however we also hypothesized that it would greatly help the community to actually use the engine field. (much like the npm licence bot that went through and updated the license field in package.json)


Take for instance the following real world example:

If you want to ship a package that will not work with an older version of node, it is quite hard, especially if you want to use new syntax like await / async or arrow functions (since they will throw quite odd errors at runtime to the user). One example of this is jsdom, a very popular library that dropped older node support a while ago. Even though mainline jsdom did not work with older node, if someone on an earlier version of node would install it, it would install and then raise an exception at runtime :(. With yarn, the dependency refuses to install on engine mismatch \o/.


To the point about 1 bad dependency causing you to use the ignore-engine flag, that is by design, you (the developer) are being explicit that you are opting out of the check for a reason and assuming the risk. And to the point about this making the entire feature not valuable, I would say that using the flag is infact what npm is doing already, however is doing in a non-explicit (and unexpected) way.

@gsklee
Copy link
Author

gsklee commented Jun 15, 2017

I'm convinced. Thanks for the inputs guys 👍

@bestander
Copy link
Member

Thanks, @gsklee, for leading the conversation and cleaning up the tasks, much appreciated.

@hutson
Copy link

hutson commented Jun 15, 2017

Could this behavior be communicated to the community via Yarn's blog? (Similar to the excellent blog post on the differences in the deterministic behavior of each package manager)

Also, if it's alright with the core team, could @gsklee submit an RFC that documents this behavior? I'd like to be able to point others to a spec.

@bestander
Copy link
Member

+1 on documentation or a blog post.
Anyone can to send PRs with blog posts or documentation changes, they are always welcome.

@gsklee
Copy link
Author

gsklee commented Jun 15, 2017

I can write a post on this if @kittens or @samccone are not able to find the time to do it.

@bestander
Copy link
Member

bestander commented Jun 15, 2017 via email

@havenchyk
Copy link

sorry for asking here, but is there a way to check the yarn version that the team members use for development (and fail on e.g. yarn start)? I thought engine will help, but it didn't

@samccone
Copy link
Member

@havenchyk this seems like an interesting feature, mind creating another rfc?

@rattrayalex-stripe
Copy link

@havenchyk @samccone was another RFC created? can it be linked here? I too would like that feature

@havenchyk
Copy link

@rattrayalex-stripe nope, it wasn't. Still on my todo list, but if you would like, take care of it

@BorntraegerMarc
Copy link

Could yarn at least log which module is causing the error? I'm just getting the error

error @angular/cli@1.2.4: The engine "node" is incompatible with this module. Expected version ">= 6.9.0".
error Found incompatible module

in my package.json I have exactly:

    "engines": {
        "node": ">= 6.9.0",
        "npm": ">= 3.0.0"
    },

So I don't know who/what is causing the error...

@hutson
Copy link

hutson commented Jul 26, 2017

@BorntraegerMarc please run node --version to see which Node version you have installed.

@BorntraegerMarc
Copy link

@hbetts ah that explains it. Version v6.1.0 was installed. OK maybe just a better error message if the actual host is mismatching 😄

jakeNiemiec added a commit to rails/webpacker that referenced this pull request Feb 10, 2020
Yarn enforces strict engine testing yarnpkg/rfcs#69 (comment) so this manifests as an error rather than a warning.
@MrCoder
Copy link

MrCoder commented Jul 5, 2020

Can we include a message like "use --ignore-engines to bypass engines check"?

KingTiger001 added a commit to KingTiger001/Rails-web-pack-project that referenced this pull request Jan 15, 2023
Yarn enforces strict engine testing yarnpkg/rfcs#69 (comment) so this manifests as an error rather than a warning.
smartech7 pushed a commit to smartech7/ruby-webpacker that referenced this pull request Aug 4, 2023
Yarn enforces strict engine testing yarnpkg/rfcs#69 (comment) so this manifests as an error rather than a warning.
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants