Puppeteer

Installing dependencies to get Puppeteer 1.0 running on Ubuntu 16.04

When trying to run Puppeteer 1.0 within your Node.JS scripts on an Ubuntu 16.04 box and you keep getting messages (but not limited to) like:

  • error while loading shared libraries: libX11-xcb.so.1: cannot open shared object file: No such file or directory
  • error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory
  • error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory
  • error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

Getting Puppeteer 1.0 running on Ubuntu 16.04 requires a few dependencies installed before you can use it within your Node.JS scripts. These dependencies are specifically listed on the Puppeteer troubleshooting page and also outlined in the error message returned after running the command. We could, in theory, install those dependencies one-by-one, but to get up and running very quickly you can install the libgtk-3.0 package to get many of the dependencies taken care of.

For those who are a bit lazy and want the apt-get code to get up and running use the following:

  1. sudo apt-get install libgtk-3.0 libasound2 libnss3 libxss1

Assumptions

The above worked for me on my Linode default Ubuntu 16.04.2 image and also on my development Vagrant box which uses a bare-bones Ubuntu cloud image .  I’m sure results will vary for others, but the above command took care of all my dependencies to get started.

Farmer

Share
Published by
Farmer
Tags: vagrant

Recent Posts

Changing the Facebook “tr” endpoint to send Facebook Events to another URL (GTM Server-Side – Conversion API)

As a caveat this is an **unofficial** way of achieving this as of this article's…

3 years ago

Facebook Business Manager Verification – “Start Verification” Button Disabled!?

There are many benefits to verify your Business Manager on Facebook; however, it is not…

5 years ago

Adding the Facebook Pixel to a GTM AMP Container

One issue when adding the Facebook pixel to a Google Tag Manager AMP container is…

6 years ago

API Rate-Limiting with Lumen 5.6 and Illuminate Routing/ThrottleRequests Class

Off the back of this article, there could be some potential improvements to make the…

6 years ago

How to use the Facebook img tag to fire pixel events

Before implementing the img tag, the previous article should be reviewed: it discusses some of…

6 years ago