Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

prerender.io headless chrome won't start

I'm trying to start prerender with headless chrome(v62) on my Centos7 sistem but it won't start. When running "node server.js" I get:

2017-11-23T08:50:08.329Z Starting Prerender

2017-11-23T08:50:08.331Z Starting Chrome

2017-11-23T08:50:08.343Z Prerender server accepting requests on port 3000

2017-11-23T08:50:08.392Z Chrome connection closed... restarting Chrome

2017-11-23T08:50:08.392Z Chrome died immediately after restart... stopping Prerender

Does anyone know what could be the cause? Thank you very much

like image 333
Vlad Suciu Avatar asked Feb 02 '26 03:02

Vlad Suciu


2 Answers

That's because you can't run Chrome as root. Try running the command "sudo node server.js" with another user.

For this you need to add that user to Sudoers, here is a great tutorial how to do that https://www.webhostinghero.com/add-a-user-to-sudoers-in-centos-linux/

like image 54
Sylaratty Avatar answered Feb 03 '26 17:02

Sylaratty


you can also add --no-sandbox to run Chrome as root.

vim $(which google-chrome)

then add --no-sandbox to the last line, make it like

exec -a "$0" "$HERE/chrome" "$@" --no-sandbox

like image 30
Dan Avatar answered Feb 03 '26 18:02

Dan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!