cheeriojs / cheerio

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

error cheerio@1.0.0: The engine "node" is incompatible with this module. Expected version ">=18.17". Got "14.17.1" #4001

Open painkkiller opened 3 months ago

painkkiller commented 3 months ago

It rather question than issue. After release of cheerio@1.0.0 my project got broken and I don't use cheerio directly, It's in peer dependancies inside my package-lock.json file. In fact everywhere is used

 "cheerio": {
            "version": "1.0.0-rc.12",
            "resolved": "https://domain/repository/npm-proxy/cheerio/-/cheerio-1.0.0-rc.12.tgz",
            "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==",
            "dev": true,
            "requires": {
                "cheerio-select": "2.1.0",
                "dom-serializer": "^2.0.0",
                "domhandler": "^5.0.3",
                "domutils": "^3.0.1",
                "htmlparser2": "^8.0.1",
                "parse5": "^7.0.0",
                "parse5-htmlparser2-tree-adapter": "^7.0.0"
            },

But I am getting this error anyway. So now I am in the trouble cause I can't upgrade nodejs, I need 14.17.1 version for one package I've use. And so far I see It's impossible to use cheerio-1.0.0-rc.12 version because cheerio@1.0.0 is installing instead.

KarthikAppCraft commented 3 months ago

Adding "cheerio": "1.0.0-rc.12" to your dependencies in package.json will allow you to use the older version of Cheerio, ensuring compatibility with your current setup.

Though it is a peer dependencies, you can use explicitly in package.json as temporary work around

eladonline commented 3 months ago

Adding "cheerio": "1.0.0-rc.12" to your dependencies in package.json will allow you to use the older version of Cheerio, ensuring compatibility with your current setup.

Though it is a peer dependencies, you can use explicitly in package.json as temporary work around https://github.com/cheeriojs/cheerio/issues/3999#issue-2460406040