gwuhaolin / chrome-render

general server render base on headless chrome
95 stars 10 forks source link

No Chrome environment, please install Chrome 59+! #18

Open GavinFreedom opened 6 years ago

GavinFreedom commented 6 years ago

I already have chrome installed on the server [root@izj6c1h8vqjcmblprak6fvz chrome-render]# chrome --version Google Chrome 66.0.3359.117

However, when the project is running, it prompts Error: chrome-render timeout at Object. (/data/www/novel-nodeServer/node_modules/chrome-render/index.js:6:28) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object. (/data/www/novel-nodeServer/node_modules/express-middleware-seo/core.js:2:22) at Module._compile (module.js:652:30) No Chrome environment, please install Chrome 59+!

How can I solve it?

gwuhaolin commented 6 years ago

chrome location is resolved by chrome-finder, the resolve logic is here https://github.com/gwuhaolin/chrome-finder/tree/master/lib

where your chrome bin store?

GavinFreedom commented 6 years ago

I created several soft links for chrome [root@izj6c1h8vqjcmblprak6fvz bin]# ll /usr/bin/ | grep chrome lrwxrwxrwx 1 root root 31 Apr 27 14:36 chrome -> /etc/alternatives/google-chrome lrwxrwxrwx 1 root root 31 Apr 27 21:32 chromeRender -> /etc/alternatives/google-chrome lrwxrwxrwx 1 root root 31 Apr 27 19:16 chromium -> /etc/alternatives/google-chrome lrwxrwxrwx 1 root root 31 Apr 27 12:23 google-chrome -> /etc/alternatives/google-chrome lrwxrwxrwx 1 root root 32 Apr 27 12:23 google-chrome-stable -> /opt/google/chrome/google-chrome

GavinFreedom commented 6 years ago

I execute console.log(installations) in /chrome-finder/lib/linux.js

The output is as follows: [ '/usr/bin/chromium-browser', '/usr/bin/google-chrome-stable', '/usr/bin/google-chrome-stable', '/usr/bin/google-chrome-stable', '/usr/bin/google-chrome-stable', '/usr/bin/google-chrome', '/usr/bin/chromium' ]