Troubleshooting Puppeteer Chromium Setup & Understanding PUPPETEER_SKIP_DOWNLOAD

How can I resolve the error “Failed to set up Chromium” in Puppeteer and what does the “PUPPETEER_SKIP_DOWNLOAD” env variable do?

1 Like

I’ve had my fair share of tussles with that “Failed to set up Chromium” error in Puppeteer. But fear not, there’s a neat trick to resolve it.

Set the “PUPPETEER_SKIP_DOWNLOAD” environment variable: This little variable essentially tells Puppeteer, “Hey, don’t bother fetching Chromium during installation, I’ve got it covered.”

Just fire up your terminal, type in export PUPPETEER_SKIP_DOWNLOAD=true, hit enter, then proceed with installing Puppeteer using npm install puppeteer. Smooth sailing from there on!

Well, the classic Chromium conundrum. If the skip download trick doesn’t do the job, there’s another workaround up the sleeve.

Manually download Chromium: Sometimes, old-school methods work best. Head over to the Chromium downloads page, grab the binary that matches your setup, extract it, then set the PUPPETEER_EXECUTABLE_PATH variable to its location.

After setting up the path, run your usual npm install puppeteer command, and voilà! Puppeteer should play nice with Chromium now.

Been there, done that with the sluggish Chromium downloads. Luckily, there’s a nifty alternative to speed things up.

You can use a mirror for Chromium download, by switching to a different download source, you can sidestep the slow lane and get Chromium in a jiffy.

Simply set the PUPPETEER_DOWNLOAD_HOST environment variable to your preferred mirror URL. Once done, hit up npm install puppeteer, and watch as Puppeteer fetches Chromium at lightning speed from the new source. Smooth sailing ahead!