PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, January 4, 2022

[FIXED] Unexpected identifier in Nesk/Rialto (Puppeteer)

 January 04, 2022     javascript, laravel, laravel-5, php, puppeteer     No comments   

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
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing