title: getting error DeprecationWarning: Unhandled promise rejections are deprecated. in node js
body: <p>i have create <code>test.js</code> file, and installed one npm library, when i run the file i am getting below error, i tried to use <code>npm i puppeteer</code> this library but i am getting error when i tried to install it, so i used this library <code>npm i puppeteer-core</code></p>
  
  <pre><code>(node:30075) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
  (node:30075) [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.
  </code></pre>
  
  <p>here is my full code for test.js file</p>
  
  <p>const puppeteer = require('puppeteer-core');</p>
  
  <pre><code>(async () =&gt; {
    const browser = await puppeteer.launch();
    const page = await browser.newPage();
    await page.goto('https://example.com');
    await page.screenshot({path: 'example.png'});
    await browser.close();
  })();
  </code></pre>
  
  <p>can anyone please help me why i am getting this error ?</p>