Cannot update project with composer - composer-php

I pushed my package medyes/ebay-api on github.
When I tried to download it on another project with composer I have an error:
Command composer:
composer require medyes/ebay-api:dev-master
The error:
[InvalidArgumentException]
Could not find package medyes/ebay-api at any version for your
minimum-stability (dev). Check the package spelling or your minimum
-stability
this is the composer.json of medyes/ebay-api package
composer.json

Avoid using branches - especially when the project you are about to include offers tagged versions.
composer require medyes/ebay-api:~0.1
This will update this package until version 1.0 comes out (which would not be installed, because that major release number change it is considered incompatible according to semantic versioning) every time a newer, installable version exists and you run composer update.

Related

Can't get specific version of composer package

I am trying to get latest version of calcinai/xero-php (just doing composer require as per their readme installs v ^1.7)
When I run
composer require "calcinai/xero-php":"^2.0.4"
The incorrect version of this package is downloaded (composer logs below + vendor code being installed is not what is in master repos, currently at v2.0.4).
How do I get v2.0.4/latest code that is on master (using composer)?
If you want to require a specific version, and not any other, skip the caret. Installing exactly v2.0.4 of that package works using
composer require "calcinai/xero-php":"2.0.4"

Cannot install jacquestvanzuydam/laravel-firebird via composer

I'm running Laravel 5.5.
While trying to install jacquestvanzuydam/laravel-firebird via Composer,
but it fails. The Composer shows me:
[InvalidArgumentException]
Could not find a version of package jacquestvanzuydam/laravel-firebird matching your minimum-stability (stable). Require it with an explicit version constraint allowing its desired stability.
This package does not have any stable release. You need to specify branch in constrait directly:
composer require jacquestvanzuydam/laravel-firebird:dev-master
This will install version from master branch. List of available branches you can find or right column on https://packagist.org/packages/jacquestvanzuydam/laravel-firebird.
You may also report this issue (no stable release of this package) to package maintainer. Using branch instead of regular constraint may give unexpected compatibility breaks, you should really avoid it where possible.
Adding "minimum-stability": "dev" to composer.json before installation worked for me.

Composer [InvalidArgumentException] Could not find package mtibben/html2text

I have tried to install html2text via composer to my laravel application. Here is a link to the html2text repository. https://github.com/mtibben/html2text
I have tried composer require mtibben/html2text giving this error:
[InvalidArgumentException]
Could not find package mtibben/html2text at any version for your
minimum-stability (stable). Check the package spel ling or your
minimum-stability
Also I have tried composer require https://github.com/mtibben/html2text.git giving this error:
[UnexpectedValueException]
Could not parse version constraint //github.com/mtibben/html2text.git:
Invalid version string "//github.com/mtibben /html2text.git"
How do I install html2text?
Its a php package, u can't install with composer require
U may want to read this tutorial
http://laraveldaily.com/how-to-use-external-classes-and-php-files-in-laravel-controller/
Do you already have a composer.json file in your directory? If not, this could be the error, because in this file you will configure which version of the package you want to install in to your project.
The second exception gives a hint to that missing version!
If you have a composer.json file please add its content to your question, so that we can take a look at it.
Here you can find further informations:
https://getcomposer.org/doc/01-basic-usage.md#composer-json-project-setup
i faced the same problem.
And neither the creation of releases, nor any tags helped.
The solution for me turned out to be updating the composer from last version.
it's for composer, nothing else. If you already installed composer and composer version is 2 then convert it to version 1.easy way to solve this problem is ,delete the composer folder from your system and re install it. download from here: https://getcomposer.org/

Composer version pattern not working

In my composer I've the following version definition of a module:
"my-module": "1.*"
Everything was working fine until I've changed the module tag version to 1.0.10.
The strange thing is that composer is always loading 1.0.9.
I could change the pattern to "1.0.*", but I can't find any info why "1.*" is not working.
btw. I'm using Composer version 1.4.1
To find out why a particular version is not updated, you can run composer why-not package/name version, and Composer will list all dependencies that prevent the installation of that particular version.
I have a feeling that in your case you will detect another package that you did not consider yet.

What is the proper way to incorporate additional packages into Laravel?

I am attempting to integrate this package: https://bitbucket.org/cerbero/oauth/wiki/Home
Also seen her on Packagist: https://packagist.org/packages/cerbero/oauth
The documentation from BitBucket says:
Installation
Be sure minimum-stability is set to dev in your composer.json, then run:
composer require cerbero/oauth:2.1.0
So I include the package after Laravel like this:
"require": {
"laravel/framework": "4.2.*",
"cerbero/oauth": "dev-master"
},
Then I run the composer command and get this error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for cerbero/oauth 2.1.0 -> satisfiable by cerbero/oauth[2.1.0].
- cerbero/oauth 2.1.0 requires google/apiclient 1.0.3-beta -> no matching package found.
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://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
It states that it also requires google/apiclient. So I go to packagist and get the info and paste it into the require section of composer.json. Then another missing dependency pops up so I add that one. The cycle continues for a while. Isn't packagist supposed to handle the dependencies automatically? I am new to packagists but I haven't had issues going through other Laravel tutorials that requires packages. What is the proper way to include this Cerbero package into my application? Any advice would be appreciated.
Composer does take care of dependencies for you, in your current settings, it tries to resolve all dependencies required for your package cerbero/oauth, google/apiclient being one of them. However the dependencies tried to resolve into non-stable package, and in your composer.json file somewhere, it must have stated
"minimum-stability": "stable"
The solution is then pretty clear, according to the error message you see, just set the minimum-stability to dev instead of stable.

Resources