cheeriojs / cheerio

The fast, flexible, and elegant library for parsing and manipulating HTML and XML.
https://cheerio.js.org
MIT License
28.73k stars 1.64k forks source link

rror cheerio@1.0.0: The engine "node" is incompatible with this module. Expected version ">=18.17". Got "16.18.1" error Found incompatible module. #4003

Open kjanghel opened 3 months ago

kjanghel commented 3 months ago

Updating the node version is not an option.

can we have a immediate solution for this? Our prod deployment is failing for the same.

Sleepyy007 commented 3 months ago

The same problem, we use enzyme, which uses cheerio, we don't really want to update node either

4rgs commented 3 months ago

we used, "overrides": { "cheerio": "1.0.0-rc.12" }

on our package.json to solve our product in the meanwhile

Sleepyy007 commented 3 months ago

Its work for me: }, "resolutions": { "cheerio": "1.0.0-rc.12" }

kjanghel commented 3 months ago

can u share a sample package json it doesn't work for us

StevenTso commented 3 months ago

after adding @Sleepyy007 suggestion, try deleting package-lock.json or yarn.lock and node_modules folder and try reinstalling (npm i or yarn install)

wghule commented 3 months ago

I have the same problem。I use cheerio 1.0.0-rc.10。It can supprt the node version I am using。 but cheerio 1.0.0 recently only support node 18。It causes automatic upgrade issues for existing projects。Please upgrade the major version if necessary!

wardariaz70 commented 3 months ago

error cheerio@1.0.0: The engine "node" is incompatible with this module. Expected version ">=18.17". Got "16.18.1" 1.0.0 uses node 18; but my os centOS 7, only support upto 16

hanamantk commented 3 months ago

Its work for me: }, "resolutions": { "cheerio": "1.0.0-rc.12" } @Sleepyy007 is there a way we can override this cheerio to only enzyme package without effecting other package

xahmejaz-rakbank commented 3 weeks ago

Its work for me: }, "resolutions": { "cheerio": "1.0.0-rc.12" }

worked for me as well