So, puppeteer was not installed on the remote host; you are seeing the error message whenever you attempt to execute an npm command? Your VPS hosting possibly has instructions for installing Node (and NPM) otherwise you can find instructions on the Node website to suit whatever OS your remote host is running.
Aug 16, 2024
1
Level 1
using spatie/laravel-pdf
When working with the Spatie/Laravel-pdf library, it works perfectly fine locally, but when I deploy the website on a VPS hosting, I installed it using composer require spatie/laravel-pdf and npm install puppeteer, but I encounter an error, The error message you're seeing indicates that the node and npm commands are not found on your hosting environment, which is causing the PDF generation to fail. When you're using spatie/laravel-pdf, it relies on Node.js for running its dependencies, such as browsershot, which in turn uses the headless version of Chrome to generate PDF
Please or to participate in this conversation.