composer无法安装包和更换镜像源方式
Composer 版本 2.4.1
系统:Debian 10
一、查看镜像源
输入以下命令
composer config -g -l
返回的信息类似:
其中 https://mirrors.aliyun.com/composer/ 这个是阿里云的镜像源
二、composer 换源方式
composer config -g repo.packagist composer https://repo.packagist.org
今天安装一个包,提示如下信息:
Your requirements could not be resolved to an installable set of packages.
Problem 1
Root composer.json requires jeromegillard/map, it could not be found in any version, there may be a typo in the package name.
Root composer.json requires jeromegillard/map, it could not be found in any version, there may be a typo in the package name.
Potential causes:
Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
确认包名信息无误,最后发现是镜像源的问题,于是从阿里云镜像改为官方镜像源,如果有遇到类似问题,可以试试。