I installed Spatie/Browsershot with composer and immediately got an error which is above my pay-grade... can someone please help.
use Spatie\Browsershot\Browsershot;
Browsershot::html('testing')->save('/public/assets/pdfs/example.pdf');
The command "PATH=$PATH:/usr/local/bin:/opt/homebrew/bin NODE_PATH=`npm root -g` node '/var/www/utopia/vendor/spatie/browsershot/src/../bin/browser.js' '{"url":"file:\/\/\/tmp\/112376137-0051711001687420484\/index.html","action":"pdf","options":{"path":"\/public\/assets\/pdfs\/example.pdf","args":[],"viewport":{"width":800,"height":600},"displayHeaderFooter":false}}'" failed. Exit Code: 127(Command not found) Working directory: /var/www/utopia Output: ================ Error Output: ================ sh: 1: npm: not found sh: 1: node: not found
Browsershot::html('testing')->save('/public/assets/pdfs/example.pdf')->setNodeBinary('/usr/bin/node')->setNpmBinary('/usr/bin/npm');
Same error.
I am using Docker. Is that the problem? What should I do?