Server set up help - Could not find browser revision 818858. Run "PUPPETEER_PRODUCT=firefox npm install #453
Unanswered
jackkemmish
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there! First off thanks for the awesome package, it works like a dream!!
But I was wondering if someone could offer me some assistance. I am a bit of a novice and am trying to get it working on my Cloudways server but am running into an issue where it is throwing a 500 Internal Server Error.
I have it set up locally using MAMP and it's working as expected.
My code which I'm trying to run is this:
`$img_file = 'certificates/' . $param;
Browsershot::url($url)
->waitUntilNetworkIdle()
->setNodeBinary('/home/master/.nvm/versions/node/v10.18.1/bin/node')
->setNpmBinary('/home/master/.nvm/versions/node/v10.18.1/bin/npm')
->setNodeModulePath('/home/master/.nvm/versions/node/v10.18.1/lib/node_modules/')
->windowSize(1000, 1000)
->noSandbox()
->save($img_file);`
The error is as follows:
[Thu Dec 10 **:**:**.****** 2020] [proxy_fcgi:error] [pid ******:tid ******] [client **.*.***.***:*****] *******: Got error 'PHP message: PHP Fatal error: Uncaught Symfony\\Component\\Process\\Exception\\ProcessFailedException: The command "PATH=$PATH:/usr/local/bin NODE_PATH=
npm root -gnode '/home/******.cloudwaysapps.com/**********/public_html/wp-content/themes/trees-not-tees/vendor/spatie/browsershot/src/../bin/browser.js' '{"url":"https:\\/\\/wordpress-******-******.cloudwaysapps.com\\/request-certificate\\/?id=ceac78e5-54c7-4c46-a36b-033382d2481f","action":"screenshot","options":{"type":"png","path":"certificates\\/david-bone-certificate.png","args":[],"viewport":{"width":1000,"height":1000},"delay":3000,"selector":".js-certificate"}}'" failed.\n\nExit Code: 1(General error)\n\nWorking directory: /home/******.cloudwaysapps.com/**********/public_html/wp-content/themes/trees-not-tees\n\nOutput:\n================\n\n\nError Output:\n================\n/home/******.cloudwaysapps.com//**********//public_html/wp-content/themes/trees-not-tees/vendor/spatie/browsershot/bin/browser.js:20\nconst getOutput = async (page, request) => {\n ...', referer: https://wordpress-******-******.cloudwaysapps.com/certificate-new/?id=ceac78e5-54c7-4c46-a36b-033382d2481f
I have seen other issues regarding Node paths etc but I'm not sure what to do as it works fine locally.
Any guidance would be greatly appreciated!
I am running:
Thanks in advance!
Jack
UPDATE
I have set
->setNodeBinary
to->setNodeBinary('/home/master/.nvm/versions/node/v10.18.1/bin/node')
andsetNpmBinary
to->setNpmBinary('/home/master/.nvm/versions/node/v10.18.1/bin/npm')
as runningwhich node
/npm
gives me these values, but still no luck. I have also now set->setNodeModulePath('/home/master/.nvm/versions/node/v10.18.1/lib/node_modules/')
for the node modules as I rannpm install puppeteer --global
on the server.This is my new error:
[Fri Dec 11 13:24:50.557089 2020] [proxy_fcgi:error] [pid *****:tid **********] [client **.*.***.***:*****] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Symfony\\Component\\Process\\Exception\\ProcessFailedException: The command "PATH=$PATH:/usr/local/bin NODE_PATH='/home/master/.nvm/versions/node/v10.18.1/lib/node_modules/' /home/master/.nvm/versions/node/v10.18.1/bin/node '/home/******.cloudwaysapps.com/********/public_html/wp-content/themes/trees-not-tees/vendor/spatie/browsershot/src/../bin/browser.js' '{"url":"https:\\/\\/wordpress-******-*******.cloudwaysapps.com\\/request-certificate\\/?id=ceac78e5-54c7-4c46-a36b-033382d2481f","action":"screenshot","options":{"type":"png","path":"certificates\\/david-bone-certificate.png","args":["--no-sandbox"],"viewport":{"width":1000,"height":1000},"waitUntil":"networkidle0"}}'" failed.\n\nExit Code: 1(General error)\n\nWorking directory: /home/******.cloudwaysapps.com/********/public_html/wp-content/themes/trees-not-tees\n\nOutput:\n================\n\n\nError Output:\n================\nError: Could not find browser revision 818858. Run "PUPPETEER_PRODUCT=firefox npm install" or "...', referer: https://wordpress-*******-********.cloudwaysapps.com/certificate-new/?id=ceac78e5-54c7-4c46-a36b-033382d2481f
Any ideas what might be going on?
Beta Was this translation helpful? Give feedback.
All reactions