You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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- 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.
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.
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/
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/
Activity
Qix- commentedon Aug 10, 2023
Hi, where do you see we support Node 12?
aweebit commentedon 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.supports-color/package.json
Lines 18 to 20 in d4f413e
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- commentedon 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!
aweebit commentedon 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- commentedon 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?
aweebit commentedon Aug 10, 2023
Found some similar issues:
The right one would be
>=12.20.0 <13.0.0 || >=14.13.1(source: changelogs), but making the change just to insist on usingnode:seems odd to me. Honestly, it would be just cool if you could stop using itat least while v14 is still in maintenance modeuntil 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 commentedon Aug 10, 2023
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 commentedon 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/
aweebit commentedon Aug 10, 2023
Oh, that's right, I had mixed them up, sorry.
sindresorhus commentedon Aug 10, 2023
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.