Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Puppeteer should check platform compatibility when running #2996

Open
kingio opened this issue Jul 31, 2018 · 9 comments
Open

Puppeteer should check platform compatibility when running #2996

kingio opened this issue Jul 31, 2018 · 9 comments
Labels

Comments

@kingio
Copy link

kingio commented Jul 31, 2018

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 1.6.1
  • Platform / OS version: Ubuntu 14.04.1 LTS (i686)
  • Node.js version: 8.11.3

What steps will reproduce the problem?

  1. npm i puppeteer
const puppeteer = require('puppeteer');
const browser = await puppeteer.launch();
const page = await browser.newPage();

What is the expected result?

Working chrome

What happens instead?

(node:14901) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome! /var/www/spiderman/node_modules/puppeteer/.local-chromium/linux-575458/chrome-linux/chrome: 1: /var/www/spiderman/node_modules/puppeteer/.local-chromium/linux-575458/chrome-linux/chrome: Syntax error: word unexpected (expecting ")")

If i manually run that chrome, it says cannot execute binary file: Exec format error

@aslushnikov
Copy link
Contributor

@kingio Chromium is compiled for x86_64, which I believe is not runnable on i686.

We don't have any 32 bit builds, and there are no plans to add any. Sorry for the inconvenience.

@kingio
Copy link
Author

kingio commented Aug 3, 2018

Shouldn't puppeteer do a requirement check before installing itself? You would avoid issues like this

@aslushnikov
Copy link
Contributor

@kingio this would be nice to have; I'd be happy to review a PR.

@aslushnikov aslushnikov reopened this Aug 4, 2018
@aslushnikov aslushnikov changed the title Cannot execute binary file: Exec format error Puppeteer should check platform compatibility when installing Aug 4, 2018
@aslushnikov aslushnikov changed the title Puppeteer should check platform compatibility when installing Puppeteer should check platform compatibility when running Aug 4, 2018
@aslushnikov
Copy link
Contributor

Shouldn't puppeteer do a requirement check before installing itself?

Actually, we should rather do this in runtime on pptr.launch and only for the default binary: someone might specify custom executable path.

@mawesome4ever
Copy link

Oh wow... I've been trying to get this to work for hours... I kept thinking i had forgotten to place a parenthesis somewhere .-.

@bdurrani
Copy link

bdurrani commented Oct 6, 2018

@aslushnikov Do you mind if I take a stab at this? can you give me some pointers on were would be a good place to start? Thanks

@bdurrani
Copy link

bdurrani commented Oct 6, 2018

Looks like in node, os.arch() will return the architecture of the node process, not of the OS. See here.

Would it be safe to assume that the 32bit version of node should not be able to launch Chromium?

Otherwise, I can basically do what this library does to detect the architecture of the OS.

@akgupta0777
Copy link

what happened here still no solutions ?
I like the solution of @bdurrani but I think it will not work on all architectures and the library should be maintained regularly on every new architecture.

@OrKoN OrKoN added the confirmed label Sep 5, 2022
@Gennttii
Copy link

I am having problems with launching browser too. Can puppeteer work with 32 bit chromium by changing the executablePath :
executablePath: '/usr/bin/chromium-browser'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants