Npm 包 Whatsapp-web.js 损坏了

问题描述 投票:0回答:1

我使用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)

尝试了以下解决方案:

  1. 删除软件包并重新安装。
  2. 制作了一个示例新节点项目,但仍然出现相同的错误。
  3. Whatsapp-web js 不会触发就绪事件
  4. https://github.com/pedroslopez/whatsapp-web.js/issues/1786
  5. 在将选择器更改为 INTRO_IMG_SELECTOR = '[data-icon='search'] 后尝试某些旧版本(例如 [email protected])时,它会抛出:
.../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)

有什么想法可以让它再次工作吗?

javascript node.js whatsapp
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.