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

yarn berry not check engines.node when do yarn run script? #4991

Closed
zyf0330 opened this issue Oct 27, 2022 · 3 comments
Closed

yarn berry not check engines.node when do yarn run script? #4991

zyf0330 opened this issue Oct 27, 2022 · 3 comments

Comments

@zyf0330
Copy link

zyf0330 commented Oct 27, 2022

I use yarn version 3.2.0 and node v16.17.0, and has package.json like this

...
  "scripts": {
    "e": "which node ",
},
  "engines": {
    "yarn": ">=3.2.0",
    "node": ">=14.0.0 <=14.18.1",
    "npm": "use yarn"
  },
...

When I run yarn run e, I expect that yarn gives an error because of bad node version, but it doesn't.
So when engines.node is effect?

@merceyz merceyz transferred this issue from yarnpkg/yarn Oct 27, 2022
@jj811208
Copy link
Contributor

jj811208 commented Oct 27, 2022

As far as I know yarn berry core does not handle engines of package.json, However, there are some third-party plugins that provide this

see: #1177

@merceyz
Copy link
Member

merceyz commented Oct 27, 2022

See #1177

@merceyz merceyz closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2022
@hanseltime
Copy link

I'd like to suggest that this is added to the core yarnpkg. On the grounds that this:

  1. is baseline functionality that was depended on in yarn 1 and is implicitly expected by any developer performing the migration
  2. can actually affect the implementation of node packages that do binary compilation (and even more so with plug and play). This will degrade the usefulness of the package manager as engines continue to upgrade into the future.

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

No branches or pull requests

4 participants