puppeteer: Error: Failed to launch chrome! spawn /app/node_modules/puppeteer/.local-chromium/linux-609904/chrome-linux/chrome ENOENT
Steps to reproduce
Tell us about your environment:
- Puppeteer version: 1.11.0
- Platform / OS version: MAC 10.14.3
- URLs (if applicable):
- Node.js version: v8.9.4
I have been trying to get my Node application, using Puppeteer as the testing framework to run via docker. It works perfectly well when running locally on my. However when running via container I keep running into the same issue.
I have tried almost every boiler-plate Dockerfile I have seen from other users online but none of them can address the issue Im seeing.
Error: Failed to launch chrome! spawn /app/node_modules/puppeteer/.local-chromium/linux-609904/chrome-linux/chrome ENOENT
When I see other people with this issue they all seem to show different linux versions and not the specific one I am seeing after download: linux-609904. What is the best way to audit whats wrong with this version?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 32
- Comments: 24 (1 by maintainers)
@arapocket Thanks for commenting—I forgot to follow up after I found a solution. It’s been a couple of weeks so I don’t remember exactly which change fixed it, but here’s the configuration I’m running:
In my Dockerfile I have
And then to launch the browser
I also locked puppeteer to 1.17.0 in my package.json. I think that was to make the chromium and puppeteer versions match.
Thanks, this really helps a lot! Now, I can run puppeteer on my aws eb.
The only thing that needs to be fixed is to set the RUN options with
--no-cache
, instead of--nocache
.I have no idea why do we need these packages
udev ttf-freefont git
, so I remove them and only install thechromium
. It works fine anyway.I’m running puppeteer on
node:12-alpine
. After building the container, I’ve been shelling into it withdocker run -ti [container] /bin/sh
. I can then see that there is indeed a binary at/home/node/node_modules/puppeteer/.local-chromium/linux-674921/chrome-linux/chrome
, but if I try to run it, I get the error/bin/sh: ./chrome: not found
, which matches up with the ENOENT error that I get from puppeteer. I’ll follow up here if I find a solution, but I just wanted to point out that it might not be a failed download in case anyone else comes across this.I have the same issues, but hasn’t resolved yet with this solution 😦
I have meet the same error when using prerender-spa-plugin inside docker
Failed to launch chrome! spawn /web/node_modules/prerender-spa-plugin/node_modules/puppeteer/.local-chromium/linux-624492/chrome-linux/chrome ENOENT
And here is the result of
/web/node_modules/prerender-spa-plugin/node_modules/puppeteer/.local-chromium/linux-624492/chrome-linux
MEIPreload/ icudtl.dat locales/ natives_blob.bin xdg-mime chrome-wrapper libEGL.so nacl_helper product_logo_48.png xdg-settings chrome_100_percent.pak libGLESv2.so nacl_helper_bootstrap resources/
chrome_200_percent.pak libclearkeycdm.so nacl_irt_x86_64.nexe resources.pak
For those who do not have access to puppeteer options (like when using a package where puppeteer is a dependency), you can use the following solution with variable PUPPETEER_EXECUTABLE_PATH
Working example here: https://github.com/hardisgroupcom/sfdx-hardis/blob/main/Dockerfile
I shelled into docker to try that and I got the same issue as well. EDIT: I’m on node:10-alpine for reference
@ben-turner Thank you very much,
I had exactly the same issue, getting a:
Error: Failed to launch chrome! spawn /builds/dev/ui/frontend/node_modules/puppeteer/.local-chromium/linux-674921/chrome-linux/chrome ENOENT
when trying to run integration tests via Puppeteer in a Docker container (node:12-alpine) for my project’s CI (on Gitlab).Running chromium from
/usr/bin/chromium-browser
instead of using Puppeteer’s chromium installation path solved it !@AdamBD the
ENOENT
error means there’s no executable file on your file system; you probably skipped or aborted chromium download.Have you tried our docker container? We run our own tests in a docker container and they work just fine.
Hope this helps
I’m having this problem running Puppeteer inside Digital Ocean Ubuntu
Late to the party, but Puppeteer has a section in the docs on how to run on Alpine docker.
https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-on-alpine
Hey everyone, I had the same issue today in my Node JS app running inside
node:12.16.3-alpine
image. I tried @ben-turner solution and I just wanted to point out that instead of--nocache
consider using--no-cache
since it gave me an error pointing it out. Context: In theapk add --no-cache
@artur79 Sorry for the confusion, eventually I didn’t, because grover does not support overriding the package name and it’s required based on puppeteer’s doc:
const puppeteer = require('puppeteer-core');
. So I ended up settingPUPPETEER_SKIP_CHROMIUM_DOWNLOAD
env var + usingchromium
alpine package + passingexecutable_path: '/usr/bin/chromium-browser'
to grover config and it worked well for me.@bboydflo I use puppeteer with ruby and unoconv on apline. Here is Dockerfile I use: https://gist.github.com/knapo/3c146ff45da43822edabd6f46bfd3f39. If you don’t need ruby you can probably use pure alpine as a base.
Additionally, I have
executablePath
(puppeteer’s config) set to/usr/bin/chromium-browser
I’m using puppeteer and grover on alpine and was also getting:
Installing chromium from alpine packages and custom
executablePath
(alsoexecutable_path
option in grover) solved the issue.Instead
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD
env var, I usedpuppeteer-core
package.Thanks for the hints!