Skip to content

Should declare a required node version in package.json #58

Description

@hallvors

I had to downgrade a project from running on Node 18 - 22 to Node 16 for reasons not related to date-fns, and it cost me a bit of debugging time to understand that my date calculations are not wrong, @date-fns/tz is not actually compatible with Node 16:


$ node
Welcome to Node.js v16.17.0.
Type ".help" for more information.
> const { TZDateMini } = require('@date-fns/tz/date/mini');
undefined
>  new TZDateMini(Date.now())
TZDateMini Invalid Date { internal: Invalid Date }

Setting a requirement in package.json so I would be warned on install would be helpful:

  "engines": {
   "node": ">=18.0.0"
  }

(I have not verified that 18.0.0 is indeed the minimum requirement)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      Could

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions