Undici 7.10 requires Node >=20.18.1
Recent updates to dependencies bumped the undici library to 7.10.0. The 7.x branch of undici has an engine requirement of >=20.18.1. This means that cheerio's engine setting (>=18.17) is out of sync, and if you run cheerio from an older version of node, you get an EBADENGINE warning:
% npm update
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE package: '[email protected]',
npm warn EBADENGINE required: { node: '>=20.18.1' },
npm warn EBADENGINE current: { node: 'v20.15.0', npm: '10.7.0' }
npm warn EBADENGINE }
While I'd prefer if we rolled back the move to 7.x so cheerio remains compatible with more versions of Node, failing that, we should update the engine requirement to match what's actually needed.
This is causing issues on public packages as we are not using node 20 and is breaking our deployment pipelines as we are unable to upgrade to v20 at the moment.
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=20.18.1". Got "18.20.5"
Installing plugin failed
is there a way to pin the version of cheerio for yarn? the normal resolutions way doesn't seem to be working for me. I tried following
"resolutions": {
"**/cheerio": "npm:[email protected]"
},
This is also breaking our pipelines and pinning via overrides doesn't seem to be working.
the same error, any progress for this ?
i added some magic to package.json fix this issue ,npm && yarn
"overrides": {
"undici": "6.21.3"
},
"resolutions": {
"undici": "6.21.3"
},
Same issue here. At the very least update cheerio's engine req in package.json..
Thanks for the report! Our CI still passes on Node 18, but I've bumped the minimum engines Node version to line up with Undici.
Seems like this a breaking change for projects still on Node 18. Why was this not noted in the release docs?
Anyways, seems like the author provided some suggestions for a backward support patch: https://github.com/nodejs/undici/issues/4374