Search code examples
laravellaravel-jetstream

I can't install Jetstream: [InvalidArgumentException]Package laravel/jetstream


I can't install Jetstream to my Laravel project. When I use the command composer require laravel / jetstream, it will generate the following error:

[InvalidArgumentException]
The laravel / jetstream package has a PHP requirement incompatible with your PHP version, PHP 
extensions and
Composer version

My PHP version is 7.2.24, and my Composer version is 2.0.8.


Solution

  • Laravel Jetstream requires PHP version to be minimum 7.3 so you need to upgrade your PHP version to a minimum of 7.3. It would be better if you upgrade it to PHP 7.4 at least. As PHP 7.3 is now EOL - meaning no active support for PHP 7.3, only security fixes for one more year.

    https://www.php.net/supported-versions.php

    Laravel Jetstream also requires ext-json to be enabled for PHP. So depending upon your PHP version i.e. 7.3.x or 7.4.x or 8.x you need to install ext-json as well - php7.3-json or php7.4-json or php8.0-json