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.21k stars 3.63k forks source link

whatsapp-web.js TERMUX in Android Device #2419

Closed nikoboomer closed 10 months ago

nikoboomer commented 1 year ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe.

Hi, I tried to install whatsapp-web.js in termux but it's impossible. It stays in the part to install puppeteer appears:

/data/data/com.termux/files/home/bot/node_modules/puppeteer/lib/cjs/puppeteer/co                                                    mmon/assert.js:26
        throw new Error(message);
              ^

Error: Unsupported platform: android
    at assert (/data/data/com.termux/files/home/bot/node_modules/puppeteer/lib/c                                                    js/puppeteer/common/assert.js:26:15)
    at BrowserFetcher.setPlatform (/data/data/com.termux/files/home/bot/node_mod                                                    ules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:184:36)
    at new BrowserFetcher (/data/data/com.termux/files/home/bot/node_modules/pup                                                    peteer/lib/cjs/puppeteer/node/BrowserFetcher.js:168:14)
    at resolveExecutablePath (/data/data/com.termux/files/home/bot/node_modules/                                                    puppeteer/lib/cjs/puppeteer/node/Launcher.js:622:28)
    at ChromeLauncher.launch (/data/data/com.termux/files/home/bot/node_modules/                                                    puppeteer/lib/cjs/puppeteer/node/Launcher.js:103:53)
    at PuppeteerNode.launch (/data/data/com.termux/files/home/bot/node_modules/p                                                    uppeteer/lib/cjs/puppeteer/node/Puppeteer.js:125:31)
    at Client.initialize (/data/data/com.termux/files/home/bot/node_modules/what                                                    sapp-web.js/src/Client.js:106:39)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5                                                    )

Node.js v20.2.0

Has anyone been able to run it in TERMUX or in an android terminal?

Describe the solution you'd like.

Being able to use whatsapp-web.js on android devices

Describe an alternate solution.

No response

Additional context

No response

RC047 commented 1 year ago

Is there an existing issue for this?

  • [x] I have searched the existing issues

Is your feature request related to a problem? Please describe.

Hi, I tried to install whatsapp-web.js in termux but it's impossible. It stays in the part to install puppeteer appears:

/data/data/com.termux/files/home/bot/node_modules/puppeteer/lib/cjs/puppeteer/co                                                    mmon/assert.js:26
        throw new Error(message);
              ^

Error: Unsupported platform: android
    at assert (/data/data/com.termux/files/home/bot/node_modules/puppeteer/lib/c                                                    js/puppeteer/common/assert.js:26:15)
    at BrowserFetcher.setPlatform (/data/data/com.termux/files/home/bot/node_mod                                                    ules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:184:36)
    at new BrowserFetcher (/data/data/com.termux/files/home/bot/node_modules/pup                                                    peteer/lib/cjs/puppeteer/node/BrowserFetcher.js:168:14)
    at resolveExecutablePath (/data/data/com.termux/files/home/bot/node_modules/                                                    puppeteer/lib/cjs/puppeteer/node/Launcher.js:622:28)
    at ChromeLauncher.launch (/data/data/com.termux/files/home/bot/node_modules/                                                    puppeteer/lib/cjs/puppeteer/node/Launcher.js:103:53)
    at PuppeteerNode.launch (/data/data/com.termux/files/home/bot/node_modules/p                                                    uppeteer/lib/cjs/puppeteer/node/Puppeteer.js:125:31)
    at Client.initialize (/data/data/com.termux/files/home/bot/node_modules/what                                                    sapp-web.js/src/Client.js:106:39)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5                                                    )

Node.js v20.2.0

Has anyone been able to run it in TERMUX or in an android terminal?

Describe the solution you'd like.

Being able to use whatsapp-web.js on android devices

Describe an alternate solution.

No response

Additional context

No response

Puppeteer is not supported for android platform. Read this

calangosh commented 10 months ago

It is possible to install pupperter in termux, just install a Linux distribution through proot-distro

pkg install proot-distro
proot-distro install alpine
proot-distro login alpine
apk update && apk add --no-cache nmap && \
  echo @edge http://nl.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories && \
  echo @edge http://nl.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories && \
  apk update && \
  apk add --no-cache \
  chromium

It worked for me, don't forget to pass the browser path in the pupperter instance. I installed the alpine because it is light and very simple, I haven't tested it with other distributions