title: PhantomJS in AWS Lambda (Missing libfontconfig)
body: <p>I am trying to get my lambda function to use phantomjs, however it keeps running into an error of a missing dependency: libfontconfig / fontconfig. On my Centos VPS when I install fontconfig (dnf install fontconfig -y) my code works fine. However when running on lambda I cannot figure out how to get this library to be ran with my function.</p>
  
  <p>This is my code: (Attempting to get the best selling products through the AliExpress package, which uses phantomjs)</p>
  
  <pre><code>const aliExpress = require('aliexpress');
  
  exports.handler = (event, context, callback) =&gt; {
      console.log('Handler ran!');
      aliExpress.BestSelling.get().then((goods) =&gt; {
          console.log('Found results!');
          const urls = [];
          for(let index in goods) {
              const url = goods[index].url;
              urls.push(url);
          }
          console.log('Returning URLs:');
          console.log(urls);
          callback(null, urls);
      }).catch((err) =&gt; {
          console.log('Error:');
          console.log(err);
          callback(err);
      });
  };
  
  // For testing on VPS
  exports.handler(null, null, (err, result) =&gt; {
      if(err) {
          console.log('Err:');
          console.log(err);
      } else {
          console.log('Result:');
          console.log(result);
      }
  });
  </code></pre>
  
  <p>I am expecting the result to be an array of AliExpress URLs, this is what happens whenever I run it with fontconfig installed on my VPS. However, on my lambda function AND on my VPS without fontconfig installed I am getting this error:</p>
  
  <pre><code>Handler ran!
  (node:1966) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Error reading from stdin: Error: write EPIPE
  (node:1966) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  error: /home/function/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>I believe I now either have to 1) Figure out how to run phantomjs without this dependency or 2) Figure out how to install this dependency to my Lambda function's "server"</p>
  
  <p>Perhaps there's a previous version of phantomjs that gives me the functionality I want without this dependency? Not sure</p>
  
  <p>Anyone know how I can solve this problem? Thank you!</p>