piqnt / svgexport

SVG to PNG/JPEG command-line tool and Node.js module
927 stars 85 forks source link

Error: Failed to launch the browser process! #105

Closed idkroff closed 3 years ago

idkroff commented 3 years ago

I'm trying to convert svg file to .png, but i have this error:

/root/bot/node_modules/svgexport/node_modules/puppeteer/lib/launcher/BrowserRunner.js:159
            reject(new Error([
                   ^

Error: Failed to launch the browser process!
/root/bot/node_modules/svgexport/node_modules/puppeteer/.local-chromium/linux-756035/chrome-linux/chrome: error while loading shared libraries: libgbm.so.1: cannot open shared object file: No such file or directory

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

    at onClose (/root/bot/node_modules/svgexport/node_modules/puppeteer/lib/launcher/BrowserRunner.js:159:20)
    at Interface.<anonymous> (/root/bot/node_modules/svgexport/node_modules/puppeteer/lib/launcher/BrowserRunner.js:149:65)
    at Interface.emit (node:events:406:35)
    at Interface.close (node:readline:586:8)
    at Socket.onend (node:readline:277:10)
    at Socket.emit (node:events:406:35)
    at endReadableNT (node:internal/streams/readable:1343:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

Operating System: Ubuntu 20.04.3 LTS Kernel: Linux 5.4.0-81-generic Architecture: x86-64

idkroff commented 3 years ago

This helped me:

sudo apt-get update

sudo apt-get install -y gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget

sudo apt-get install -y libgbm-dev

**

Issue closed.

**

ethan666 commented 2 years ago

Go to:your_project_path/node_modules/puppeteer/.local-chromium/linux-856583/chrome-linux(this will also serve as a check if you have chromium installed)

Then run:ldd chrome | grep not(to see if any dependencies are missing)

For me (after I ran the installation from @Rhezashan) it turned out still be missing libgbm:libgbm.so.1 => not found

You can install it with:sudo apt-get install libgbm-dev https://stackoverflow.com/questions/63823927/cannot-run-puppeteer-chromium-on-ubuntu/66456542#66456542