Puppeteer error: "failed to launch the browser process"

Viewed 6361

I am trying to run Puppeteer on my new laptop. However, I am getting this error:

node:8144) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
/mnt/c/Users/juliu/repos/kmj-sniper/node_modules/puppeteer/.local-chromium/linux-901912/chrome-linux/chrome: error while loading shared libraries: libatk-1.0.so.0: cannot open shared object file: No such file or directory

What am I missing here?

2 Answers

The error message can either indicate that your operating system is missing the ATK library (libatk), or that this shared library is installed in a location that Puppeteer does not know about, because it is not available from the paths specified in the environment variable LD_LIBRARY_PATH, or has a different name from what is expected.

If the ATK library is missing, what platform your laptop is running will likely determine the answer. If you are running Ubuntu, for example, you could do the following, or similar:

$ sudo apt-get install libatk-bridge2.0-0

On CentOS/RHL, perhaps:

$ sudo yum install atk.x86_64

If the required package is already installed, however, check that LD_LIBRARY_PATH includes the directory where the shared library is installed, and that the filename matches that shown in the error message returned by Puppeteer.

Delete folder node_modules (don't delete the package.json and package-lock.json files) and then run npm i.
It will essentially reinstall all your dependencies.
If that doesn’t work, then try Alex's answer.

Related