Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

387
Vistas
Puppeteer error - Failed to launch the browser process

Error while running the following code:

here is all the code that I'm using to try download an PDF file that was created previously:

import puppeteer, { PDFOptions } from 'puppeteer';

interface Request {
  pageContent: string;
  pdfOptions?: PDFOptions;
}
class GeneratePDFFileService {
  async execute({ pageContent, pdfOptions }: Request): Promise<Buffer> {
    const browser = await puppeteer.launch ({ 
      headless: true, 
      args:['--no-sandbox'] 
    });
    const page = await browser.newPage();
    await page.setContent(pageContent);
    const pdfFileOptions = pdfOptions || {
      printBackground: true,
      format: 'a4',
      margin: {
        top: '2cm',
        left: '2cm',
        bottom: '2cm',
        right: '2cm',
      },
      preferCSSPageSize: true,
    };
    const pdf = await page.pdf(pdfFileOptions);
    await browser.close();
    return pdf;
  }
}
export { GeneratePDFFileService };

Here is the error:

application  | Error: Failed to launch the browser process! spawn /usr/bin/chromium-browser ENOENT
application  | 
application  | 
application  | TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
application  | 
application  |     at onClose (/usr/app/node_modules/puppeteer/src/node/BrowserRunner.ts:261:9)
application  |     at ChildProcess.<anonymous> (/usr/app/node_modules/puppeteer/src/node/BrowserRunner.ts:250:9)
application  |     at ChildProcess.emit (events.js:400:28)
application  |     at Process.ChildProcess._handle.onexit (internal/child_process.js:280:12)
application  |     at onErrorNT (internal/child_process.js:469:16)
application  |     at processTicksAndRejections (internal/process/task_queues.js:82:21)

Puppeteer version:
"puppeteer": "^13.1.3",

I've tried some tips in troubleshooting.md, but have no idea if I'm doing it right.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda