Hey folks, I’m stuck with a Puppeteer issue in my Docker setup. I’m using Node.js and I’ve tried to install Chrome, but it’s not working. I keep getting an error about Chrome not being found. Here’s what it says:
Could not find Chrome (ver. 133.0.6943.98). This can occur if either
1. you did not perform an installation before running the script or
2. your cache path is incorrectly configured (which is: /root/.cache/puppeteer).
I’ve set up my Dockerfile with multiple stages. It includes installing Chrome, setting up Puppeteer, and building the app. I’ve also tried running npx puppeteer browsers install chrome.
But when I get into the container and look around, I can’t find Chrome anywhere. Any ideas what I’m doing wrong? Has anyone got Puppeteer working smoothly in a Docker container before?
I encountered a similar issue when setting up Puppeteer in a Docker environment. One solution that worked for me was using the puppeteer-core package instead of the full puppeteer. This approach allows you to use a separately installed Chrome browser.
In your Dockerfile, ensure you’re installing Chrome:
hey dude, try adding a chrome stable install in your dockerfile. run apt-get update && apt-get install -y wget gnupg, then add google’s key and repo, then apt-get update && apt-get install -y google-chrome-stable. works for me!
I’ve wrestled with this exact issue before, and it can be a real headache. The key is making sure you’re installing the right dependencies and setting the correct environment variables. Here’s what worked for me:
This installs Chromium and its dependencies, then tells Puppeteer to use the system-installed Chromium instead of downloading its own version. It solved the issue for me and might work for you too. Let me know if you need any more help!