<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: kerion</title>
    <description>The latest articles on DEV Community by kerion (@kerion7).</description>
    <link>https://dev.to/kerion7</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F173962%2F45b46fed-ce78-42e9-9f82-ee66d82396cb.jpeg</url>
      <title>DEV Community: kerion</title>
      <link>https://dev.to/kerion7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kerion7"/>
    <language>en</language>
    <item>
      <title>Run Puppeteer/Chrome Headless on EC2 Amazon Linux AMI</title>
      <dc:creator>kerion</dc:creator>
      <pubDate>Tue, 09 Jul 2019 16:08:22 +0000</pubDate>
      <link>https://dev.to/kerion7/run-puppeteer-chrome-headless-on-ec2-amazon-linux-ami-2ae8</link>
      <guid>https://dev.to/kerion7/run-puppeteer-chrome-headless-on-ec2-amazon-linux-ami-2ae8</guid>
      <description>&lt;p&gt;— augmented on June 2019&lt;/p&gt;

&lt;p&gt;This article is based closely on MockingBot’s &lt;a href="https://medium.com/mockingbot/run-puppeteer-chrome-headless-on-ec2-amazon-linux-ami-6c9c6a17bee6" rel="noopener noreferrer"&gt;article of the same title&lt;/a&gt;. The original article helped a great deal, but some parts were outdated due to new libraries’ and packages’ versions. Hence, I’m jotting down what needs to be augmented from the original article here, for my own reference and for others who encounter the same situation too!&lt;/p&gt;

&lt;p&gt;When you have reached this part of the article:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Now only 6 left, as Amazon Linux don’t have gtk builtin, we need borrow packages from other distributions:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Pay heed that some of the packages no longer exist.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwa7eryjb617a7c0af8tn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwa7eryjb617a7c0af8tn.png" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tip 💡: Go to the URL (up till the last trailing slash)
&lt;/h2&gt;

&lt;p&gt;For example, for:&lt;br&gt;
&lt;a href="http://mirror.centos.org/centos/7/os/x86_64/Packages/atk-2.22.0-3.el7.x86_64.rpm" rel="noopener noreferrer"&gt;http://mirror.centos.org/centos/7/os/x86_64/Packages/atk-2.22.0-3.el7.x86_64.rpm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Navigate to:&lt;br&gt;
&lt;a href="http://mirror.centos.org/centos/7/os/x86_64/Packages/" rel="noopener noreferrer"&gt;http://mirror.centos.org/centos/7/os/x86_64/Packages/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And search for &lt;strong&gt;atk-&lt;/strong&gt; :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy5kr3d84beli9711wrro.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy5kr3d84beli9711wrro.png" alt="Perhaps by the time you read this article, the version have increased again!" width="800" height="226"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hence, the nearest match would be &lt;strong&gt;atk-2.28.1–1.el7.x86_64.rpm&lt;/strong&gt; .&lt;/p&gt;

&lt;p&gt;Go through the list of items to install with this technique, and you should be almost there!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Almost.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvbcj11zpz8wjp6qc492d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvbcj11zpz8wjp6qc492d.png" alt="Unlike what’s mentioned, there are still missing deps after installing the list of packages!" width="800" height="262"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alas, there are still some missing dependencies being listed when you run &lt;code&gt;ldd chrome | grep not&lt;/code&gt; . After googling around, &lt;a href="https://github.com/GoogleChrome/puppeteer/issues/391#issuecomment-325420271" rel="noopener noreferrer"&gt;this seals the deal&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqrp33l117rpiv9e0lol0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqrp33l117rpiv9e0lol0.png" alt="The number of emojis speak volumes about this comment!" width="800" height="672"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fstvgofjwhgv9rv2v9h40.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fstvgofjwhgv9rv2v9h40.png" alt="After the long yum install, one last dep!" width="800" height="159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After running the long &lt;code&gt;yum install&lt;/code&gt; command, you will be left with one last dependency: &lt;strong&gt;libpng12.so.0&lt;/strong&gt; . Same thing, look for the &lt;strong&gt;x86_64&lt;/strong&gt; version of the libpng12 package in the Centos packages listing page and download it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9bzr1dut7fuo1d6iusso.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9bzr1dut7fuo1d6iusso.png" width="800" height="133"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And finally, all the dependencies have been assembled.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdbcfwkwk0w14tljdhqbq.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdbcfwkwk0w14tljdhqbq.gif" width="498" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Ending note
&lt;/h2&gt;

&lt;p&gt;Hopefully the tips mentioned above will/have helped in your attempt to install Puppeteer on the AMI! If there are any parts that are unclear here, and it is also unclear in the original post, do give a shoutout. Similarly, if you have tried and noticed my tips are outdated, do let me know too.&lt;/p&gt;

</description>
      <category>headless</category>
      <category>puppeteer</category>
      <category>aws</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
