Hion Coding - Blogs share everything
  • HOME
  • ABOUT
  • POSTS
  • CONTACT
  • TOOLS
    CÂU HỎI VÕ ĐÀI TỐI THƯỢNG CONVERT IMAGE TO WEBP
Puppeteer not working on AWS but running locally

Puppeteer not working on AWS but running locally

Hion Coding - Blogs share everything
Admin Hion Coding Blogs vochilong.work@gmail.com
11th October 2023

AWS - Amazon Web Services

Puppeteer not working on AWS but running locally

Aws | Puppeteer not working on AWS but is running locally. - /root/retwiter/node_modules/puppeteer/.local-chromium/linux-800071/chrome-linux/chrome: error while loading shared libraries: libatk-1.0.so.0: cannot open shared object file: No such file or directory

Original answer link StackOverflow: Here answer

If you have a problem with this /root/retwiter/node_modules/puppeteer/.local-chromium/linux-800071/chrome-linux/chrome: error while loading shared libraries: libatk-1.0.so.0: cannot open shared object file: No such file or directory

You can add AWS Elastic Beanstalk configuration files (.ebextensions) to your web application's source code to configure your environment and customize the AWS resources that it contains.

In our case, if we don't enable EPEL and if we continue installing Chromium as part of the npm install, Puppeteer cannot launch Chromium due to the unavailability of libatk-1.0.so.0.

Hotfix

Add the following to your app root

  1. Create a .npmrc file.
  2. Add the following to your .npmrc file: 
    unsafe-perm=true
    The .npmrc file defines how npm should behave when running commands. Setting unsafe-perm to true suppress the UID/GID switching when running package scripts. Set the unsafe-perm flag to run scripts with root privileges. Source unsafe-perm
  3. Create a .ebextensions folder.
  4. Inside .ebextensions folder, create a 01_enableEPEL.config file and add the following.
    commands:
      01_enableEPEL:
        command: sudo amazon-linux-extras install epel -y

     

  5. Inside .ebextensions folder, create a 02_installEPELPackages.config file and add the following.
    packages:
      yum:
        chromium: []

 

You can view the same guide on GitHub @
https://github.com/amarinediary/Marionette


The list of articles is being updated!!!
Hion Coding - Blogs share everything


© 2025 Hion Coding DMCA.com Protection Status