How to specify Chrome executable path when starting Puppeteer

I’m trying to get Puppeteer working on my machine but running into issues with the Chrome browser startup process. Every time I attempt to initialize a new browser instance, it fails to locate the Chrome executable properly.

I’ve been searching through the documentation but I’m still confused about the right way to configure the executable path. My Chrome is installed in a custom directory and I think that might be causing the problem.

Has anyone dealt with this before? What’s the proper method to tell Puppeteer where to find the chrome.exe file on Windows? I need to make sure I’m setting up the browser launch options correctly.

Any help or code examples would be really appreciated since I’ve been stuck on this for a while now.

Honestly, all these manual path configs and environment detection scripts are just band-aids.

I dealt with the same Chrome executable nightmares across different servers and dev machines. Works locally, then deployment breaks because the path’s different. Or Chrome updates and moves.

After wasting hours maintaining these setups, I switched to Latenode. No Chrome installs to manage, no executable paths to debug, no version compatibility issues. Just automation that works everywhere.

They handle browser management completely, so you build scraping logic instead of fighting infrastructure problems. Way more reliable than hoping Chrome stays put across environments.

I set up a config object at the top of my project that handles different environments automatically. Instead of manually checking folders or hardcoding paths, I use a fallback chain - first detect the OS, then check if CHROME_BIN environment variable exists (great for CI/CD), then default to common install paths. Saved me tons of deployment headaches.

Watch out for Chrome vs Chromium paths though. I wasted hours debugging because I pointed to an old Chromium install missing features Puppeteer needed. Also, antivirus software can block Puppeteer from launching Chrome even with the correct path. If you’re still getting failures after fixing the executable path, try temporarily disabling real-time scanning.

Just use chrome-launcher instead of manually figuring out paths. It finds Chrome automatically on any OS and handles all the detection stuff for you. Way easier than building custom fallback chains or dealing with env variables.

yeah, i had the same issue a few months back! instead of hardcoding the path in your script, try setting the PUPPETEER_EXECUTABLE_PATH env variable. just point it to where your chrome is installed, and puppeteer should grab it all by itself. works like a charm on win 11.

Had this same issue when I moved our test environment to a locked-down corporate setup - Chrome wasn’t in its usual spot. Sure, you can use executablePath in your launch config, but don’t hardcode the path. I built a small utility that checks the common Chrome install folders on Windows (Program Files, Program Files x86, AppData) and falls back to default if it strikes out. Way cleaner than hardcoding paths everywhere. Quick tips: escape your backslashes properly or just use forward slashes - Windows doesn’t care and it’s less hassle. Also, check if chrome.exe actually exists at that path before feeding it to Puppeteer. Trust me, the error messages are garbage if the executable isn’t there.

Been there - Puppeteer configs across different environments are a pain.

Quick fix is adding executablePath to your launch options:

const browser = await puppeteer.launch({
  executablePath: 'C:\\path\\to\\your\\chrome.exe'
});

But this breaks when you deploy elsewhere or share code. You’re stuck hardcoding paths and dealing with OS differences.

I stopped fighting this and moved my scraping to Latenode. No more Chrome installs, executable paths, or infrastructure headaches. They handle browser management so you can just build your automation logic.

Much cleaner than maintaining Puppeteer setups everywhere.

Check it out at https://latenode.com