【问题标题】:Your requirements could not be resolved to an installable set of packages for pinterest API您的要求无法解决为 pinterest API 的一组可安装软件包
【发布时间】:2016-12-24 21:56:11
【问题描述】:

这是 API 的 Github Page。这是我在 composer 中运行的命令:

composer require dirkgroenen/Pinterest-API-PHP 0.2.11

这是我得到的错误

您的需求无法解决为一组可安装的软件包。

问题 1 - 请求的包 dirkgroenen/pinterest-api-php 没有版本集(解析为 1.0.0)可满足 dirkgroenen/pinterest-api-php[未设置版本(解析为 1.0.0)] 但是 这些与您的要求或最低稳定性相冲突。

这里是 API 的packagist 页面的链接。

composer.json 文件有以下数据:

"require": {
    "php": ">=5.4",
    "ext-curl": "*"
},
"require-dev": {
    "phpunit/phpunit": "4.7.*",
    "vlucas/phpdotenv": "^2.2"
},

composr.json 文件中的要求与 packagegist 页面上指定的要求相匹配,那么我该如何解决此错误?

【问题讨论】:

    标签: php json composer-php


    【解决方案1】:

    正确的格式应该是:

    composer require "dirkgroenen/Pinterest-API-PHP:0.2.11"
    

    或者,您也可以将其添加到您的composer.json

    "dirkgroenen/Pinterest-API-PHP" : "0.2.11",
    

    然后做一个composer install

    【讨论】:

    • 我是加在require还是require-dev下面?
    • 这取决于您的应用程序是否需要运行。有关更多信息,请参阅此帖子:stackoverflow.com/a/29304370/2020002
    • 我已经尝试了这两种方法,但我仍然收到完全相同的错误。
    • 你试过了吗:composer require dirkgroenen/Pinterest-API-PHP
    • 看起来这家伙也有同样的问题:github.com/dirkgroenen/Pinterest-API-PHP/issues/20 并且能够通过创建一个新的作曲家项目来解决它
    猜你喜欢
    • 2014-08-27
    • 1970-01-01
    • 1970-01-01
    • 2016-03-22
    • 2018-10-22
    • 2019-06-28
    • 1970-01-01
    • 2016-06-13
    相关资源
    最近更新 更多