title: How to use puppeteer-core with electron?
body: <p>I got this code from another Stackoverflow Question:</p>
  
  <pre><code>import electron from "electron";
  import puppeteer from "puppeteer-core";
  
  const delay = (ms: number) =&gt;
    new Promise(resolve =&gt; {
      setTimeout(() =&gt; {
        resolve();
      }, ms);
    });
  
  (async () =&gt; {
    try {
      const app = await puppeteer.launch({
        executablePath: electron,
        args: ["."],
        headless: false,
      });
      const pages = await app.pages();
      const [page] = pages;
  
      await page.setViewport({ width: 1200, height: 700 });
      await delay(5000);
      const image = await page.screenshot();
      console.log(image);
      await page.close();
      await delay(2000);
      await app.close();
    } catch (error) {
      console.error(error);
    }
  })();
  </code></pre>
  
  <p>Typescript compiler complains about <code>executablePath</code> property of <code>launch</code> method options object cause it needs to be of type <code>string</code> and not <code>Electron</code>. So how to pass electron chromium executable path to puppeteer?</p>