但这些与您的要求或最低稳定性相冲突

时间:2016-11-06 19:11:24

标签: php composer-php sparkpost

嗨,当我尝试安装SparkPost PHP Library时,我遇到了这个问题:

  

问题1
       - 请求的包sparkpost / sparkpost没有版本集(解析为1.0.0)可以通过sparkpost / sparkpost满足[没有版本设置(解析)   如1.0.0)]但这些与您的要求或   最小稳定性。

当我尝试执行此命令时出现:
 composer require sparkpost/sparkpost

完整控制台输出:

You are running Composer with SSL/TLS protection disabled.
Using version ^2.0 for sparkpost/sparkpost
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package sparkpost/sparkpost No version set (parsed as 1.0.0) is satisfiable by sparkpost/sparkpost[No version set (parsed as 1.0.0)] but these conflict with your requirements or minimum-stability.


Installation failed, reverting ./composer.json to its original content.

作曲家档案:

{
  "name": "sparkpost/sparkpost",
  "description": "Client library for interfacing with the SparkPost API.",
  "license": "Apache 2.0",
  "authors": [
    {
      "name": "SparkPost"
    }
  ],
  "minimum-stability": "stable",
  "scripts": {
    "post-install-cmd": "post-install.sh",
    "post-update-cmd": "post-install.sh",
    "test": "./vendor/bin/phpunit",
    "fix-style": "php-cs-fixer fix ."
  },
  "require": {
    "php": "^5.6 || ^7.0",
    "php-http/httplug": "^1.0",
    "php-http/message": "^1.0",
    "php-http/client-implementation": "^1.0",
    "php-http/discovery": "^1.0",
    "php-http/guzzle6-adapter": "^1.1",
    "guzzlehttp/guzzle": "^6.2"
  },
  "require-dev": {
    "phpunit/phpunit": "^4.8 || ^5.4",
    "mockery/mockery": "^0.9.4",
    "friendsofphp/php-cs-fixer": "^1.11",
    "nyholm/nsa": "^1.0",
    "satooshi/php-coveralls": "dev-master",
    "phpunit/phpcov": "2.*"
  },
  "autoload": {
    "psr-4": {
      "SparkPost\\": "lib/SparkPost"
    }
  },
  "autoload-dev": {
    "psr-4": {
      "SparkPost\\Test\\": "test/unit"
    }
  }
}

任何解决方案?


PD:我尝试将"minimum-stability": "stable"设置为"dev",但我遇到了同样的错误

2 个答案:

答案 0 :(得分:4)

您可以在composer.json中将其定义为:

"some-vendor/some-library": "@dev"

这应该推翻稳定性设定。

答案 1 :(得分:0)

如果您的项目没有版本,则应指定要求开发版本,例如:

QGridLayoutEngine::addItem: Cell (1, 0) already taken

或:

composer require sparkpost/sparkpost --dev

您可以在composer require sparkpost/sparkpost:dev-master 中指定version,然后为该版本创建一个标记(composer.json)。

另请参阅:How do i use Composer to install a package without a version (only master)