Пытаюсь использовать библиотеку whatsapp-web.js .
Запускаю app.js на vps
const { Client } = require('whatsapp-web.js');
const client = new Client();
client.on('qr', (qr) => {
// Generate and scan this code with your phone
console.log('QR RECEIVED', qr);
});
client.on('ready', () => {
console.log('Client is ready!');
});
client.on('message', msg => {
if (msg.body == '!ping') {
msg.reply('pong');
}
});
client.initialize();
И получаю ошибку
Error: Failed to launch the browser process!
0|a | [1212/224305.004595:ERROR:zygote_host_impl_linux.cc(90)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
0|a |
0|a |
0|a | TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
0|a |
0|a | at onClose (/var/www/178-21-11-22.cloudvps.regruhosting.ru/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:193:20)
0|a | at Interface.<anonymous> (/var/www/178-21-11-22.cloudvps.regruhosting.ru/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:183:68)
0|a | at Interface.emit (events.js:326:22)
0|a | at Interface.close (readline.js:416:8)
0|a | at Socket.onend (readline.js:194:10)
0|a | at Socket.emit (events.js:326:22)
0|a | at endReadableNT (_stream_readable.js:1241:12)
0|a | at processTicksAndRejections (internal/process/task_queues.js:84:21)
Как исправить ? на сервере установлено nodejs -v 12, библиотека Puppeteer