-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
How to handle invalid engines #1102
Comments
I don't think we should suppress this. Atom is quite new so existing libraries should update themselves to remove the |
I'm confused. Atom uses the |
I guess this calls into question about why we report on invalid versions. cc @samccone |
This seems like an abuse of engines according to npm docs.
{ "engines" : { "node" : ">=0.10.3 <0.12" } } If you specify an "engines" field, then npm will require that "node" be somewhere on that list. If "engines" is omitted, then npm will just assume that it works on node. You can also use the "engines" field to specify which versions of npm are capable of properly installing your program. |
Seems to be pretty baked into Atom: |
Via the npm/doc/misc/npm-developers.md
That wording was added in 2010 when the documentation was written. |
I did however had to add the ignoring of the engines (`--ignore-engines`) since the communibase DEV depedency has "weird" engine specifications.. Yarn will probably lax the check soon (see yarnpkg/yarn#1102)
Since npm not only doesn't enforce In the world where yarn is the only CLI client to the npm registry making EDIT: Note that this also means that basically any project that enforces Node.js version somehow (even with a loose |
For projects I'm responsible for, I use the Users of those package may use use it with newer, unsupported, versions of Node if they wish. In the case of However, There's the hammer approach of using |
Perhaps we can just implement a yarn/src/package-compatibility.js Line 123 in 93fa0f7
reporter.warn with the incompatibly, instead of erroring out.
|
As I mentioned in earlier discussions on this: There's also "I install this package because I want to bundle it into my client-side app. Why would I care that it wouldn't run in the version of node I happen to use to download the tar"? I think even adding a help text for resolving the issue ("add the following to the |
That's an excellent point, and as the JavaScript community consumes more npm packages for client-side applications, it's a point that more will want to raise.
Would that suggestion apply to both dependencies and dev dependencies? |
Relax the `node` and `npm` version requirements specified in the `engines` property of the project's `package.json` file. Yarn checks the version range specified in a package's `engines.node` property of the `package.json` file. If you attempt to install a package using a Node version that does not fall within that package's `engines.node` version range, Yarn will fail during the install process. This is opposed to printing a warning like the `npm` package manager does in this situation. To install a package using a Node version outside of the package's range you can pass the `--ignore-engines` flag to `yarn`. Yarn issue related to the strict treatment of the `engines` data: - yarnpkg/yarn#1102 We are relaxing the range since it does not seem Yarn will, any time soon, provide a more convenient means of installing packages with stricter `node` and `npm` version ranges. While our `node` and `npm` version range was meant to correspond with our Node LTS support policy, the disruption is too great to our community. Instead, we will simply need to communicate our support policy directly when engaging our community. Closes #45
@bestander close; non-issue |
It should be noted that this issue was closed as the current Yarn behavior is working as designed. Please see - yarnpkg/rfcs#69 (comment) |
Yep, and another reason is that this issue was repurposed into a discussion which yielded no clear result. If anyone would like to continue the discussion of this topic, please continue inside the RFC @hbetts has linked. Thanks for the linking 😄 |
Relax the `node` and `npm` version requirements specified in the `engines` property of the project's `package.json` file. Yarn checks the version range specified in a package's `engines.node` property of the `package.json` file. If you attempt to install a package using a Node version that does not fall within that package's `engines.node` version range, Yarn will fail during the install process. This is opposed to printing a warning like the `npm` package manager does in this situation. To install a package using a Node version outside of the package's range you can pass the `--ignore-engines` flag to `yarn`. Yarn issue related to the strict treatment of the `engines` data: - yarnpkg/yarn#1102 We are relaxing the range since it does not seem Yarn will, any time soon, provide a more convenient means of installing packages with stricter `node` and `npm` version ranges. While our `node` and `npm` version range was meant to correspond with our Node LTS support policy, the disruption is too great to our community. Instead, we will simply need to communicate our support policy directly when engaging our community.
Similar to #1003
Do you want to request a feature or report a bug?
Bug
Fix: Add
atom
to:yarn/src/package-compatibility.js
Line 53 in b5087a2
The text was updated successfully, but these errors were encountered: