30

I'm using a Puppeteer module to scrape some data using Node.js. It was working fine on my Macbook but when I deployed the build on an AWS EC2 instance and hit the route that was scraping data it started throwing an error:

error while loading shared libraries: libgbm.so.1: cannot open shared object file

Dave Mackey
  • 4,306
  • 21
  • 78
  • 136
ImFarhad
  • 2,669
  • 2
  • 18
  • 30

1 Answers1

75
sudo apt-get update
sudo apt-get install -y libgbm-dev

Above command fixed my problem. While doing some research on this issue I also found some other useful links which might help someone.

Answer which helped me
Official Puppeteer Github Guide for different Platforms
Medium Tutorial

ImFarhad
  • 2,669
  • 2
  • 18
  • 30
  • 1
    The "guide" link points to the same place as the "answer" link. – tremby Nov 02 '21 at 21:22
  • Though this is related to Amazon Linux, I don't know why this answer mentioned about apt-get which can be available in debian. CentOS base Amazon Linux won't be able to use apt-get to pull package... – Yuki Tanaka Dec 27 '21 at 08:30
  • 12
    You just need to install `libgbm1`, installing `libgbm-dev` is overkill. – rdb May 17 '22 at 08:45