Not accurate node engine version range - it should be ^14.18.0 || >=16.0.0
#5575
Labels
type: bug
code to address defects in shipped code
^14.18.0 || >=16.0.0
#5575
Describe the bug
In
package.json
there is following metadata:But package actually fails to install on Node 14.16 when running
postinstall
script:This is because support for
require('node:X')
was only added in Node 14.18 ( expandhistory
in https://nodejs.org/api/esm.html#node-imports for reference ).This is the case for current and previous major of
netlify-cli
.I think there is no non-hacky way to fix this to make it work with reported minimum node version + the fact that it wasn't working on that min version it might make sense to adjust package.json to say Node@14.18 - which technically is a breaking change, but that is factual state of supported node version, just wrongly reported.
The hacky way is something like this https://github.com/gatsbyjs/gatsby/blob/master/e2e-tests/production-runtime/polyfill-node-protocol-imports.js but we are only doing this for e2e tests, not actually releasing that to npm and I would not suggest to adopt something like that for package that is released to npm.
This issue came up in netlify/gatsby-plugin-netlify#232
Steps to reproduce
Easiest is to go inside
netlify-cli
repo clone dir and run followingConfiguration
No response
Environment
The text was updated successfully, but these errors were encountered: