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

Doesn't work with Node 15 #225

Closed
cameronspeakflash opened this issue Oct 23, 2020 · 8 comments · Fixed by #226
Closed

Doesn't work with Node 15 #225

cameronspeakflash opened this issue Oct 23, 2020 · 8 comments · Fixed by #226

Comments

@cameronspeakflash
Copy link

nvm use 15
yarn
error graphql-request@3.2.0: The engine "node" is incompatible with this module. Expected version "10.x || 12.x || 14.x". Got "15.0.1"
error Found incompatible module.
@tbroyer
Copy link

tbroyer commented Oct 23, 2020

Oh, looks like there's a PR already: #224

@jasonkuhrt
Copy link
Member

Is this a warning or hard blocker?

We don't test with odd versions of Node right now.

And if we don't test it, we're not going to ship supposed support for it.

If this is a blocking hard error (e.g. process.exit(1)) then I'll reconsider and maybe we'll say that we support the latest odd version as a policy.

Actually latest odd version might be a good idea in general. WDTY?

@tbroyer
Copy link

tbroyer commented Oct 23, 2020

The last (odd or not) version would be a good idea yes.

BTW, 14 still isn't LTS (only starting next week), and afaict the only odd/even rule is that only even releases eventually become LTS, but 14 wasn't (and technically still isn't) any different from 13 or 15.

@tbroyer
Copy link

tbroyer commented Oct 24, 2020

I realize I didn't answer your first question:

Is this a warning or hard blocker?

It's a hard blocker.
https://docs.npmjs.com/configuring-npm/package-json.html#engines

If you specify an “engines” field, then npm will require that “node” be somewhere on that list.

(emphasis mine)


And to backup my previous comment, if you want to be selective about what versions of Node you support (and ban other versions from using your lib), then you should at a minimum list the Maintenance LTS (if you choose to support it; currently 10, both 10 and 12 starting next Friday), the Active LTS (currently 12, both 12 and 14 starting next Tuesday, and 14 only starting next Friday), the Current (currently both 14 and 15, only 15 starting next Tuesday when 14 switches to Active LTS), and the Pending (currently 16, was 15 just a few days ago) to be future-proof (that would have allowed 3.2.0 to run on Node 15; then maybe there are incompatibilities, but at least we're in a situation where we can actually discover them, rather than being banned from using the library)
See https://nodejs.org/en/about/releases/

If you ask me, I would totally remove the engine field from package.json (or use something as simple as >=10), but be clear on the README which versions are supported (i.e. all active versions at time of release; or possibly all LTS versions, but then that wouldn't have included 14), and only test those in CI.
If you want to only support LTS versions of Node, that's OK (your choice), but that doesn't mean I couldn't use graphql-request with Node 15 "at my own risks".


Fwiw, our CI builds our client apps with the node Docker image (we don't use Node on servers, only for building our browser code). It was updated to Node 15 almost instantly after release, whereas packages on developers' machines are still at 14 (Arch hasn't updated yet, still testing the new package currently before releasing them out: https://www.archlinux.org/packages/?q=nodejs; and Ubuntu users need to manually switch their NodeSource repository, unless they use the package from Canonical which is still at 12, or even 10 for Ubuntu Focal LTS); and instantly our CI builds started to fail due to graphql-request rejecting Node 15. We switched our CI to node:lts in the mean time; but Arch users (this includes myself) will be affected soon and have to switch to another (LTS) package.

@jasonkuhrt
Copy link
Member

If you ask me, I would totally remove the engine field from package.json (or use something as simple as >=10), but be clear on the README which versions are supported (i.e. all active versions at time of release; or possibly all LTS versions, but then that wouldn't have included 14), and only test those in CI.
If you want to only support LTS versions of Node, that's OK (your choice), but that doesn't mean I couldn't use graphql-request with Node 15 "at my own risks".

Yep I agree with you @tbroyer.

@tbroyer
Copy link

tbroyer commented Oct 27, 2020

Node 15 has arrived to Arch (https://www.archlinux.org/packages/?q=nodejs), it'd be awesome if you could cut a release with the recent changes to the package.json!

@jasonkuhrt
Copy link
Member

Done https://github.com/prisma-labs/graphql-request/releases/tag/v3.3.0

@tbroyer
Copy link

tbroyer commented Oct 27, 2020

Thanks a lot for your reactivity!

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 a pull request may close this issue.

3 participants