Puppeteer executablePath returns non-existant path for firefox when PUPPETEER_PRODUCT = "firefox"
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: 5.2.0
- Platform / OS version: Docker,
FROM node:12.18(stretch) - URLs (if applicable):
- Node.js version: 12.18
What steps will reproduce the problem?
For the dockerfile,
FROM node:12.18
WORKDIR /app
COPY package*.json ./
RUN npm ci
# To get Firefox too. This will not be needed once puppeteer firefox exits beta
RUN cd node_modules/puppeteer && PUPPETEER_PRODUCT=firefox node install.js
COPY . .
For the test,
index.js
const [chromePath, firefoxPath] = (() => {
const oldEnvVar = "" + process.env.PUPPETEER_PRODUCT;
process.env.PUPPETEER_PRODUCT = "chrome";
const CHROME_BIN = puppeteer.executablePath();
// puppeteer.executablePath() points to an
// unexistent installation pathpuppeteer.executablePath
process.env.PUPPETEER_PRODUCT = "firefox";
const FIREFOX_BIN = puppeteer.executablePath();
process.env.PUPPETEER_PRODUCT = oldEnvVar;
return [CHROME_BIN, FIREFOX_BIN];
})();
console.log(firefoxPath);
Please include code that reproduces the issue.
docker build --tag bug .See that the output will be something like
Step 11/12 : RUN cd node_modules/puppeteer && PUPPETEER_PRODUCT=firefox node install.js
---> Running in f6ad952bd0bc
Requesting latest Firefox Nightly version from https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central
Firefox Nightly (81.0a1) downloaded to /app/node_modules/puppeteer/.local-firefox/linux-81.0a1
docker run -it bug node .See that the path is
/app/node_modules/puppeteer/.local-firefox/linux-768783/firefox/firefox
What is the expected result? They should be the same
What happens instead?
They are not the same
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
Can't launch firefox · Issue #5376 · puppeteer ... - GitHub
I tried with 2.1.0 but it doesn't work. const browser = await puppeteer.launch({'headless': false, 'product': 'firefox'}) From Puppeteer ...
Read more >how do you install and run puppeteer for firefox - Stack Overflow
I had a similar issue, the command you have to run is actually the following: PUPPETEER_PRODUCT=firefox npm i puppeteer.
Read more >mozilla-central: changeset 534188 ...
To use Puppeteer with a different version of Chrome or Chromium, pass in the executable's path when creating a `Browser` instance: ```js ...
Read more >Browser Launchers: Puppeteer - Modern Web
Run tests using Puppeteer, using a bundled version of Chromium or Firefox ... launchOptions: { executablePath: '/path/to/executable', headless: false, ...
Read more >FAQ | Puppeteer
The Puppeteer team needs input from users to stabilize Firefox support and to bring missing APIs to ... by default the Chromium executable...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

No further reply from reporter for more than a year. Closing issue.
We’re marking this issue as unconfirmed because it has not had recent activity and we weren’t able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.