I used npm i puppeteer
as stated in the Documentation and I'm getting the following error:
(node:2066) UnhandledPromiseRejectionWarning: Error: Chromium revision is not downloaded. Run "npm install" or "yarn install" at Launcher.launch
when im trying this example (also from the docs):
const puppeteer = require('puppeteer'); (async () => { 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(); })();
Also in the documentation:
Note: When you install Puppeteer, it downloads a recent version of Chromium (~170MB Mac, ~282MB Linux, ~280MB Win) that is guaranteed to work with the API.
Any help would be appreciated.
node-chromium-revision allows you to easily add Chromium binaries to your project and use it for automation, testing, web scraping or just for fun.
By default, Puppeteer downloads and uses a specific version of Chromium so its API is guaranteed to work out of the box. To use Puppeteer with a different version of Chrome or Chromium, pass in the executable's path when creating a Browser instance: const browser = await puppeteer.
I only managed to fix the issue by manually installing Chromium after much searching and trying most of the suggestions:
node node_modules/puppeteer/install.js
After many attempts I finally found the answer here:
sudo npm install puppeteer --unsafe-perm=true --allow-root
As @vsync pointed out, this only works for linux
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With