2017-04-19 92 views
0

我需要在我的laravel项目 非作曲家库(https://github.com/ECPay/ECPayAIO_PHP),但得到一个错误:作曲家安装一个软件包失败

Your requirements could not be resolved to an installable set of packages. 

    Problem 1 
    - The requested package ecpay/ecpayaio_php could not be found in any version, there may be a typo in the package name. 

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. 

这是我composer.json文件

{ 
    "repositories": [ 
     { 
      "type": "package", 
      "package": { 
       "name": "ECPay/ECPayAIO_PHP", 
       "version": "dev-master", 
       "source": { 
        "url": "https://github.com/ECPay/ECPayAIO_PHP", 
        "type": "git", 
        "reference": "origin/master" 
       } 
      } 
     } 
    ], 
    "require": { 
     "ECPay/ECPayAIO_PHP": "master" 
    } 
} 

听起来包名错误,是不是"ECPay/ECPayAIO_PHP"?,任何想法?

回答

0

要使用git repo作为composer包的源代码,您只需要在存储库列表中定义type = vcs的存储库,然后composer应该能够找到您的包。对于该文档是在这里:https://getcomposer.org/doc/05-repositories.md#loading-a-package-from-a-vcs-repository

如果你想有一个更详细的例子,我也博客上讲述这个时候我有同样的问题(https://lornajane.net/posts/2014/use-a-github-branch-as-a-composer-dependency) - 请注意,如果你想在主分支版本,包版本想成为dev-master