cheerio icon indicating copy to clipboard operation
cheerio copied to clipboard

Undici 7.10 requires Node >=20.18.1

Open Nadreck opened this issue 6 months ago • 2 comments

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.

Nadreck avatar Jun 10 '25 13:06 Nadreck

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

michael-ortiz avatar Jun 10 '25 15:06 michael-ortiz

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]"
  },

hsingla005 avatar Jun 11 '25 20:06 hsingla005

This is also breaking our pipelines and pinning via overrides doesn't seem to be working.

pbusby avatar Jun 18 '25 15:06 pbusby

the same error, any progress for this ?

flyingcrp avatar Jun 19 '25 09:06 flyingcrp

i added some magic to package.json fix this issue ,npm && yarn

    "overrides": {
        "undici": "6.21.3"
    },
    "resolutions": {
        "undici": "6.21.3"
    },

flyingcrp avatar Jun 23 '25 07:06 flyingcrp

Same issue here. At the very least update cheerio's engine req in package.json..

ErwinAI avatar Jun 30 '25 06:06 ErwinAI

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.

fb55 avatar Jul 20 '25 21:07 fb55

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

psychobolt avatar Aug 08 '25 22:08 psychobolt