Z
Z
Zimaell2019-08-06 15:03:23
PHP
Zimaell, 2019-08-06 15:03:23

How to properly install nesk/puphpeteer (Ubuntu, PHP)?

The instructions are simple

composer require nesk/puphpeteer
npm install @nesk/puphpeteer

but after using simple example
require('vendor/autoload.php');
use Nesk\Puphpeteer\Puppeteer;
$puppeteer = new Puppeteer;
$browser = $puppeteer->launch();

Gives me an error
Parse error: syntax error, unexpected '?' in /var/www/html/vendor/nesk/puppeteer/src/Puppeteer.php on line 60

See what's in that line
private function currentPuppeteerVersion(string $nodePath): ?string {

Tell me what should I do in this case?
PHP 7.2, Ubuntu 0.16.04.5

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question