I'm building a UI-automator with Puppeteer and I'm shipping it as a Electron-packaged app. It works nice-and-smooth except for this issue:
Chromium is not downloaded
exception is thrown when the app is executed on a platform different than the one the app has been packaged on.
Better said, I'm developing on a Linux environment and I'm packaging my app for both Linux and Windows, Linux app works fine, Windows app doesn't.
The problem is: Chromium is downloaded at npm install
time, and it's done selectively based on the current platform. Being current platform Linux, this very version of Chromium is then shipped regardlessly on every platform's app.
I should be able to do one of the following:
The problem is I haven't found any Puppeteer configuration I can use for such purpose.
Thanks
The Chromium download is done by node_modules/puppeteer/install.js
during npm install. You could call this code from your application's build scripts. For example:
const Downloader = require('puppeteer/lib/Downloader');
const revision = require('puppeteer/package').puppeteer.chromium_revision;
Downloader.createDefault().downloadRevision('win64', revision, () => undefined)
.then(() => { console.log('Done!') })
.catch(err => { console.log('Error', err) })
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