Puppeteer deployment folder for AWS Elastic Beanstalk (64bit Linux 2 Node.js 14 environment) using AWS/GitHub Code Pipeline (Optional).
Related to Puppeteer troubleshooting documentation, Running Puppeteer on AWS EC2 instance running Amazon-Linux and Chrome is downloaded but fails to launch on Node.js 14 issues.
- Elastic Beanstalk environement
- Backward compatibility
- Quick start
.npmrc
file.ebextensions
folder- Deployment folder structure
- Dumb mistakes
- Related GitHub Puppeteer tickets
- | Parameters |
---|---|
Platform | Node.js |
Platform branch | Node.js 14 running on 64bit Amazon Linux 2 |
Tested up to platform version | 5.4.8 (Recommended) |
This deployment folder has been successfully tested with AWS Elastic Beanstalk on a Node.js 12 running on 64bit Amazon Linux 2
environement.
Clone this repository, and use it as your deployement folder:
git clone https://github.com/amarinediary/Puppeteer-AWS-Elastic-Beanstalk-Deployment-Hotfix.git
Initiate your new project and install dependencies:
npm init --y
npm i puppeteer --save
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.
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 (Extra Packages for Enterprise Linux) and if we continue installing chromium as part of npm
package install, Puppeteer cannot launch Chromium due to the unavailability of libatk-1.0.so.0
.
app/
├── .ebextensions/
│ ├── 01_enableEPEL.config
│ └── 02_installEPELPackages.config
├── .npmrc
...
If your deployment isn't working you should always try to look at the log file from your Elastic Beanstalk environment. A common mistake is packages mismatch between your local environment and your Elastic Beanstalk environment. Make sure both environment match.
- libdbus-1.so.3: no version information available
- Failed to launch chrome
- Puppeteer not installing on AWS ElasticBeanstalk instance
- Could not find browser on Elastic Beanstalk AWS
- Headless Chromium with Puppeteer doesn't work on Amazon Linux AMI
We made your day? Give us a star!