【发布时间】:2021-06-09 13:12:39
【问题描述】:
我有一个使用 Cheerio 的刮刀。
var cheerio = require('cheerio');
$ = cheerio.load(s, { decodeEntities: true });
var sel = $('.text');
cheerio(sel).find(selector)
当我在本地调用它时,它工作正常。当我在具有 Cent OS 但在本地使用相同节点版本 (12.18.3) 的服务器上调用它时,我收到 cheerio is not a function 错误。我清除了本地和远程的 node_modules 文件夹并创建了npm install,但没有更改。还有什么可能导致这种奇怪的行为?
【问题讨论】:
标签: javascript node.js cheerio