pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
15.05k stars 3.58k forks source link

Illegal instruction at linux #1240

Closed ghost closed 2 years ago

ghost commented 2 years ago

Bug description

When i try to start give me some error: Illegal instruction

Reproduction steps

Steps to reproduce the behavior:

  1. Install the lib (npm install whatsapp-web.js)
  2. Create an simple bot
  3. Run the code (node index.js) ...

Expected behavior

Run without any error

Relevant code

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();

Environment (please complete the following information):

WhatsApp

Library

Other

Additional context

On windows works fine but on linux doesn't works

KeruMx commented 2 years ago

show all error pls, maybe is the pupperteer librarie's

ghost commented 2 years ago

show all error pls, maybe is the pupperteer librarie's

This is the error, when i remove the const { Client } = require('whatsapp-web.js'); the error stops 2022-02-24_22-00

KeruMx commented 2 years ago

node_version ?

ghost commented 2 years ago

node_version ?

v17.6.0 it's on description

benjitusk commented 2 years ago

This issue is caused by using the Sharp library, I believe it's being imported for image processing. If you can find where it's being imported you can safely comment it out and avoid this issue

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

PurpShell commented 2 years ago

we removed sharp, should work at the latest update, remember to remove all node_modules and reinstall. bye