
cache directory of your project directory and figure out the full path.Īdd the executablePath: of the Chrome executable to your script: const browser = await puppeteer. You can find the list on the Troubleshooting page.įind Chrome inside the. On Unix, make sure all the necessary dependencies are installed.

Latest version: 1.1.10, last published: 3 years ago. Here you can basically hit enter until the init is done. A simple NPM package to convert html to pdf for Node applications by using Puppeteer. Now Chrome will be stored inside the project directory in the. This will change the default location of Chrome to your project directory. The browser is downloaded to the HOME/.cache/puppeteer folder by default (starting with Puppeteer v19.0.0). Changes the cache location for Puppeteer.ĬacheDirectory: join(_dirname, '.cache', 'puppeteer'), pnpm i puppeteer When you install Puppeteer, it automatically downloads a recent version of Chrome for Testing (170MB macOS, 282MB Linux, 280MB Windows) that is guaranteed to work with Puppeteer. The 3rd point in Amr Hussein's answer helped me to solve a similar Problem where I got the following error, whenever I executed my script outside the project directory: throw new Error(`Could not find Chromium (rev.
