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

strict engines check is inconsistent with npm #6627

Closed
adanilev opened this issue Nov 2, 2018 · 7 comments
Closed

strict engines check is inconsistent with npm #6627

adanilev opened this issue Nov 2, 2018 · 7 comments
Assignees
Labels

Comments

@adanilev
Copy link

adanilev commented Nov 2, 2018

Do you want to request a feature or report a bug?

  • bug (feature?)

What is the current behavior?

  • Versions of node specified in the engines field in package.json are strictly enforced
  • npm behaviour is different, they allow the packages to be installed
  • This has resulted in non-breaking changes for npm users being breaking changes for yarn users. See: package.json engines, yarn, and semver rules hapijs/hapi#3859
  • Workaround is to use ignore engines in .yarnrc or use yarn --ignore-engines

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?

  • That yarn applies the same level of strictness as npm by default. Perhaps add an option for strict checks and give a warning by default?

Please mention your node.js, yarn and operating system version.

  • macOS 10.13.6
  • yarn 1.9.4
  • npm 6.4.1
  • node v8.10.0
@ghost ghost assigned imsnif Nov 2, 2018
@ghost ghost added the triaged label Nov 2, 2018
@arcanis
Copy link
Member

arcanis commented Nov 2, 2018

This behavior has been in Yarn since its inception (and was actually sold as an improvement over npm). I'm not convinced changing it now would be a good idea.

@pward123
Copy link

pward123 commented Nov 3, 2018

My hope is that most package authors would accurately set the engines field based on the node calls they're making or at least update the minor semver for an engines change. However, some authors only CI test with the latest patch of each major revision of node and don't want to update semver for what is essentially a toolchain change.

Yarn users currently have the options of toss an error on any mismatch or completely ignore all engine values. It would be nice if we had a middle ground here. Either the ability to ignore engines for a specific module or change engine errors to warnings.

@pward123
Copy link

pward123 commented Nov 3, 2018

Just to clarify, in my own case, I am currently working through some CI challenges that prevent me from properly using yarn.lock. Once I get these CI challenges resolved, I don't expect this issue to be a problem.

We already use fixed version numbers in our package.json, but these issues are bleeding in from nested dependencies.

I've tried using the resolutions feature to work around this, but I have dependencies using different major versions of the same package which causes problems.

@pward123
Copy link

pward123 commented Nov 3, 2018

Looks like the soft option was already discussed and discarded here yarnpkg/rfcs#69 (comment)

@rally25rs
Copy link
Contributor

This is by design. Use --ignore-engines to ignore the engines check.

@Unitech
Copy link

Unitech commented Aug 20, 2021

This issue should be re opened, yarn can brake massive amount of build just because an engine field mistake

@arcanis
Copy link
Member

arcanis commented Aug 20, 2021

We don't have this behavior anymore since 2.0, published a year and a half ago 😉

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

No branches or pull requests

6 participants