From b9667f93312606da709e8c5409203169e647dd24 Mon Sep 17 00:00:00 2001 From: Jack Franklin Date: Thu, 9 Jul 2020 12:32:49 +0100 Subject: [PATCH] chore: document browser install breakage on Node 14.0.0 (#6187) --- docs/troubleshooting.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 3c50fc53..2a2b0034 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -3,6 +3,7 @@ - [Chrome headless doesn't launch on Windows](#chrome-headless-doesnt-launch-on-windows) - [Chrome headless doesn't launch on UNIX](#chrome-headless-doesnt-launch-on-unix) +- [Chrome is downloaded but fails to launch on Node.js 14](#chrome-is-downloaded-but-fails-to-launch-on-nodejs-14) - [Setting Up Chrome Linux Sandbox](#setting-up-chrome-linux-sandbox) * [[recommended] Enable user namespace cloning](#recommended-enable-user-namespace-cloning) * [[alternative] Setup setuid sandbox](#alternative-setup-setuid-sandbox) @@ -130,6 +131,18 @@ yum update nss -y - [#379](https://github.com/puppeteer/puppeteer/issues/379) - Alpine troubleshooting
+## Chrome is downloaded but fails to launch on Node.js 14 + +If you get an error that looks like this when trying to launch Chromium: + +``` +(node:15505) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process! +spawn /Users/.../node_modules/puppeteer/.local-chromium/mac-756035/chrome-mac/Chromium.app/Contents/MacOS/Chromium ENOENT +``` + +This means that the browser was downloaded but failed to be extracted correctly. The most common cause is a bug in Node.js v14.0.0 which broke `extract-zip`, the module Puppeteer uses to extract browser downloads into the right place. The bug was fixed in Node.js v14.1.0, so please make sure you're running that version or higher. Alternatively, if you cannot upgrade, you could downgrade to Node.js v12, but we recommend upgrading when possible. + + ## Setting Up Chrome Linux Sandbox In order to protect the host environment from untrusted web content, Chrome uses [multiple layers of sandboxing](https://chromium.googlesource.com/chromium/src/+/HEAD/docs/linux/sandboxing.md). For this to work properly,