Puppeteer/ chromium help

hay guys im trying to connect my node red through whatsapp with whatsapp-link the lite version disconects every phew minutes so i want to use whatsapp web
i have installed

node-red-contrib-whatsapp-link

node-red-contrib-puppeteer-core

node-red-contrib-puppeteer-new

but i get this error every time

29 Jan 10:24:26 - [error] Error: Failed to launch the browser process! spawn /config/node_modules/puppeteer-core/.local-chromium/linux-1045629/chrome-linux/chrome ENOENT
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
    at onClose (/config/node_modules/puppeteer-core/src/node/BrowserRunner.ts:327:9)
    at ChildProcess.<anonymous> (/config/node_modules/puppeteer-core/src/node/BrowserRunner.ts:319:16)
    at ChildProcess.emit (node:events:518:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
    at onErrorNT (node:internal/child_process:483:16)
    at processTicksAndRejections (node:internal/process/task_queues:90:21)

online it says wont work with armx64 but im on an amd server

-----------------------------------------------------------
 Add-on: Node-RED
 Flow-based programming for the Internet of Things
-----------------------------------------------------------
 Add-on version: 19.0.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 14.2  (amd64 / qemux86-64)
 Home Assistant Core: 2025.1.4
 Home Assistant Supervisor: 2024.12.3
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------

im still quite new to the whole node red so please help

i also will add my nodered configuration just in case

theme: github-dark
http_node:
  username: ""
  password: ""
http_static:
  username: ""
  password: ""
ssl: true
certfile: fullchain.pem
keyfile: privkey.pem
system_packages: []
npm_packages: []
init_commands: []

Stupid question of the day, did you install Chrome?

@aredhone
You're running Home Assistant, therefore, I think this plugin is running under Docker/Alpine.

I would read through this (docker related) : puppeteer/docs/troubleshooting.md at main · puppeteer/puppeteer · GitHub

Its very likely - the Node didn't find/pulldown a binary for chrome under Alpine

Many here don't use Home Assistant or Docker, so input may be limited.

FWIW : ENOENT is file or folder not found

i dont think i did if this fixes it then i dont know what im gona do xD

im gona try the chrome install first if that dosent work im gona try your aprouch thanks

I may be a little thick here but what is the link between the whatsapp node and puppeteer? I didn't see a dependency in the whatsapp node - did I miss something?

Pretty sure WhatsApp implementations use the web chat pages due to lack of API (that's from memory, things might have changed, or I could be wrong)

This is why I use telegram for mobile notifications.

so the whatsap link has a lite version that disconects when ever it feels like it the it also has a whatsap web option thats more stable that needs puppeteer and a headless browser

i dont realy wana use telegram im building a sort of it bot / ai but im slowly noticing that im compleetly out of my deph te reason why i cant go to telegram is no one in my family wants to make the jump so im stuck doing simple it stuff through whatsapp untill i finish this bot/ai

tdlr need whatsapp bot / ai so i dont have to explain how make a windows full screen for the bilionth time

If the nodes aren't working, and if you have some JavaScript ability, I'd just add a node.js module to a function node. There seem to be loads of modules - this seems like one of the top ones:

Any puppeteer node for node-red has issues (at least that is what I found), especially when there are updates to chromium or the puppeteer package. Instead I have switched to the npm package and use a function node to go through the actions.

In the setup tab use (make sure to install chromium via the commandline):

and for the code itself, example:

function delay(time) {
    return new Promise(function (resolve) {
        setTimeout(resolve, time)
    });
}

const browser = await puppeteer.launch({
    headless: true,
    executablePath: '/usr/bin/chromium',
    args: [
        '--incognito',
    ]
});
const user = 'someuser'
const pass = 'somepasswprd'

node.status({ fill: "yellow", shape: "ring", text: "starting browser" });
const page = await browser.newPage();

await page.goto('https://example.com/', {
    waitUntil: 'networkidle2', networkIdleTimeout: 15000
})
node.status({ fill: "blue", shape: "ring", text: "login" });


await page.waitForSelector('#user');
await page.locator('#user').fill(user);
await page.locator('#password').fill(pass);
await page.locator('.btn-primary').click();

await page.waitForNavigation({ waitUntil: "networkidle2" });
await delay(2000);
...
2 Likes

I had the same issues as bakman2 mentioned with all the puppeteer nodes and switched also to the npm version.
Works great, can't recall that I had to set the executablepath, however bakman2 is running on linux and for me this setup runs on win10.

so as of now it might be fixed not thaks to anything i did but there was an update of the whatsap-link app that seems to work more stable so thanks to every one but aslong as it works im not gana mess with anything