Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mansour_tech's avatar

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

0 likes
1 reply
tykus's avatar

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.

Please or to participate in this conversation.