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!
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'd like to fetch the composer.lock (& .json) from a project, and run some test to see if there is outdated packages in it.
the composer outdated seems to require me to install all packages first,
but that seams a bit overkill, as all needed information should be in the composer.lock-file.
Is there information avaible after an install, thats not avaible from the lock-file?
Is it posible to find outdated packages without running the composer install?
Update 1
I take "foolz/sphinxql-query-builder" as an exemple from one project.
In composer.json there is a
require['foolz/sphinxql-query-builder'] = '^1.0'.
In composer.lock there is a
packages[] = {name: foolz/sphinxql-query-builder, version: '1.0.2', ...}
In ~/.cache/composer/repo/https---packagist.org/p-provider-2018-04.json there is a providers['foolz/sphinxql-query-builder']->sha256
In ~/.cache/composer/repo/https---packagist.org/provider-foolz\$sphinxql-query-builder.json there is a
packages['foolz/sphinxql-query-builder']->$version
From that file i can run
array_keys((array) $json->packages->{'foolz/sphinxql-query-builder'})
to get a list of availible versions.
So how do i fetch the latest 'provider-foolz\$sphinxql-query-builder.json' file?
Composer.lock defines the exact versions of your packages, so only with this file you are not able to define if it is possible to upgrade the package to a new tag version
For example,
In composer.json you have this version of package
"laravelium/sitemap": "^3.0",
In composer lock there exists this information
{
"name": "laravelium/sitemap",
"version": "v3.0.1",
"source": {
"type": "git",
"url": "https://gitlab.com/Laravelium/Sitemap.git",
"reference": "b287ec4a6b47dcd63fd121199c05e059c479bc6f"
},
"dist": {
"type": "zip",
"url": "https://gitlab.com/api/v4/projects/Laravelium%2FSitemap/repository/archive.zip?sha=b287ec4a6b47dcd63fd121199c05e059c479bc6f",
"reference": "b287ec4a6b47dcd63fd121199c05e059c479bc6f",
"shasum": ""
},
"require": {
"illuminate/support": "5.7.*",
"php": ">=7.1.3"
},
"require-dev": {
"orchestra/testbench": "3.7.*",
"phpunit/phpunit": "~7.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Laravelium\\Sitemap\\SitemapServiceProvider"
]
}
},
"autoload": {
"psr-0": {
"Laravelium\\Sitemap": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roumen Damianoff",
"email": "roumen#damianoff.com",
"homepage": "https://damianoff.com",
"role": "Developer"
}
],
"description": "Laravelium Sitemap package for Laravel.",
"homepage": "https://laravelium.com",
"keywords": [
"Sitemap",
"generator",
"google-news",
"html",
"laravel",
"laravelium",
"php",
"xml"
],
"time": "2018-09-04T19:08:44+00:00"
},
Note, that you will install version v3.{\d+} (>=3 && <4) if it exists, and new tag version may have incompatible change
composer show -l returns the list of packages. Coloured red packages can be updated, and colored green are on the latest version.
Nevertheless, you steel need to proceed with composer install, because only this way you can understand the exact versions of installed packages
I have created package using Laravel.
The composer.json file for my package will look like this
{
"name": "lakshmajim/testview",
"description": "hi",
"keywords": [
"package"
],
"homepage": "https://github.com/lakshmajim/testview",
"license": "MIT",
"authors": [
{
"name": "lakshmajim",
"email": "lakshmaji9#gmail.com"
}
],
"require": {
"php": ">=5.3.0"
},
"autoload": {
"psr-4": {
"lakshmajim\\testview\\": "src/"
}
},
"minimum-stability": "dev"
}
then I have pulled to github
then I have linked it to Packagist
when I am running this composer require lakshmajim/testview
it is showing following error message
[InvalidArgumentException]
Could not find package lakshmajim/testview at any version for your minimum-stability (stable). Check the package spelling or your minimum-s
tability
QUESTION:
Why I am getting that error message ,when I'm trying to install using composer?
How can I successfully run composer require lakshmajim/testview
it's a release issue
you must run
composer require lakshmajim/testview dev-master
you don't have a release yet.
I want to install neitanod/forceutf8 via composer and I get error:
Could not find package require at any version for your minimum-stability (dev). Check the package spelling or your minimum-stability.
That's the second time it does that - previously with html2text.
How to fix it?
Edit:
My composer.json:
{
"name": "vendor_name/package_name",
"description": "description_text",
"minimum-stability": "dev",
"license": "proprietary",
"authors": [
{
"name": "author's name",
"email": "email#example.com"
}
],
"require": {
...
}
}
In your command, you duplicate require keyword.
composer.phar require neitanod/forceutf8:v1.4 require => It means you want to install 2 packages. neitanod/forceutf8:v1.4 and require.
Try running composer.phar require neitanod/forceutf8 only.
I just put up a package on packagist and I tried to run a composer update and am getting the error:
Unknown downloader type: h. Available types: git, svn, hg, perforce, zip, rar, tar, gzip, phar, file.
In the main project file I have this:
"require": {
//.......
"cyphix333/sbb-code-parser": "dev-master"
},
The composer.json file for cyphix333/sbb-code-parser is:
{
"name": "cyphix333/sbb-code-parser",
"description": "SBBCodeParser is a simple BBCode parser",
"keywords": [
"SBBCodeParser"
],
"homepage": "https://github.com/samclarke/SBBCodeParser",
"canonical": "https://github.com/cyphix333/SBBCodeParser",
"source": "https://github.com/cyphix333/SBBCodeParser/tree/master",
"autoload": {
"classmap": ["SBBCodeParser.php","classes/"]
},
"authors": [
{
"name": "Sam Clarke"
}
],
"require": {
"php": ">=5.3"
}
}
I am not sure what I am doing wrong here?
If you just started getting this error, try composer clear-cache and/or delete ~/.composer and vendor.
The specific error I was getting was:
[InvalidArgumentException]
Unknown downloader type: . Available types: git, svn, fossil, hg, perforce, zip, rar, tar, gzip, xz, phar,
file, path.
I just deleted everything and then tried again; works now.
I'm using
Composer version 1.2.0 2016-07-19 01:28:52
I've solved this issue deleting the vendor directory.
rm -Rf vendor
And then running:
composer update
Changes to your composer.json: dropped canonical and source; added type library.
Give this one a try:
{
"name": "cyphix333/sbb-code-parser",
"description": "SBBCodeParser is a simple BBCode parser",
"homepage": "https://github.com/samclarke/SBBCodeParser",
"keywords": ["SBBCodeParser"],
"type": "library",
"authors": [
{
"name": "Sam Clarke"
}
],
"require": {
"php": ">=5.3"
},
"autoload": {
"classmap": ["SBBCodeParser.php", "classes/"]
}
}
I did resolve this error after updating the composer version.
The installation did not work with composer v2.
Passing to the v1 version works.
composer self-update --1
I encountered this issue too, we had a human error in our composer.json. The dist part of one of our custom repositories was entered with a faulty downloader type (as stated in the error message).
{
"type": "package",
"package": {
"name": "campaignmonitor/createsend-php",
"type": "drupal-library",
"version": "dev-master",
"dist": {
"url": "https://github.com/campaignmonitor/createsend-php.git",
"type": "drupal-library"
},
"source": {
"url": "https://github.com/campaignmonitor/createsend-php.git",
"type": "git",
"reference": "master"
}
}
}
Note that the dist's type is entered as drupal-library, that is the package type, not the downloader type. We corrected this by using the following for dist:
"dist": {
"url": "https://github.com/campaignmonitor/createsend-php/archive/master.zip",
"type": "zip"
},
As we developed this project we had no problems when running composer install locally. We encountered this error when making the project production ready, using --prefer-dist. Obviously, it will only then use dist over source and then encounter this error.
Disclaimer: This case is somewhat different then the original question, though it's highly relatable and this question came up on top when trying to search for the answer. I hope this is okay.