0

I am recently working on a fun project in repl.it where I need to use puppeteer as a browser automation tool. And after adding this package in my repl some error showed up saying,

Failed to launch the browser process! /home/runner/WhatsAppBot/node_modules/puppeteer/.local-chromium/linux-869685/chrome-linux/chrome: error while loading shared libraries: libgobject-2.0.so.0: cannot open shared object file: No such file or directory.

When I went to check the missing dependencies, I got a huge list containing those missing libraries. As I don't have the root permission, I couldn't able to install them.

Is there any way to solve this problem?

NOTE: I tried installing some previous versions of puppeteer and chromium but didn't work out for me.

Here are some lines of my index.js

require("./server");
const pptr = require("puppeteer");

async function send() {
  const brwoser = await pptr.launch({
    //userDataDir: "./User_Data",
    headless: true,
    args: ['--no-sandbox', '--disable-setuid-sandbox'] 
  });
  const page = await brwoser.newPage();
  await page.setUserAgent(
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Safari/537.36"
  );
  await page.setViewport({ width: 1000, height: 728 });
  await page.goto("https://web.whatsapp.com");
  await page.waitForTimeout(5000);

Missing Dependencies: Here

  • Does this answer your question? [Puppeteer on Linux Azure Web Apps](https://stackoverflow.com/questions/63882559/puppeteer-on-linux-azure-web-apps) – Ken White Jun 11 '21 at 00:29
  • Repl.it has no Docker Compose system. So, it doesn't answer my question. – Eren Dexter Jun 11 '21 at 19:05

1 Answers1

0

it happens so because puppeteer is not allowed on replit, however there is a way to fix it, run your nodejs project in a bash project, example :- https://replit.com/@NinjaGubeesh/letsgo#index.js hope that helps

Celio
  • 1