I'm trying to install telegram-bot/api on Centos7/PHP5.6, I'm getting this error when running "php composer.phar require telegram-bot/api"
# php composer.phar require telegram-bot/api
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Using version ^2.3 for telegram-bot/api
./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: telegram-bot/api[v2.3.0, 1.0.x-dev].
- Can only install one of: telegram-bot/api[v2.3.1, 1.0.x-dev].
- Can only install one of: telegram-bot/api[v2.3.10, 1.0.x-dev].
- Can only install one of: telegram-bot/api[v2.3.11, 1.0.x-dev].
- Can only install one of: telegram-bot/api[v2.3.12, 1.0.x-dev].
- Can only install one of: telegram-bot/api[v2.3.13, 1.0.x-dev].
- Can only install one of: telegram-bot/api[v2.3.2, 1.0.x-dev].
- Can only install one of: telegram-bot/api[v2.3.3, 1.0.x-dev].
- Can only install one of: telegram-bot/api[v2.3.4, 1.0.x-dev].
- Can only install one of: telegram-bot/api[v2.3.5, 1.0.x-dev].
- Can only install one of: telegram-bot/api[v2.3.6, 1.0.x-dev].
- Can only install one of: telegram-bot/api[v2.3.7, 1.0.x-dev].
- Can only install one of: telegram-bot/api[v2.3.8, 1.0.x-dev].
- Can only install one of: telegram-bot/api[v2.3.9, 1.0.x-dev].
- Installation request for telegram-bot/api 1.0.x-dev -> satisfiable by telegram-bot/api[1.0.x-dev].
- Installation request for telegram-bot/api ^2.3 -> satisfiable by telegram-bot/api[v2.3.0, v2.3.1, v2.3.10, v2.3.11, v2.3.12, v2.3.13, v2.3.2, v2.3.3, v2.3.4, v2.3.5, v2.3.6, v2.3.7, v2.3.8, v2.3.9].
Installation failed, reverting ./composer.json to its original content.
Edit: As olibiaz suggested, I'm adding composer.json, which I've downloaded using this repo https://github.com/TelegramBot/Api:
{
"name": "telegram-bot/api",
"description": "PHP Wrapper for Telegram Bot API",
"keywords": [
"php",
"telegram",
"bot",
"bot api"
],
"homepage": "https://github.com/TelegramBot/Api",
"license": "MIT",
"authors": [
{
"name": "Ilya Gusev",
"email": "mail#igusev.ru",
"homepage": "https://php-cat.com",
"role": "Developer"
}
],
"require": {
"php" : ">=5.5.0"
},
"require-dev": {
"phpunit/phpunit" : "~4.0",
"squizlabs/php_codesniffer": "2.*",
"codeception/codeception": "*"
},
"autoload": {
"psr-4": {
"TelegramBot\\Api\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"TelegramBot\\Api\\Test\\": "tests"
}
},
"scripts": {
"test": "phpunit"
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
}
}
I've tried specifying the version of telegram-bot/api to use v2.3.9 but I still receive the same error: - Can only install one of: telegram-bot/api[v2.3.9, 1.0.x-dev].
I don't know what else I'm missing, I've already spent a lot of time looking for how to troubleshoot
I fixed it changing the name in composer.json to something like:
"name": "telegram-bot/api_project",
Related
My composer.json file is as follows:
{
"name": "razorpay/razorpay",
"description": "Razorpay PHP Client Library",
"keywords": ["razorpay", "api", "php", "client"],
"authors": [
{
"name": "Abhay Rana",
"email": "nemo#razorpay.com",
"homepage": "https://captnemo.in",
"role": "Developer"
},
{
"name": "Shashank Kumar",
"email": "shashank#razorpay.com",
"role": "Developer"
}
],
"support": {
"email": "contact#razorpay.com",
"issues": "https://github.com/Razorpay/razorpay-php/issues",
"source": "https://github.com/Razorpay/razorpay-php"
},
"homepage": "https://docs.razorpay.com",
"license": "MIT",
"require": {
"php": ">=5.3.0",
"rmccue/requests": "^2.0",
"ext-json": "*",
"razorpay/omnipay-razorpay": "~2.0"
},
"require-dev": {
"raveren/kint": "1.*",
"phpunit/phpunit": "^9"
},
"autoload": {
"psr-4": {
"Razorpay\\Api\\": "src/",
"Razorpay\\Tests\\": "tests/"
},
"files" : ["Deprecated.php"]
}
}
the error when I use
$composer update
is as follows:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires razorpay/omnipay-razorpay, it could not be found in any version, there may be a typo in the package name.
Problem 2
- phpunit/phpunit[9.0.0, ..., 9.2.6] require php ^7.3 -> your php version (5.6.40) does not satisfy that requirement.
- phpunit/phpunit[9.3.0, ..., 9.3.8] require php ^7.3 || ^8.0 -> your php version (5.6.40) does not satisfy that requirement.
- phpunit/phpunit[9.3.9, ..., 9.5.20] require php >=7.3 -> your php version (5.6.40) does not satisfy that requirement.
- Root composer.json requires phpunit/phpunit ^9 -> satisfiable by phpunit/phpunit[9.0.0, ..., 9.5.20].
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.
- It's a private package and you forgot to add a custom repository to find it
For clarification purpose where do I update
{
"require": {
"`razorpay/omnipay-razorpay`": "~2.0"
}
}
as per the instruction given in https://github.com/razorpay/omnipay-razorpay
Do we have to update it in composer.json file available in razorpay-php file (https://github.com/razorpay/razorpay-php/releases/) or create a new composer.json file and add information based on composer JSON schema.
You can inspect all packages that you can install without any custom settings on https://packagist.org. When searching for razorpay/omnipay-razorpay on that site, it does not list this package. You should contact the maintainers of that package about this, as they need to publish the package on Packagist. If it should not be available there, but in any other package repository, they need to update their documentation about this.
Anyways, their package has not seen any substantial update since years. I would assume that development on their side has ended, and you should check for any third-party connector
I am trying to upgrade Laravel from version 6 to version 7. I've tried different combinations of packages but nothing seems to resolve my errors.
Here is my composer.json (that doesn't work)
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.2",
"laravel/framework": "^7.0",
"jgrossi/corcel": "^4.0"
},
"require-dev": {
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^8.0",
"facade/ignition": "^1.4"
},
"autoload": {
"classmap": [
"app/Console/Commands",
"app/Models",
"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
},
"minimum-stability": "dev",
"prefer-stable": true
}
When I run composer update, I get this error:
Problem 1
- The requested package laravel/framework (locked at v6.18.15, required as ^7.0) is satisfiable by laravel/framework[v6.18.15] but these conflict with your requirements or minimum-stability.
Problem 2
- Conclusion: don't install laravel/framework v7.20.0
- Conclusion: don't install laravel/framework v7.19.1
- Conclusion: don't install laravel/framework v7.19.0
- Conclusion: don't install laravel/framework v7.18.0
- Conclusion: don't install laravel/framework v7.17.2
- Conclusion: don't install laravel/framework v7.17.1
- Conclusion: don't install laravel/framework v7.17.0
- Conclusion: don't install laravel/framework v7.16.1
- Conclusion: don't install laravel/framework v7.16.0
That goes on for quite a bit but it seems there are just combinations of packages that don't work together. I don't know how to fix this.
as mentioned in Laravel upgrade Guide
PHP 7.2.5 Required
Update your laravel/framework dependency to ^7.0 in your composer.json
file. In addition, update your nunomaduro/collision dependency to
^4.1, phpunit/phpunit dependency to ^8.5, laravel/tinker dependency to
^2.0, and facade/ignition to ^2.0.
The following first-party packages have new major releases to support
Laravel 7. If there are any, read through their individual upgrade
guides before upgrading:
Browser Kit Testing v6.0
Envoy v2.0
Horizon v4.0
Nova v3.0
Scout v8.0
Telescope v3.0
Tinker v2.0
UI v2.0 (No changes necessary)
Finally, examine any other third-party packages consumed by your
application and verify you are using the proper version for Laravel 7
support.
please follow this official guide and it will be successfully upgrading your laravel version
I am having troubles updating Drupal from composer.
Running composer update gives med this error, that I need help to interpret:
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
- don't install drupal/core 8.6.3|remove drupal/drupal dev-master
- don't install drupal/core 8.6.x-dev|remove drupal/drupal dev-master
- don't install drupal/core 8.7.x-dev|remove drupal/drupal dev-master
- Installation request for drupal/drupal dev-master -> satisfiable by drupal/drupal[dev-master].
- Installation request for drupal/core ^8.6.3 -> satisfiable by drupal/core[8.6.3, 8.6.x-dev, 8.7.x-dev].
My composer.json file looks like this:
{
"name": "drupal/drupal",
"description": "Drupal is an open source content management platform powering millions of websites and applications.",
"type": "project",
"license": "GPL-2.0-or-later",
"require": {
"composer/installers": "^1.2",
"wikimedia/composer-merge-plugin": "^1.4",
"algolia/algoliasearch-client-php": "^1.14",
"drupal/raven": "^2.4",
"drupal/core": "^8.6.3"
},
"require-dev": {
"webflo/drupal-core-require-dev": "^8.6.0"
},
"conflict": {
"drupal/drupal": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"preferred-install": "dist",
"autoloader-suffix": "Drupal8"
},
"extra": {
"_readme": [
"By default Drupal loads the autoloader from ./vendor/autoload.php.",
"To change the autoloader you can edit ./autoload.php.",
"This file specifies the packages.drupal.org repository.",
"You can read more about this composer repository at:",
"https://www.drupal.org/node/2718229"
],
"merge-plugin": {
"include": [
"core/composer.json"
],
"recurse": true,
"replace": false,
"merge-extra": false
},
"installer-paths": {
"core": ["type:drupal-core"],
"modules/contrib/{$name}": ["type:drupal-module"],
"profiles/contrib/{$name}": ["type:drupal-profile"],
"themes/contrib/{$name}": ["type:drupal-theme"],
"drush/contrib/{$name}": ["type:drupal-drush"],
"modules/custom/{$name}": ["type:drupal-custom-module"],
"themes/custom/{$name}": ["type:drupal-custom-theme"]
}
},
"autoload": {
"psr-4": {
"Drupal\\Core\\Composer\\": "core/lib/Drupal/Core/Composer"
}
},
"scripts": {
"pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump",
"post-autoload-dump": "Drupal\\Core\\Composer\\Composer::ensureHtaccess",
"post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
"post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
"drupal-phpunit-upgrade-check": "Drupal\\Core\\Composer\\Composer::upgradePHPUnit",
"drupal-phpunit-upgrade": "#composer update phpunit/phpunit --with-dependencies --no-progress",
"phpcs": "phpcs --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --",
"phpcbf": "phpcbf --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --"
},
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
]
}
This is compatibility issue with PHP & composer version.I have changed version PHP 7.1 with composer 1.7.2 to execute it.
If your installed composer version above 1.7.2 then use below command to downgrade :
composer self-update 1.7.2
When i use "composer require x/y" command inside my custom package all done. Getting all dependencies perfectly.
But when i try to add to laravel project from bitbucket repository, only install my package without all dependencies.
I set my private repository to laravel composer.json file
"repositories": {
"hooks": {
"type":"package",
"package": {
"name": "x/y",
"version":"1.0.2",
"source": {
"url": "https://{username}#bitbucket.org/x/y.git",
"type": "git",
"reference": "master"
}
}
}
}
My custom repository composer.json
{
"name": "x/y",
"description": "Base Api System",
"license": "MIT",
"require": {
"php": "^7.2",
"tcg/voyager": "^1.1",
"predis/predis": "1.1",
"monarobase/country-list": "^2.0"
},
"require-dev": {
},
"autoload": {
"psr-4": {
"X\\Y\\": "src/"
}
},
"minimum-stability": "dev",
"extra": {
"laravel": {
"providers": [
"X\\Y\\XYServiceProvider"
]
}
}
}
Composer require output
Using version ^1.0 for x/y
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Installing x/y (1.0.2): Cloning master from cache
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> #php artisan package:discover
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
You're using package type incorrectly. This type is for non-composer packages. Composer will not even look at composer.json file in such dependency, since it assumes that this file does not exist. All relevant information about package should be in package definition in repositories setting in composer.json of main (root) application.
But in your case you have repository with complete composer package (with correct composer.json file), so you should vcs or git type:
"repositories": [
{
"type":"git",
"url": "https://{username}#bitbucket.org/x/y.git"
}
]
I am trying to build a PHP framework for the company I work in, and the most crazy thing is ever happing!
I have one package that depends on other both in development yet.
Just to get started (they are in different folders, of course!):
I ran composer init to create a package xxxxxx/core-min, and the result was:
{
"name": "xxxxxx/core-min",
"description": "Dummy Minimal Core",
"type": "library",
"license": "New BSD License",
"authors": [
{
"name": "My Name",
"email": "me#xxxxxx.com"
}
],
"minimum-stability": "dev",
"require": {}
}
Created the Packagist Service on Github, Submitted, and everything is okay so far.
I ran composer require xxxxxx/core-min and got it perfectly installed.
Then, I ran composer init to create a package xxxxxx/core, and the result was:
{
"name": "xxxxxx/core",
"description": "Dummy Full Core",
"type": "library",
"require": {
"xxxxxx/core-min": "dev-master"
},
"license": "New BSD License",
"authors": [
{
"name": "My Name",
"email": "me#xxxxxx.com"
}
],
"minimum-stability": "dev"
}
I ran composer require xxxxxx/core-min and got this message:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for zyneframework/core dev-master -> satisfiable by zyneframework/core[dev-master].
- zyneframework/core dev-master requires zyneframework/core-min dev-master -> satisfiable by zyneframework/core-min[dev-master] but these conflict with your requirements or minimum-stability.
This is tricking me out and I can't find any real solution!
Tried several GitHub issues and nothing!