Skip to content

Claimed support for Node.js v12 missing #150

Closed as not planned
Closed as not planned

Description

@aweebit

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.

Activity

  1. Qix- commented on Aug 10, 2023

    @Qix-
    Contributor

    Hi, where do you see we support Node 12?

  2. aweebit commented on Aug 10, 2023

    @aweebit
    Author

    @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.

  3. Qix- commented on Aug 10, 2023

    @Qix-
    Contributor

    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!

  4. aweebit commented on Aug 10, 2023

    @aweebit
    Author

    @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.

  5. Qix- commented on Aug 10, 2023

    @Qix-
    Contributor

    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?

  6. reopened this on Aug 10, 2023
  7. aweebit commented on Aug 10, 2023

    @aweebit
    Author

    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.

  8. sindresorhus commented on Aug 10, 2023

    @sindresorhus
    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.

  9. sindresorhus commented on Aug 10, 2023

    @sindresorhus
    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/

  10. aweebit commented on Aug 10, 2023

    @aweebit
    Author

    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.

  11. sindresorhus commented on Aug 10, 2023

    @sindresorhus
    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions