I have to run a node app that uses puppeteer. The environment in which I can deploy the app runs Ubuntu 14.04, does not allow sudo/apt-get, and is missing dependencies, so I get this error when I try to use puppeteer:

Failed to launch chrome! /app/node_modules/puppeteer/.local-chromium/linux-624492/chrome-linux/chrome: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

I do not have access to sudo in this environment and have already been told that my goal should be to get the missing libraries (listed below) and bundle the libraries with my package that gets deployed, and point to them with LD_LIBRARY_PATH.

I have already tried figuring out how to get any of these files, like libX11-6.so, for example, but haven't figured out how. I've tried doing apt-get download on them in an Ubuntu docker container, but that has given me .deb files.

I'm expecting to need to...

  • Gather some number of .so files
  • Deploy my app with them in the bundle somewhere in the root of the node app, maybe in an app/lib/ folder
  • Do export LD_LIBRARY_PATH=app/lib/:$LD_LIBRARY_PATH && npm start instead of just npm start?

Is this correct? If so, how can I gather these files, and is that how I am supposed to use LD_LIBRARY_PATH?

These are the libraries the puppeteer docs say I should make sure I have:

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

0 Answers