composer update failed Your requirements could not be resolved to an installable set of packages - php

I have this composer file
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"laravel/framework": "4.2.*",
"guzzlehttp/guzzle": "~4.0",
"zizaco/confide": "~4.0#dev",
"zizaco/entrust": "1.2.*#dev",
"way/generators": "~2.0",
"zurb/foundation": "5.0.3",
"artdarek/oauth-4-laravel": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "4.4.*"
},
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
},
"minimum-stability": "stable"
}
when I run
composer update
I got this error
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
- Installation request for artdarek/oauth-4-laravel dev-master -> satisfiable by artdarek/oauth-4-laravel[dev-master].
- artdarek/oauth-4-laravel dev-master requires lusitanian/oauth dev-master -> satisfiable by
lusitanian/oauth[dev-master] but these conflict with your requirements
or minimum-stability.
I beleive that the error is in artdarek/oauth-4-laravel but I don't know how to reslove it, any help please?

I found this page [Composer fails when installing a dependency of a dependency, but not when the dependency is installed directly][1] helpful and it fixes my problem, I have changed
"artdarek/oauth-4-laravel": "dev-master"
to
"artdarek/oauth-4-laravel": "#dev"
Does anyone know what is the difference?

Try adding "lusitanian/oauth" : "dev-master" to the require list.
FYI, it is better to use specific versions since you are seeking stability :)

Related

Laravel Update / install composer package

Can you answer me?
I use the latest version of Laravel and I want to add to my project the PayPal service.
I want to install some package to Laravel and added this 2 rows to composer.json
"guzzlehttp/guzzle": "~5.2",
"paypal/rest-api-sdk-php": "*"
My composer.json file
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.0.0",
"fideloper/proxy": "~3.3",
"laravel/framework": "5.5.*",
"laravel/tinker": "~1.0"
},
"require-dev": {
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~6.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"/usr/local/bin/php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"/usr/local/bin/php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"/usr/local/bin/php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true,
"cache-dir": "/home/iamdevco/public_html/norrisms/designer/cache"
},
"guzzlehttp/guzzle": "~5.2",
"paypal/rest-api-sdk-php": "*"
}
but I get this error after download packages
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating optimized autoload files
Illuminate\Foundation\ComposerScripts::postAutoloadDump
/usr/local/bin/php artisan package:discover
The system cannot find the path specified.
Script /usr/local/bin/php artisan package:discover handling the post-autoload-dump event returned with error code 1
after you install all packages run
composer dumpautoload
packages
composer require guzzlehttp/guzzle-services
composer require paypal/rest-api-sdk-php
composer dumpautoload
Rather than manually writing the composer.json, try installing and adding them with the specific commands. Like this.
composer require paypal/rest-api-sdk-php
composer require guzzlehttp/guzzle
That way, you'll avoid any typos and composer.json file will be kept as pure as possible.
Try this composer require paypal/rest-api-sdk-php
Ref: https://packagist.org/packages/paypal/rest-api-sdk-php
Edit:
remove the paypal/rest-api-sdk-php on the composer.json and the guzzle then try this
composer require guzzlehttp/guzzle

i can not install laravel passport

composer require laravel/passport ^v1
result command
./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
- doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.22) does not satisfy that requirement.
- doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.22) does not satisfy that requirement.
- Installation request for doctrine/instantiator (installed at 1.1.0) -> satisfiable by doctrine/instantiator[1.1.0].
Installation failed, reverting ./composer.json to its original content.
my composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.0.22",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"laravel/passport": "^1.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
}
}
how can i solved it
Install php 7.1 and you will be fine.
For ubuntu
https://www.vultr.com/docs/how-to-install-and-configure-php-70-or-php-71-on-ubuntu-16-04
For windows
http://php.net/manual/en/install.windows.php
You have to update your php version to be 7, after that you have to re install your composer and make sure that it will take correct php version

composer require laravelcollective html 'doesnt download dependancy

Please see when When I run composer install please assist,
I am new to laravel and I cannot download dependency for laravelcollective/html ... I am using laravel 5.5.13
I want to require laravelcollective/html
however I face the following problems.
when I run : composer require "laravelcollective/html:5.2.*",
I get the below mentioned(similarly when I run composer update ) :
C:\Users\MALULEKE\Desktop\lara_proj\shops>composer require "laravelcollective/html:5.2.*"
./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
- The requested package laravelcollective/html could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Installation failed, reverting ./composer.json to its original content.
C:\Users\MALULEKE\Desktop\lara_proj\shops>composer require "laravelcollective/html:5.2.*"
below is my composer.json relative to my project's work (not from composer/roaming, I am not even sure which is it I must use, please help )
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.0.0",
"fideloper/proxy": "~3.3",
"laravel/framework": "5.5.*#dev",
"laravel/tinker": "~1.0",
"laravelcollective/html":"~5.3.#dev"
},
"require-dev": {
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~6.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
}
}
Try running composer require laravelcollective/html which will install the latest version of LaravelCollective packages for you.
I have decided to use AngularJS as my front end.
Note that this solution may not be suitable for everyone, and with this solution, problems may arrive in future, due to the need for other composer requirements, such as authentication dependencies that my be needed.

How to install Jaxon 2.0 in Laravel 5.3

Good day.
I followed the tutorial instruccions to install.
Installation
Add the following lines in the composer.json file, and run the composer update command.
"require": {
"jaxon-php/jaxon-laravel": "~2.0"
}
But i recieve the following error:
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
- The requested package jaxon-php/jaxon-laravel ~2.0 is satisfiable by jaxon-php/jaxon-laravel[v2.0-beta.1, v2.0-beta.2, v2.0-beta.3, v2.0-beta.4, v2.0-beta.5, v2.0-beta.6] but these conflict with your requirements or minimum-stability.
This is my composer.json file:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.3.*",
"laravelcollective/html": "^5.3.0",
"yajra/laravel-datatables-oracle": "^6.20",
"elibyy/tcpdf-laravel": "5.3.*",
"iatstuti/laravel-nullable-fields": "~1.0",
"orangehill/iseed": "2.2",
"jaxon-php/jaxon-laravel": "~2.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.0",
"symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.1.*"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
Any ideas? Thank you.
Googling arround i think i found my problem:
Since jaxon is in BETA version and composer default minimun stability requeriments are STABLE, composer failed to install the package.
I added this 2 lines to my composer.json:
"minimum-stability": "beta",
"prefer-stable": true,
Source:
http://webtips.krajee.com/setting-composer-minimum-stability-application/
https://getcomposer.org/doc/04-schema.md#minimum-stability

Composer error: UnexpectedValueException

My composer suddenly stopped working. I didn't even add new packages, just wanted to check, if there are any updates:
PS C:\data\www\project.dev> composer self-update
You are already using composer version 1.3.2 (stable channel).
PS C:\data\www\project.dev> composer update
> php artisan clear-compiled
The compiled class file has been removed.
Loading composer repositories with package information
Updating dependencies (including require-dev)
[UnexpectedValueException]
Could not parse version constraint >=~2: Invalid version string "~2"
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock]...
All solutions I found so far suggested to update composer and check the composer.json, but there shouldn't nu anything wrong in there:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.3.*",
"edofre/laravel-fullcalendar-scheduler": "^1.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "5.0",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
As you can see, there is nothing special in there.
PS: Of course, I already chkecked this and this, but those are unrelated problems.
EDIT:
The Problem is fixed in the 1.3.0#dev version of the composer-asset-plugin.
It can be installed via:
composer global require fxp/composer-asset-plugin:~1.3#dev
See also: https://github.com/fxpio/composer-asset-plugin/issues/270
I have tracked down your problem using the verbose output of composer.
The problem is initially caused by requiring
"edofre/laravel-fullcalendar-scheduler": "^1.0"
Within this some bower packages are required ( For this I assume you installed Composer Asset Plugin -at least I had to do this as stated in the docs of laravel-fullcalendar-scheduler)
One of these bower packages is for example:
"bower-asset/fullcalendar-scheduler": "v1.4.0"
The Bower fullcalender-schedulare has some dependencies ( in bower.json):
"dependencies": {
"jquery": "2 - 3",
"moment": "^2.9.0",
"fullcalendar": "~3.2.0"
},
The used composer asset plugin translates the jquery dependency to:
">=~2,<4.0"
This finally causes the error in the composer module https://github.com/composer/semver which raises an error composer/semver/src/VersionParser.php:485
For testing i have manually changed the version to >=2.0 which is working.
I currently have not investigated wheter this is a bug in the composer/semver lib or a bug in the composer asset plugin.
The composer docs say that ~2 is a valid version number, but I don't know if it is supposed to be used in comparisons like ">~2" ( in my oppionion this makes no sense at all... )

Categories