I'm getting 500 response code from browsershot package
<?php
// Report all errors
error_reporting(E_ALL);
ini_set('display_errors', 1);
include_once('vendor/autoload.php');
use Spatie\Browsershot\Browsershot;
// an image will be saved
Browsershot::url('https://google.com')->save('example.pdf');
?>
Fatal error: Uncaught Symfony\Component\Process\Exception\ProcessFailedException: The command "PATH=$PATH:/usr/local/bin NODE_PATH=
npm root -gnode '/home/www/html/developementsec.com/browsershotnew/src/../bin/browser.js' '{"url":"https://google.com","action":"pdf","options":{"path":"example.pdf","args":[],"viewport":{"width":800,"height":600}}}'" failed. Exit Code: 8(Unknown error) Working directory: /home/www/html/developementsec.com/browsershotnew Output: ================ Error Output: ================ /usr/lib/node_modules/npm/lib/config/cmd-list.js:113 module.exports.aliases = Object.assign({}, shorthands, aaffordances) ^ TypeError: Object function Object() { [native code] } has no method 'assign' at Object. (/usr/lib/node_modules/npm/lib/config/cmd-list.js:113:33) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (modul in /home/www/html/developementsec.com/browsershotnew/src/Browsershot.php on line 663