Home >Development Tools >composer >How to solve composer error Could not find package
The following tutorial column of composer will introduce to you the solution to the composer error Could not find package. I hope it will be helpful to friends in need!
I am gradually submitting my own framework to GITHUB, which is not an easy task.
1. Register an account on GITHUB and open it Project
2. Local GIT clone down
3. Modify the code locally and submit it back to GITHUB
4. Register an account on Packagist and synchronize the project to Packagist
5. Use Composer to update the code to another local test project. At this time, a problem occurs
always prompts
[InvalidArgumentException] Could not find a version of package ice-php/test-repository matching your minimum-stability (stable). Require it with an explicit version constraint allowing its desired stability.
According to this prompt, I modified various version-related things, Still to no avail
Then I updated with the version number, that is,
composer require ice-php/test-repository:^1.0
The prompt was:
[InvalidArgumentException] Could not find package ice-php/test-repository. Did you mean this? ice-php/test-repository
At this time, I began to doubt the Composer source. I previously copied the code The source was modified to Chinese mirror server
https://packagist.phpcomposer.com
and removed, but still
I had enough sleep today and felt refreshed, so I wondered what the original value was? I couldn’t find it online~, so I tried changing it to Packagist The address is https://packagist.org
Run composer again, and it gets stuck. I saw something interesting.
After a long wait, the specified version was updated successfully.
Try again without version specification, also successful.
Note: My current computer is circumventing the firewall, and the above operation is successful.
1.Wall~~~~
2. Use Baidu which is not available~~~
The above is the detailed content of How to solve composer error Could not find package. For more information, please follow other related articles on the PHP Chinese website!