Switching to firefox won´t work until you change the environment variable PUPPETEER_PRODUCT to firefox and reinstall puppeteer and download the firefox binaries. For any default puppeteer install only the chrome binaries will exist. Please notice that I can not just create a hello world project and set product: 'firefox' because the binaries does not exist and will not automatically downloaded. How can I download firefox and chrome binaries together? That I can easily switch the product value? client = await puppeteer.launch() // or product: 'chrome' I tried to run npm update after switching the PUPPETEER_PRODUCT environment variable however this doesn´t work and nothing gets updated. It will delete the firefox binaries and only install chrome again. However when I change it back to chrome and reinstall it: npm config set PUPPETEER_PRODUCT chrome npm i puppeteer Then inside of my project I run: npm i puppeteer Configuration Puppeteer uses several defaults that can be customized through configuration files. For a version of Puppeteer without installation, see puppeteer-core. I´am able to download firefox binaries for my project by set the environment variable: npm config set PUPPETEER_PRODUCT firefox npm i puppeteer When you install Puppeteer, it automatically downloads a recent version of Chromium (170MB macOS, 282MB Linux, 280MB Windows) that is guaranteed to workwith Puppeteer.
0 Comments
Leave a Reply. |