7

Solution for common dependences issues using puppeteer in ubuntu 18.04 (Bionic)

 1 year ago
source link: https://gist.github.com/winuxue/cfef08e2f5fe9dfc16a1d67a4ad38a01
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Solution for common dependences issues using puppeteer in ubuntu 18.04 (Bionic)

puppeteer dependeces in ubuntu 18.04 (Bionic)

error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

sudo apt-get install libnss3

error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory

sudo apt-get install libxss1

error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory

apt-get install libasound2

error while loading shared libraries: libatk-1.0.so.0: cannot open shared object file: No such file or directory

apt-get install libatk-bridge2.0-0

error while loading shared libraries: libgtk-3.so.0: cannot open shared object file: No such file or directory

apt install libgtk-3-0

Wujek280 commented Jul 28, 2021

edited

Had similar problem with Debian 10

sudo apt-get install -yq --no-install-recommends libasound2 libatk1.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 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 libnss3

Can't tell if it's overkill but it worked :)

I am working on electron and when I want to run my app in terminal like this:

npm run dev

The output is:

> [email protected] dev

electron index.js

/home/pablitokonti/platzi/electron/cursoElectron/node_modules/electron/dist/electron: error while loading shared libraries: libgbm.so.1: cannot open shared object file: No such file or directory

I've tried lots of commands but it is still don't working

I am working on electron and when I want to run my app in terminal like this:

npm run dev

The output is:

> [email protected] dev

electron index.js

/home/pablitokonti/platzi/electron/cursoElectron/node_modules/electron/dist/electron: error while loading shared libraries: libgbm.so.1: cannot open shared object file: No such file or directory

I've tried lots of commands but it is still don't working

libgbm.so.1 can be installed with sudo apt install libgbm-dev (source: https://stackoverflow.com/a/67407105/1334688)

awps commented Dec 10, 2021

Here's what worked in my case:

apt-get install libnss3 libxss1 libasound2 libatk-bridge2.0-0 libgtk-3-0 libgbm-dev

LZL0 commented Jan 21, 2022

Thank you @awps !

What worked on a new Ubuntu 20.04 VPS:

sudo apt-get install gconf-service libasound2 libatk1.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 libatk-bridge2.0-0 libgbm-dev

Had to combine several suggestions to make it work.

Thank you @awps , the last comman libgbm-dev was missing from the top answer :)

What worked on a new Ubuntu 20.04 VPS:

sudo apt-get install gconf-service libasound2 libatk1.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 libatk-bridge2.0-0 libgbm-dev

Had to combine several suggestions to make it work.

shhhweet, this worked for me on v21 core thanks call_me_hand

Ubuntu 20.04

apt install -y libx11-xcb1 libxcomposite1 libxcursor1 libxdamage1 libxi-dev libxtst-dev libnss3 libcups2 libxss1 libxrandr2 libasound2 libatk1.0-0 libatk-bridge2.0-0 libpangocairo-1.0-0 libgtk-3-0 libgbm1

For Ubuntu 20.04-amd64-server:

sudo apt-get install libatk1.0-0 libatk-bridge2.0-0 libcups2 libxkbcommon-x11-0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libpango-1.0-0 libcairo2

If you don't want to install a mess of packages – install one-by-one only the missing ones. That's what I did.

Here's what worked in my case:

apt-get install libnss3 libxss1 libasound2 libatk-bridge2.0-0 libgtk-3-0 libgbm-dev

Thank you! @awps

What worked on a new Ubuntu 20.04 VPS:

sudo apt-get install gconf-service libasound2 libatk1.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 libatk-bridge2.0-0 libgbm-dev

Had to combine several suggestions to make it work.

Thanks Seb, this worked!

thanks

aman-g202 commented Dec 13, 2022

edited

Thanks @sebastiaanluca

Run the apt-get mentioned by @sebastiaanluca

sudo apt-get install gconf-service libasound2 libatk1.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 libatk-bridge2.0-0 libgbm-dev

Followed by lunch the chrome process with no-sandbox argument

this.browser = await puppeteer.launch({
   headless: true,
   args: ["--no-sandbox"],
});

manokaran68 commented Dec 13, 2022

edited

Thank you Sebastian Luca

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK