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

Claimed support for Node.js v12 missing #150

Closed
aweebit opened this issue Aug 10, 2023 · 10 comments
Closed

Claimed support for Node.js v12 missing #150

aweebit opened this issue Aug 10, 2023 · 10 comments

Comments

@aweebit
Copy link

aweebit commented Aug 10, 2023

The node: namespace imports used by the library were backported to Node.js v12, see nodejs/node#35757.

They are also only supported by @types/node starting v16, see DefinitelyTyped/DefinitelyTyped#52595 (comment). That has the following TypeScript error as a consequence when trying to use the newest library version in jestjs/jest codebase that relies on "@types/node": "~14.14.45":

packages/jest-util/node_modules/supports-color/index.d.ts:1:32 - error TS2307: Cannot find module 'node:tty' or its corresponding type declarations.

1 import type {WriteStream} from 'node:tty';
                                 ~~~~~~~~~~

Please consider giving up the use of the namespace.

@Qix-
Copy link
Member

Qix- commented Aug 10, 2023

Hi, where do you see we support Node 12?

@aweebit
Copy link
Author

aweebit commented Aug 10, 2023

@Qix- Hi! It is mentioned in the release notes for v9.0.0, the latest major version, and also in package.json.

"engines": {
"node": ">=12"
},

Actually, v15 is the first major release to support node: from the start, so even bumping the requirement to ">=14" would not save the day.

@Qix-
Copy link
Member

Qix- commented Aug 10, 2023

Hmm well Node 12 works, I just checked. If there's an issue with Typescript, you'll need to take it up with them. We're not doing anything wrong here. We're not going to remove the namespace, though. Sorry about that.

Let me know if I've misunderstood you at all I'll re-open. Thanks for filing!

@Qix- Qix- closed this as completed Aug 10, 2023
@aweebit
Copy link
Author

aweebit commented Aug 10, 2023

@Qix- have you checked in a version prior to v12.20.0 where the node: backport was first included (see nodejs/node#35950)? I am still new to open source and might be wrong, but I thought v12 support meant all versions in the ">=12" range had to be supported.

@Qix-
Copy link
Member

Qix- commented Aug 10, 2023

Hmm I think we had this same question before but I can't find it. Maybe @sindresorhus remembers why we don't have a more specific version in there?

@Qix- Qix- reopened this Aug 10, 2023
@aweebit
Copy link
Author

aweebit commented Aug 10, 2023

Hmm I think we had this same question before but I can't find it.

Found some similar issues:

Maybe @sindresorhus remembers why we don't have a more specific version in there?

The right one would be >=12.20.0 <13.0.0 || >=14.13.1 (source: changelogs), but making the change just to insist on using node: seems odd to me. Honestly, it would be just cool if you could stop using it at least while v14 is still in maintenance mode until you decide to ditch v14 support altogether. It's a pity the newer versions cannot be used in Jest because of the error which is very easy to fix.

@sindresorhus
Copy link
Member

I am still new to open source and might be wrong, but I thought v12 support meant all versions in the ">=12" range had to be supported.

It's simply not always feasible to remember the exact minor Node.js version of every feature you use.

It is generally expected that users upgrade minor Node.js version for security reasons.

The version with this has been out for more than 2 years now and no one else has complained about this, so it's clear it's not a big issue.

@sindresorhus
Copy link
Member

Honestly, it would be just cool if you could stop using it at least while v14 is still in maintenance mode.

Node.js 14 is not in maintenance mode. It's not supported at all, even by the Node.js team. The general convention in the community is to support the last active LTS version, which is Node.js 16. https://nodejs.dev/en/about/releases/

@aweebit
Copy link
Author

aweebit commented Aug 10, 2023

Node.js 14 is not in maintenance mode. It's not supported at all, even by the Node.js team. The general convention in the community is to support the last active LTS version, which is Node.js 16. https://nodejs.dev/en/about/releases/

Oh, that's right, I had mixed them up, sorry.

@sindresorhus
Copy link
Member

Closing as we don't intend to change anything here.

The next version (when we have any new changes to push out) of this package will be to target Node.js 16.

@sindresorhus sindresorhus closed this as not planned Won't fix, can't repro, duplicate, stale Aug 10, 2023
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

3 participants