所以我按照入门指南使用whatsapp-web.js 指南链接
const { Client } = require('whatsapp-web.js');
const qrcode = require('qrcode-terminal');
const client = new Client();
client.on('ready', () => {
console.log('Client is ready!');
});
client.on('qr', qr => {
qrcode.generate(qr, {small: true});
});
client.initialize();
当我使用
node main.js
启动代码时,二维码已登录到终端,我可以扫描它,但问题是在我扫描 Whatsapp 登录的二维码后,出现 undefined
(读取“默认”)错误,例如下面
0|main | Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'default')
0|main | at __puppeteer_evaluation_script__:5:95
0|main | at ExecutionContext._evaluateInternal (/home/ubuntu/haro-node/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19)
0|main | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
0|main | at async ExecutionContext.evaluate (/home/ubuntu/haro-node/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16)
0|main | at async Client.initialize (/home/ubuntu/haro-node/node_modules/whatsapp-web.js/src/Client.js:323:9)
Whatsapp 的最终版本是在 Whatsapp-web.js 上使用 15 个月的功能。 Precisamos esperar o auto Pedro Lopes ou outro colaborador corrigir o Problema.