PuPHPeteer php bridge package unable to install on Laravel 9 - laravel
This package nesk/puphpeteer has been archived and doesn't work with Laravel 9 anymore. There are however forks that I believe will work with Laravel 9 since the dependencies in the composer errors have been updated in the forks. I tried these steps in the composer docs but can't seem to install a fork as a composer dependency. Any guidance in the right direction would be appreciated.
In my composer.json I have these new entries.
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/NigelCunningham/puphpeteer.git"
}
],
"require": {
"nesk/puphpeteer": "dev-dev"
}
}
When I run composer update I get the following error:
"Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires nesk/puphpeteer dev-dev -> satisfiable by nesk/puphpeteer[dev-dev]."
Summary
At the time of writing this post, https://github.com/NigelCunningham/puphpeteer.git isn't ready for Laravel 9.
Explanation
I tried installing it on the first stable version of Laravel v9.0.0 (composer create-project laravel/laravel example-app 9.0.0).
composer.json (new entries)
{
"repositories": [
{
"url": "https://github.com/NigelCunningham/puphpeteer.git",
"type": "git"
}
],
"require": {
"nigelcunningham/puphpeteer": "^2.0.0"
},
"minimum-stability": "dev"
}
You may need to install or enable PHP's sockets extension.
It threw the error below: composer update
Your requirements could not be resolved to an installable set of packages.
Problem 1
- symfony/process[v4.0.0-BETA1, ..., v4.4.10] require php ^7.1.3 -> your php version (8.1.6) does not satisfy that requirement.
- symfony/process[v5.0.0-BETA1, ..., v5.0.0-RC1] require php ^7.2.9 -> your php version (8.1.6) does not satisfy that requirement.
- symfony/process[v5.0.0, ..., v5.1.0-RC1] require php ^7.2.5 -> your php version (8.1.6) does not satisfy that requirement.
- Root composer.json requires laravel/framework ^9.0 -> satisfiable by laravel/framework[v9.0.0-beta.1, ..., 9.x-dev].
- Root composer.json requires nigelcunningham/puphpeteer ^2.0.0 -> satisfiable by nigelcunningham/puphpeteer[2.0.0].
- Conclusion: don't install symfony/console[v6.0.19] | install symfony/process[v5.4.19] (conflict analysis result)
- Conclusion: don't install symfony/console[v6.0.3] | install symfony/process[v5.4.19] (conflict analysis result)
- Conclusion: don't install nunomaduro/collision[v6.4.0] | install symfony/process[v5.4.19] (conflict analysis result)
- Conclusion: don't install symfony/process v5.4.19 (conflict analysis result)
- Conclusion: don't install symfony/console[v6.2.5] | install symfony/process[v5.4.19] (conflict analysis result)
- nigelcunningham/puphpeteer 2.0.0 requires nesk/rialto ^1.2.0 -> satisfiable by nesk/rialto[1.2.0, 1.2.1, 1.3.0, 1.4.0].
- nesk/rialto 1.4.0 requires symfony/process ^3.3|^4.0|^5.0 -> satisfiable by symfony/process[v3.3.0-BETA1, ..., 3.4.x-dev, v4.0.0-BETA1, ..., 4.4.x-dev, v5.0.0-BETA1, ..., 5.4.x-dev].
- nesk/rialto[1.2.0, ..., 1.3.0] require symfony/process ^3.3|^4.0 -> satisfiable by symfony/process[v3.3.0-BETA1, ..., 3.4.x-dev, v4.0.0-BETA1, ..., 4.4.x-dev].
- symfony/console 6.3.x-dev conflicts with symfony/process v5.3.14.
- symfony/console 6.3.x-dev conflicts with symfony/process v5.3.2.
- symfony/console 6.3.x-dev conflicts with symfony/process v5.0.11.
- symfony/console 6.3.x-dev conflicts with symfony/process v4.4.44.
- symfony/console 6.3.x-dev conflicts with symfony/process v4.4.26.
- symfony/console 6.3.x-dev conflicts with symfony/process v3.4.47.
- symfony/console 6.3.x-dev conflicts with symfony/process v3.3.6.
- nunomaduro/collision[v6.1.0, ..., v6.2.1] require symfony/console ^6.0.2 -> satisfiable by symfony/console[v6.0.2, ..., 6.3.x-dev].
- Root composer.json requires nunomaduro/collision ^6.1 -> satisfiable by nunomaduro/collision[v6.1.0, ..., v6.x-dev].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
If you aim your focus on this line below:
- nigelcunningham/puphpeteer 2.0.0 requires nesk/rialto ^1.2.0 -> satisfiable by nesk/rialto[1.2.0, 1.2.1, 1.3.0, 1.4.0].
The package nigelcunningham/puphpeteer requires the dependency nesk/rialto, whose latest version dev-dev requires symfony/process: ^3.3|^4.0|^5.0. Unfortunately, Laravel v9.0.0 (laravel/framework) requires symfony/process: ^6.0 making it incompatible.
Moving forward, in your question, you declared a required dependency in your composer.json file "nesk/puphpeteer": "dev-dev". This follows the same incompatibility issue with Laravel v9.0.0 as explained above.
It threw the error below: composer update
- nesk/puphpeteer dev-dev requires nesk/rialto ^1.2.0 -> satisfiable by nesk/rialto[1.2.0, 1.2.1, 1.3.0, 1.4.0].
- nesk/rialto 1.4.0 requires symfony/process ^3.3|^4.0|^5.0 -> satisfiable by symfony/process[v3.3.0-BETA1, ..., 3.4.x-dev, v4.0.0-BETA1, ..., 4.4.x-dev, v5.0.0-BETA1, ..., 5.4.x-dev].
Addendum
Comment from the OP (dfeva)
Thanks for the great answer! it looks like this nesk/rialto fork is
updated to symphony/process ^6.0.
github.com/zoonru/rialto/blob/zoon/composer.json.
How can I install that first so then I should be able to install
github.com/zoonru/puphpeteer
if im understating correctly. Thanks for your help!
To achieve that, you can use:
composer.json (new entries)
{
"repositories": [
{
"url": "https://github.com/zoonru/rialto.git",
"type": "git"
},
{
"url": "https://github.com/zoonru/puphpeteer.git",
"type": "git"
}
],
"require": {
"nesk/puphpeteer": "dev-master"
},
"minimum-stability": "dev"
}
The unfortunate news is that, at the time of writing this post, the latest git tag (Version 1.4.0 released on Apr 12, 2020) for the zoonru/rialto dependency depended on the old "symfony/process": "^3.3|^4.0|^5.0" versions.
The newer changes linked in your comment aiming at supporting new Symfony components ("symfony/process": "^3.3 || ^4.0 || ^5.0 || ^6.0") were made at a later date, Aug 16, 2022. Sadly, a newer git tag reflecting these changes hasn't been officially released yet. 😑
Temporary Solution (use with caution)
If you still insist on wanting to install zoonru/puphpeteer, you may need to fork https://github.com/zoonru/rialto and create a new git tag reflecting the newer changes that were made on the repository.
Steps
Fork the zoonru/rialto repository. Read Forking a repository.
Clone your forked version of the repository. Read Cloning a repository
Create an annotated git tag on your forked repository version. Read Create a tag in a GitHub repository
At the root path of your forked repository, open your terminal. Run the command: git tag 1.5.0 -a to create a new git tag. (Include a description with your tag. I.e: Version 1.5.0)
Push your new git tag to your remote forked repository using the command: git push origin --tags
You should now be able to see your latest git tag on your remote forked repository. I.e: https://github.com/steven7mwesigwa/rialto/tags
https://github.com/YOUR-GITHUB-USERNAME-HERE/rialto/tags
Now, in your Laravel project's composer.json file, instead of https://github.com/zoonru/rialto.git, use your newly forked remote repo version. I.e: https://github.com/steven7mwesigwa/rialto.git
composer.json (new entries)
{
"repositories": [
{
"url": "https://github.com/steven7mwesigwa/rialto.git",
"type": "git"
},
{
"url": "https://github.com/zoonru/puphpeteer.git",
"type": "git"
}
],
"require": {
"nesk/puphpeteer": "dev-master"
},
"minimum-stability": "dev"
}
You may replace https://github.com/steven7mwesigwa/rialto.git with your new forked remote repo URL instead.
At the root of your Laravel project, open the terminal, and run the command composer update which will install zoonru/puphpeteer.
Sample output
A. composer show nesk/rialto -a
PS C:\xampp\htdocs\example-app> composer show nesk/rialto -a
name : nesk/rialto
descrip. : Manage Node resources from PHP
keywords : php, node, wrapper, communication, bridge, socket
versions : 1.5.0, 1.4.0, 1.3.0, 1.2.1, 1.2.0, 1.1.0, 1.0.2, 1.0.1, 1.0.0, 0.1.2, 0.1.1, 0.1.0, dev-zoon, dev-dev
type : library
license : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
homepage :
source : [git] https://github.com/steven7mwesigwa/rialto.git c6ffad796941eaaf166c089f116a762f1c79d2e4
dist : []
names : nesk/rialto
autoload
psr-4
Nesk\Rialto\ => src/
requires
php ^7.2 || ^8.0
clue/socket-raw ^1.2
psr/log ^1.0 || ^2.0 || ^3.0
symfony/process ^3.3 || ^4.0 || ^5.0 || ^6.0
requires (dev)
monolog/monolog ^1.0 || ^2.0 || ^3.0
phpunit/phpunit ^8.0 || ^9.0
suggests
ext-weakref Required to run all the tests
B. composer update
PS C:\xampp\htdocs\example-app> composer update
Loading composer repositories with package information
Updating dependencies
Lock file operations: 4 installs, 1 update, 0 removals
- Locking clue/socket-raw (v1.6.0)
- Locking nesk/puphpeteer (dev-master 52bd425)
- Locking nesk/rialto (1.5.0)
- Downgrading psr/log (3.0.0 => 1.1.4)
- Locking vierbergenlars/php-semver (v3.0.3)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 4 installs, 1 update, 0 removals
- Syncing nesk/rialto (1.5.0) into cache
- Syncing nesk/puphpeteer (dev-master 52bd425) into cache
- Downgrading psr/log (3.0.0 => 1.1.4): Extracting archive
- Installing vierbergenlars/php-semver (v3.0.3): Extracting archive
- Installing clue/socket-raw (v1.6.0): Extracting archive
- Installing nesk/rialto (1.5.0): Cloning c6ffad7969 from cache
- Installing nesk/puphpeteer (dev-master 52bd425): Cloning 52bd42570e from cache
1 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> #php artisan package:discover --ansi
INFO Discovering packages.
fruitcake/laravel-cors ........................................................................................ DONE
laravel/sail .................................................................................................. DONE
laravel/sanctum ............................................................................................... DONE
laravel/tinker ................................................................................................ DONE
nesbot/carbon ................................................................................................. DONE
nunomaduro/collision .......................................................................................... DONE
nunomaduro/termwind ........................................................................................... DONE
spatie/laravel-ignition ....................................................................................... DONE
84 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> #php artisan vendor:publish --tag=laravel-assets --ansi --force
INFO No publishable resources for tag [laravel-assets].
No security vulnerability advisories found
Hopefully, you will remember to replace your forked repository URL I.e: https://github.com/steven7mwesigwa/rialto.git with the original https://github.com/zoonru/rialto.git repo URL in your Laravel project's composer.json file and reinstall zoonru/puphpeteer once zoonru/rialto releases a new official git tag when that time comes.
Related
composer install Doctrine/DBAL fails in Laravel 9 with PHP 8.2
I got an error when trying to install doctrine/dbal in order to add timestamp type according to laravel doc in order to allow changing timestamp column in migration. Here is the message composer require doctrine/dbal Using version ^3.6 for doctrine/dbal ./composer.json has been updated Running composer update doctrine/dbal Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 - nette/schema v1.2.2 requires php >=7.1 <8.2 -> your php version (8.2.2) does not satisfy that requirement. - league/commonmark 2.3.5 requires league/config ^1.1.1 -> satisfiable by league/config[v1.1.1]. - laravel/framework v9.30.0 requires league/commonmark ^2.2 -> satisfiable by league/commonmark[2.3.5]. - league/config v1.1.1 requires nette/schema ^1.2 -> satisfiable by nette/schema[v1.2.2]. - laravel/framework is locked to version v9.30.0 and an update of this package was not requested. How can I deal with that ? Installing nette/schema before ?
It's saying that a depency cannot be updated / installed with your PHP version. Pay special atention to this line: - nette/schema v1.2.2 requires php >=7.1 <8.2 -> your php version (8.2.2) does not satisfy that requirement. You have to check another nette/schema version that support PHP version 8.2.2 (your version) or downgrade PHP
Composer package conflict when updating guzzlehttp
laravel version is 5.8, When I write this command in cmd, composer require guzzlehttp/guzzle I get the below problems: Using version ^7.5 for guzzlehttp/guzzle ./composer.json has been updated Running composer update guzzlehttp/guzzle Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 - Root composer.json requires guzzlehttp/guzzle ^7.5, found guzzlehttp/guzzle[dev-master, 7.5.0, 7.5.x-dev] but these were not loaded, likely because it conflicts with another require. Problem 2 - Root composer.json requires netflie/whatsapp-cloud-api ^1.3 -> satisfiable by netflie/whatsapp-cloud-api[1.3.0]. - netflie/whatsapp-cloud-api 1.3.0 requires guzzlehttp/guzzle ^7.0 -> found guzzlehttp/guzzle[dev-master, 7.0.0-beta.1, ..., 7.5.x-dev] but these were not loaded, likely because it conflicts with another require. Problem 3 - php-http/guzzle6-adapter v1.1.1 requires guzzlehttp/guzzle ^6.0 -> found guzzlehttp/guzzle[6.0.0, ..., 6.5.x-dev] but it conflicts with your root composer.json require (^7.5). - nexmo/laravel 1.1.2 requires nexmo/client ^1.0 -> satisfiable by nexmo/client[1.9.1]. - nexmo/client 1.9.1 requires php-http/guzzle6-adapter ^1.0 -> satisfiable by php-http/guzzle6-adapter[v1.1.1]. - nexmo/laravel is locked to version 1.1.2 and an update of this package was not requested. Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions. You can also try re-running composer require with an explicit version constraint, e.g. "composer require guzzlehttp/guzzle:*" to figure out if any version is installable, or "composer require guzzlehttp/guzzle:^2.1" if you know which you need. Installation failed, reverting ./composer.json and ./composer.lock to their original content. It's troublesome, and it seems like a catch22 situation and I cannot figure out the problem.
Why haven't install predis on laravel 8
According laravel manual https://laravel.com/docs/8.x/redis for install predis, need run: composer require predis/predis. When that command is running (for laravel 8) - appear next Error: Your requirements could not be resolved to an installable set of packages. Problem 1 - facade/ignition is locked to version 2.4.2 and an update of this package was not requested. - facade/ignition 2.4.2 requires php ^7.2.5 -> your php version (8.0.0) does not satisfy that requirement. Problem 2 - facade/ignition-contracts 1.0.1 requires php ^7.1 -> your php version (8.0.0) does not satisfy that requirement. - nunomaduro/collision v4.3.0 requires facade/ignition-contracts ^1.0 -> satisfiable by facade/ignition-contracts[1.0.1]. - nunomaduro/collision is locked to version v4.3.0 and an update of this package was not requested. In my composer.json: "php": "^7.2.5|^8.0", What here is wrong))?
You need to update facade/ignition and nunomaduro/collision first to support PHP 8 in your project. Running the following commands should update them accordingly. composer require --dev facade/ignition nunomaduro/collision composer require predis/predis
i run comand: composer require --dev facade/ignition nunomaduro/collision and have got new Error: Your requirements could not be resolved to an installable set of packages. Problem 1 - facade/ignition[2.10.0, ..., 2.10.2] require facade/ignition-contracts ^1.0.2 -> found facade/ignition-contracts[1.0.2] but the package is fixed to 1.0.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command. - Root composer.json requires facade/ignition ^2.10 -> satisfiable by facade/ignition[2.10.0, 2.10.1, 2.10.2]. Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions. Installation failed, reverting ./composer.json and ./composer.lock to their original content. I have new laravel 8 project (blog) && use new Vagrant Homestead (with all updates) && i use laravel 8 manual)) may be laravel developers is a little busy and is a little tired to give full instruction in manual). I think may be for Laravel8 Homestead allready is not suitable and need Docker and Sail... But project work (with the exception of predis) Now i use phpredis. May be will try use docker... As for Vagrant&&Homestead - https://laravel.com/docs/8.x/homestead#introduction i don't understand what is problem to use that technology .... god with they)...
Problem of Laravel Framework version for using the package mailjet/laravel-mailjet
I've a problem for using mailjet/laravel-mailjet, it seems a problem of versions. I was using Laravel Framework 5.6.33 and i got Can only install one of: laravel/framework[v5.6.39, 5.4.x-dev]. i've change my composer.json and now, i'm using Laravel Framework 5.6.39 but i've still the same problem $ php artisan --version Laravel Framework 5.6.39 There is the answer when i try to install mailjet/laravel-mailjet $ composer require mailjet/laravel-mailjet Using version ^1.1 for mailjet/laravel-mailjet ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - Can only install one of: laravel/framework[v5.6.39, 5.4.x-dev]. - Can only install one of: laravel/framework[5.4.x-dev, v5.6.39]. - Can only install one of: laravel/framework[5.4.x-dev, v5.6.39]. - mailjet/laravel-mailjet 1.1.0 requires laravel/framework 5.4.* -> satisfiable by laravel/framework[5.4.x-dev]. - Installation request for mailjet/laravel-mailjet ^1.1 -> satisfiable by mailjet/laravel-mailjet[1.1.0]. - Installation request for laravel/framework 5.6.39 -> satisfiable by laravel/framework[v5.6.39].
the 4th line explains it all. mailjet/laravel-mailjet 1.1.0 requires laravel/framework 5.4.* so, you can't use v5.6.39, only 5.4.*
Why does Composer say "Conclusion: don't install" when (seemingly) no obstacles are present?
The following composer.json: { "type": "project", "minimum-stability": "dev", "require": { "jasny/bootstrap": ">=3.1.3", "2amigos/yii2-file-input-widget": "*" } } leads to the following output of composer update: Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - 2amigos/yii2-file-input-widget 0.1.2 requires jasny/bootstrap v3.1.0 -> satisfiable by jasny/bootstrap[v3.1.0] but these conflict with your requirements or minimum-stability. - 2amigos/yii2-file-input-widget 0.1.1 requires jasny/bootstrap v3.1.0 -> satisfiable by jasny/bootstrap[v3.1.0] but these conflict with your requirements or minimum-stability. - 2amigos/yii2-file-input-widget 0.1.0 requires jasny/bootstrap v3.1.0 -> satisfiable by jasny/bootstrap[v3.1.0] but these conflict with your requirements or minimum-stability. - 2amigos/yii2-file-input-widget 1.0.0 requires jasny/bootstrap ~3.1.0 -> satisfiable by jasny/bootstrap[v3.1.3]. - 2amigos/yii2-file-input-widget 1.0.1 requires jasny/bootstrap ~3.1.0 -> satisfiable by jasny/bootstrap[v3.1.3]. - 2amigos/yii2-file-input-widget 1.0.2 requires jasny/bootstrap ~3.1.0 -> satisfiable by jasny/bootstrap[v3.1.3]. - 2amigos/yii2-file-input-widget dev-master requires jasny/bootstrap ~3.1.0 -> satisfiable by jasny/bootstrap[v3.1.3]. - 2amigos/yii2-file-input-widget 1.0.x-dev requires jasny/bootstrap ~3.1.0 -> satisfiable by jasny/bootstrap[v3.1.3]. - Conclusion: don't install jasny/bootstrap v3.1.3 - Installation request for 2amigos/yii2-file-input-widget * -> satisfiable by 2amigos/yii2-file-input-widget[0.1.0, 0.1.1, 0.1.2, 1.0.0, 1.0.1, 1.0.2, dev-master, 1.0.x-dev]. Why? Ok, I understand, why versions 0.1.0–0.1.2 of 2amigos/yii2-file-input-widget can't be installed — because they require jasny/bootstrap of exact version 3.1.0, which conflicts with >=3.1.3 requirement in composer.json (and therefore composer clarifies: but these conflict with your requirements or minimum-stability). But, from common-sense view, composer can install version 1.0.0 or later of 2amigos/yii2-file-input-widget (which requires jasny/bootstrap of version ~3.1.0, which is satisfiable by 3.1.3). Neither I see any obstacles for installing 2amigos/yii2-file-input-widget 1.0.0+ together with jasny/bootstrap 3.1.3, nor composer writes any explicit clarification about it. Still it says: Conclusion: don't install jasny/bootstrap v3.1.3 — why? Workaround 1 It seems it works with "prefer-stable": true. Workaround 2 I actually found the other workaround some time ago: I replace "2amigos/yii2-file-input-widget": "*" with "2amigos/yii2-file-input-widget": "1.0.2", do composer update and then replace it back and do composer update again — and it works. The question is why it works in so strange way: why it works with more restrictions, but fails with less restrictions (with no clarification). E.g. if it works with 1.0.2 (or with prefer-stable) works — then why it doesn't with * (or without prefer-stable)?
Change the order and it should work, e.g. { "minimum-stability": "dev", "require": { "2amigos/yii2-file-input-widget": "*", "jasny/bootstrap": ">=3.1.3" } } Why? I don't know. Most likely a Composer's bug. I've tested two configurations with different order on the empty folder using composer install command (Composer v1.6.3), the original order fails, however the order above works. I've reported the issue at GH-7215.
The problem might well be that you are manually editing composer.json and then running $ composer update Instead, revert the changes to composer.json and then run: $ composer require jasny/bootstrap:>=3.1.3 $ composer require "2amigos/yii2-file-input-widget:*" or in one go: $ composer require jasny/bootstrap:>=3.1.3 "2amigos/yii2-file-input-widget:*" Note I recommend to avoid the * wildcard as version constraint because it could pull in any version of that dependency, and potentially break your application by pulling in a version that is not compatible with it. For reference, see: http://semver.org