我使用whatsapp-wb.js已经有一段时间了。最近这个包已经不能用了。
首先,当我尝试他们最新的软件包,即“whatsapp-web.js”:“^1.23.0”时,甚至在二维码出现之前,它就会抛出:
.../node_modules/whatsapp-web.js/src/webCache/LocalWebCache.js:34
const version = indexHtml.match(/manifest-([\d\\.]+)\.json/)[1];
^
TypeError: Cannot read properties of null (reading '1')
手动添加“?”时为了解决这个问题,会出现二维码。然后扫描后,它抛出:
.../node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221
throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails));
^
Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'default')
at __puppeteer_evaluation_script__:5:95
at ExecutionContext._evaluateInternal (.../node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ExecutionContext.evaluate (.../node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
at async Client.initialize (.../node_modules/whatsapp-web.js/src/Client.js:323:9)
尝试了以下解决方案:
.../node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221
throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails));
^
Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'push')
at fillModuleArray (eval at <anonymous> (:2:5), <anonymous>:6:74)
at moduleRaid (eval at <anonymous> (:2:5), <anonymous>:15:3)
at __puppeteer_evaluation_script__:4:17
at ExecutionContext._evaluateInternal (.../node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ExecutionContext.evaluate (.../node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
at async Client.initialize (.../node_modules/whatsapp-web.js/src/Client.js:322:9)
有什么想法可以让它再次工作吗?