Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

141
Visualizações
Puppeteer - Cannot read property 'executablePath' of undefined

Regardless what i tried , i'm always getting executablePath is undefined. Unfortunately there's not much info on this on google. It would be great anyone could let me know where to dig into deeper to solve this error. revisionInfo is returning undefined.

Error

BrowserFetcher {
  _product: 'chrome',
  _downloadsFolder: '/var/www/node_modules/puppeteer/.local-chromium',
  _downloadHost: 'https://storage.googleapis.com',
  _platform: 'linux' }
TypeError: Cannot read property 'executablePath' of undefined
    at demo1 (/var/www/filename.js:10:36)

Source Code

const puppeteer = require('puppeteer');

const demo1 = async () => {
  try {
    const browserFetcher = puppeteer.createBrowserFetcher();
    console.log(browserFetcher);
    const revisionInfo = await browserFetcher.download('970485');
    const browser = await puppeteer.launch({
      headless: false,
      executablePath: revisionInfo.executablePath,
      args: ['--window-size=1920,1080', '--disable-notifications'],
    });
    const page = await browser.newPage();
    await page.setViewport({
      width: 1080,
      height: 1080,
    });
    await page.goto('https://example.com', {
      waitUntil: 'networkidle0',
    });

    await page.close();
    await browser.close();
  } catch (e) {
    console.error(e);
  }
};

demo1();
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Based on your error message, the problem is with this line

      executablePath: revisionInfo.executablePath,

where revisionInfo is undefined, meaning this does not give you the data you want:

    const revisionInfo = await browserFetcher.download('970485');

If you really need a specific executablePath, you need to make sure that revisionInfo gets the value you want.

Otherwise, you can just remove the line executablePath: revisionInfo.executablePath, and let puppeteer use its default chromium browser.

about 4 years ago · Juan Pablo Isaza Relatório

0

Look into two things

  1. If you did a apt install chromium-browser , remove that
  2. Try run and install using a x86 server instead of ARM based Server (t4g instance by aws)

Either one of those solved my issue. The code was still the same.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda