Issue
I'm running Puppeteer via Puphpeteer, in one of my Laravel 5.8.35 commands. It works perfectly when I run it via the console (e.g. php artisan CommandName). However, when this same command runs via the scheduled cron (via app\Console\Kernel.php), I get the following error:
Nesk\Rialto\Exceptions\Node\FatalException
Unexpected identifier
- the error line is:
$puppeteer = new Puppeteer;
A fuller code excerpt is:
<?php
namespace App\Console\Commands;
use Nesk\Puphpeteer\Puppeteer;
use Nesk\Rialto\Data\JsFunction;
use Symfony\Component\DomCrawler\Crawler;
class ScrapeRezdy extends Command{
protected $signature = 'SomeCommand';
protected $description = 'Command description';
public function __construct(){parent::__construct();}
public function handle() {
$puppeteer = new Puppeteer;
$browser = $puppeteer->launch();
...
It actually worked perfectly previously via the cron on my old server, but on my new AWS server it's having the problem mentioned above. How can I fix this? Thanks
Solution
Problem was the node path, which had to be updated - public_html/vendor/nesk/rialto/src/ProcessSupervisor.php 'executable_path' => '/home/master/.nvm/versions/node/v10.17.0/bin/node'
Answered By - user6122500
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.