c8 icon indicating copy to clipboard operation
c8 copied to clipboard

No longer compatible with Node < 16 since upgrade to foreground-child > 3.x

Open webketje opened this issue 1 year ago • 4 comments

All technical details of the test can be found at https://github.com/metalsmith/metalsmith/actions/runs/7854693798/job/21435716699

Since v3.x the dependency foreground-child uses the node: prefix to include constants and due to this c8 throws in Node < 16:

Error: Cannot find module 'node:constants'

Shall preferably be tackled after a solution is chosen at https://github.com/tapjs/foreground-child/issues/56

webketje avatar Feb 10 '24 12:02 webketje

@webketje would you be able to contribute a failing test? our test matrix includes Node 14 and 16 and I haven't been seeing failures.

bcoe avatar Feb 19 '24 21:02 bcoe

I think the test I ran has all the details, but it was run with 14.14.0. According to this article: https://2ality.com/2021/12/node-protocol-imports.html#support-for-node%3A-imports, the node: prefixed imports are only supported since 14.18.0, I will re-run a test locally. If that's the case, the engines.node property should only be changed to >=14.18.0

webketje avatar Feb 20 '24 10:02 webketje

@bcoe I've done a 2 local test runs with 14.14.0 and 14.18.0 and can confirm that c8 works with Node >=14.18.0 but not with `<14.18.0.

webketje avatar Feb 20 '24 22:02 webketje

If that's the case, the engines.node property should only be changed to >=14.18.0

@webketje 👍 sounds like a good call to me.

bcoe avatar Feb 21 '24 18:02 bcoe