Reputation: 139
I 'm trying to generate a PDF using the below code:
$content = view('bills.show', ['bill' => $bill])->render(); return Browsershot::html($content)->setNodeBinary('C:/PROGRA~1/nodejs/node.exe')->pdf();
however i am getting this error (attaching full stack trace as well):
Symfony\Component\Process\Exception\ProcessFailedException The command "C:/PROGRA^~1/nodejs/node.exe ^"C:^\Codex^\hidma-backend^\vendor^\spatie^\browsershot^\src/../bin/browser.js^" ^"^{^^"url^^":^^"file:^/^/C:^^\Users^^\alex.DFK^^\AppData^^\Local^^\Temp^^\873677827-0646160001622728448^^\index.html^^",^^"action^^":^^"pdf^^",^^"options^^":^{^^"args^^":^[^],^^"viewport^^":^{^^"width^^":800,^^"height^^":600^},^^"displayHeaderFooter^^":false^}^}^"" failed. Exit Code: 1(General error) Working directory: C:\Codex\hidma-backend\public Output: ================ Error Output: ================ [Error: ENOENT: no such file or directory, mkdtemp 'undefined\temp\puppeteer_dev_chrome_profile-XXXXXX'] { errno: -4058, code: 'ENOENT', syscall: 'mkdtemp', path: 'undefined\temp\puppeteer_dev_chrome_profile-XXXXXX' }
Upvotes: 3
Views: 2159
Reputation: 1
you need to install puppeteer Globally;
use this
npm install puppeteer --location=global
Upvotes: 0
Reputation: 449
I fixed a similar error by creating a "temp" drive (on my Windows system: C:\temp)
Upvotes: 0