FareedR
2 months ago
245
0
Laravel

Error on Spatie/Browsershot

Posted 2 months ago by FareedR

I already put puppeteer on global. But I still get this error . I google it still no luck . " No such file or directory ". The long error said "Exit Code: 1(General error)↵↵Working directory: MyPC/project/public↵↵Output:↵================↵↵↵Error Output:↵================↵{ Error: ENOENT: no such file or directory, open '/MyPC/project/storage/app/public/invoice/394787d3-c3fd-44cf-90a8-7bd9bcb60e1d/invoice_2020_3.pdf'↵ -- ASYNC --↵ at Page. "

The command "PATH=$PATH:/usr/local/bin NODE_PATH=


// Current Code
Browsershot::url(route('invoice',[$seller_id, $month, $year]))
        ->setNodeBinary(env('NODE_PATH'))
        ->setNpmBinary(env('NPM_PATH'))
        ->setOption('landscape', true)
        ->margins(10, 10, 10, 10)
        ->showBackground()
        ->emulateMedia("screen")
        ->format('A4')
        ->save(storage_path('app/public').'/invoice/'.$seller_id.'/'."invoice_".$year.'_'.$month.'.pdf');

Please sign in or create an account to participate in this conversation.