Impossible to launch Puppeteer on Raspberry

I have an issue when I try to launch puppeteer with my Raspberry using node-red. I am using the node-red-contrib-puppeteer-new library and this error code appears :

Error: Failed to launch the browser process!
/home/pi/.node-red/node_modules/puppeteer/.local-chromium/linux-982053/chrome-linux/chrome: 16: Syntax error: ")" unexpected


TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

What can I do to solve this issue ?

Best regards

Well the error message says you have a syntax error so that needs to be fixed.

That’s all the help I can give with the information you have provided.

Do you know how can I fix it ? chrome file is a 310MiB file, and I don't know how to open it

This could be a bug in chrome, or a bug in puppeteer, or a bug in the node or a issue with your configuration.

But ask yourself: “What information about my environment have I provided?

All I can gleam so far is you have a flow using node-red-contrib-puppeteer-new and node-red is running on a pi.

What other information do you think might be helpful if you were going to try research and maybe reproduce this issue?

Thanks for your reply.
To add context information:

  • Raspberry Pi 3
  • Raspbian GNU/Linux 11 (bullseye)
  • Library : node-red-contrib-puppeteer-new v0.3.6 (lastest, same issue with the previous one)
  • My flow is simple as this :
    image

I have also tried other node-red puppeteer library, same issue occurs

By following this video, Puppeteer works (but not linked with nod-red)
Chrome Headless and Puppeteer on Raspberry Pi - YouTube

What version of node-red and node.js? (You can get this from the start up log)
Please provide an export of your flow too

FYI I can't get that node to work on Windows either (different error) :frowning:

I ended up writing JavaScript in a seperate file and then loading the result back into NR that way (I just wanted a screen grab of the webpage so it wasn't too difficult)

1 Like
18 Aug 12:21:06 - [info] Node-RED version: v3.0.2
18 Aug 12:21:06 - [info] Node.js  version: v16.16.0

My flow is the following:

[
    {
        "id": "b5cbf7492196e34a",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "07d08e02c2b10887",
        "type": "puppeteer-browser-launch",
        "z": "b5cbf7492196e34a",
        "timeout": 30000,
        "slowMo": 0,
        "headless": 0,
        "debugport": 0,
        "devtools": false,
        "name": "",
        "x": 400,
        "y": 220,
        "wires": [
            []
        ]
    },
    {
        "id": "b1595666c2921b93",
        "type": "inject",
        "z": "b5cbf7492196e34a",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 220,
        "y": 220,
        "wires": [
            [
                "07d08e02c2b10887"
            ]
        ]
    }
]

I have tried another puppeteer node-red library, and this one worked: node-red-contrib-puppeteer-core
The problem is it is only to retrieve HTML code of a webpage, and not what I what to do with puppeteer.

On your Pi, did you install the desktop version?
When you run node-red are you doing it directly on the Pi, i.e. using a browser on the Pi to run NR or you using another computer's browser to run NR on the pi?

I've run into the same issue. The node's author doesn't allow issues to be opened on GitHub so I have sent him a message pointing that out and poining him to this issue. Maybe he will respond, however he hasn't been on the forum in almost a year...

I do both (external webbrower or directly in Raspberry UI through Chromium).

Thanks for your help, I hope he will answer :grinning:

I don't think this is an issue specific to that node-red node. I had the same issue getting puppeteer to run on a plain node.js application on a Pi months ago. Same type of error:

(node:11456) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
/home/user/app/node_modules/puppeteer/.local-chromium/linux-901912/chrome-linux/chrome: 1: /home/user/app/node_modules/puppeteer/.local-chromium/linux-901912/chrome-linux/chrome: Syntax error: ")" unexpected

Also tried an alternative PhantomJS and had no luck with that either:

$ npm install

> phantomjs-prebuilt@2.1.16 install /home/user/app/node_modules/phantomjs-prebuilt
> node install.js

PhantomJS not found on PATH
Unexpected platform or architecture: linux/arm
It seems there is no binary available for your platform/architecture
Try to install PhantomJS globally
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: phantomjs-prebuilt@2.1.16 (node_modules/phantomjs-prebuilt):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: phantomjs-prebuilt@2.1.16 install: `node install.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

So it seems like it may just be lacking arm support for these, but I never found a definitive answer. Here are some relevant GitHub issues, but also no answers there unfortunately.

Maybe this will work for you then if you already have Chromium on the Pi Failing to launch process · Issue #357 · snobu/destreamer · GitHub

Hi .. after a bit of research we managed to crack this recently in another Forum post
and it was by using an much older version of puppeteer-core@1.20.0 in a Function node.
Latest versions of puppeteer seem to have this problem on PIs (issue)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.