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 not working on Ubuntu 16.04 but works on 14.04 #404

Closed
ageorgios opened this issue Aug 19, 2017 · 4 comments
Closed

puppeteer not working on Ubuntu 16.04 but works on 14.04 #404

ageorgios opened this issue Aug 19, 2017 · 4 comments

Comments

@ageorgios
Copy link

I have the same nodejs project running on 16.04 and 14.04
on 16.04 fails with:

Error: Failed to connect to chrome!
    at Function.launch (/home/ageorgios/c9/projects/scrapi/node_modules/puppeteer/lib/Launcher.js:96:13)
    at process._tickDomainCallback (internal/process/next_tick.js:135:7)

Please help.

@ebidel
Copy link
Contributor

ebidel commented Aug 19, 2017

Please include your node version and code that repros the issue.

@alex88
Copy link

alex88 commented Aug 20, 2017

@ebidel brand new ubuntu 16.04 VM on GCE, fully updated, nodejs 8 installed from nodesource/distributions

ubuntu@rend:~/test⟫ node -v
v8.4.0
ubuntu@rend:~/test⟫ npm -v
5.3.0
ubuntu@rend:~/test⟫ npm install --save puppeteer

> [email protected] install /home/ubuntu/test/node_modules/puppeteer
> node install.js

Downloading Chromium r494755 - 92.1 Mb [====================] 100% 0.0s
npm WARN saveError ENOENT: no such file or directory, open '/home/ubuntu/test/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/ubuntu/test/package.json'
npm WARN test No description
npm WARN test No repository field.
npm WARN test No README data
npm WARN test No license field.

+ [email protected]
added 36 packages in 13.051s
ubuntu@rend:~/test⟫ node -e "(async () => { try { browser = await require('puppeteer').launch(); } catch (e) { console.error(e); } })();"
Error: Failed to connect to chrome!
    at Function.launch (/home/ubuntu/test/node_modules/puppeteer/lib/Launcher.js:96:13)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

Update: same with node 7.10.1 installed from nodesource/distributions
Update 2: might be wrong but trying to run chrome gives: error while loading shared libraries: libpangocairo-1.0.so.0: cannot open shared object file: No such file or directory
Update 3: solved by installing sudo apt-get install libpangocairo-1.0-0 libx11-xcb1 libxcomposite1 libxcursor1 libxdamage1 libxi6 libxtst6 libnss3 libcups2 libxss1 libxrandr2 libgconf2-4 libasound2 libatk1.0-0 libgtk-3-0

@ageorgios above command works, however it's plenty of stuff to install

@ageorgios
Copy link
Author

@alex88
That was it thank you!!

@nsuhanshetty
Copy link

nsuhanshetty commented Mar 12, 2019

Started working after I updated the node version (used nvm to do that).

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

No branches or pull requests

4 participants