Minimum stability issue - composer-php

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.

Related

Unavailability of package razorpay/omnipay-razorpay

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

Install unstable fork

I maintain a project that uses an abandoned library with a bug that affects me. I'd like to install a fork that includes the bugfix. I can't find the way.
Relevant settings were this:
{
"type": "project",
"license": "proprietary",
"minimum-stability": "stable",
"require": {
"php": "5.3 - 5.6",
"nuovo/spreadsheet-reader": "^0.5.11"
},
"config": {
"preferred-install": {
"*": "dist"
},
"vendor-dir": "Vendor/"
}
}
I've tried too many things to share but my latest iteration is:
{
"type": "project",
"license": "proprietary",
"minimum-stability": "dev",
"repositories": [
{
"type": "vcs",
"url": "https://github.com/virtua-network/spreadsheet-reader"
}
],
"require": {
"php": "5.3 - 5.6",
"nuovo/spreadsheet-reader": "dev-master"
},
"config": {
"preferred-install": {
"*": "dist"
},
"vendor-dir": "Vendor/"
}
}
The package shows up in composer outdated:
PS D:\src> composer outdated
nuovo/spreadsheet-reader 0.5.11 dev-master f6bd49d Spreadsheet reader library for Excel, OpenOffice and structured text files
… but won't update:
PS D:\src> composer update nuovo/spreadsheet-reader
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating autoload files
Also, f6bd49d hash is not latest fork revision but latest original package.
How can I install the fork with Composer?
You're using incorrect package name - in your fork package is named as virtua-network/spreadsheet-reader, but you're requesting nuovo/spreadsheet-reader. So your fork is not considered as a nuovo/spreadsheet-reader package, but as a virtua-network/spreadsheet-reader, so original package from Packagist is used. You should either revert name change in composer.json of your fork and leave it as nuovo/spreadsheet-reader, or use new name in require of composer.json in your app:
"virtua-network/spreadsheet-reader": "dev-master"

Composer conflicting requirements

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!

Delegating to Local composer.json

With my clean Laravel 5.3 installation, I can run composer install to install the dependent packages.
Now, I've an internal package with its own composer.json, like below:
{
"name": "bar/foo",
"description": "A package for handling foo",
"licence": "MIT",
"authors": [
{
"name": "A. Foo",
"email": "a#foo.bar"
}],
"minimum-stability": "dev",
"require": {},
"autoload": {
"psr-4": {
"Foo\\Bar\\": "packages/foo/Bar/src"
}
}
}
So I prefer to autoload from the package itself, instead of autoloading from the main composer.json.
My questions:
Running composer dumpa from packages/foo/Bar doesn't take effect for autoloading. After Generating autoload files, Laravel doesn't know namespace Foo\Bar
Is there a way to run composer dumpa for all recursive composer.jsons?
You need to add the following section to your global composer.json
"repositories": [
{
"type": "path",
"url": "packages/*/*"
}
]
You also need to add the packages to the require object in composer.json

packagist laravel package -composer Could not find package

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.

Resources