CakeDC用户插件编辑器安装

时间:2018-05-01 18:42:30

标签: composer-php cakephp-3.x cakedc

我正在使用CakePHP 3.6.2并尝试使用Composer安装CakeDC Users插件时给出了以下错误消息:

Using version ^7.0 for cakedc/users
./composer.json has been created
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
    - Installation request for cakedc/users ^7.0 -> satisfiable by cakedc/users[7.0.0].
    - cakedc/users 7.0.0 requires cakephp/cakephp ^3.6 -> satisfiable by cakephp/cakephp[3.6.0, 3.6.1, 3.6.2].
    - cakephp/cakephp 3.6.0 requires aura/intl ^3.0.0 -> satisfiable by aura/intl[3.0.0].
    - cakephp/cakephp 3.6.1 requires aura/intl ^3.0.0 -> satisfiable by aura/intl[3.0.0].
    - cakephp/cakephp 3.6.2 requires aura/intl ^3.0.0 -> satisfiable by aura/intl[3.0.0].
    - Conclusion: don't install aura/intl 3.0.0


Installation failed, deleting ./composer.json.

在使用Composer进行安装时,有人能告诉我如何解决这个问题吗?

我的composer.json:


{
    "name": "cakephp/app",
    "description": "CakePHP skeleton app",
    "homepage": "https://cakephp.org",
    "type": "project",
    "license": "MIT",
    "require": {
        "php": ">=5.6",
        "cakephp/cakephp": "3.6.*",
        "cakephp/migrations": "^1.8.0",
        "cakephp/plugin-installer": "^1.0",
        "josegonzalez/dotenv": "3.*",
        "mobiledetect/mobiledetectlib": "2.*"
    },
    "require-dev": {
        "cakephp/bake": "^1.1",
        "cakephp/cakephp-codesniffer": "^3.0",
        "cakephp/debug_kit": "^3.15.0",
        "psy/psysh": "@stable"
    },
    "suggest": {
        "markstory/asset_compress": "An asset compression plugin which provides file concatenation and a flexible filter system for preprocessing and minification.",
        "dereuromark/cakephp-ide-helper": "After baking your code, this keeps your annotations in sync with the code evolving from there on for maximum IDE and PHPStan compatibility.",
        "phpunit/phpunit": "Allows automated tests to be run without system-wide install."
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Test\\": "tests/",
            "Cake\\Test\\": "vendor/cakephp/cakephp/tests/"
        }
    },
    "scripts": {
        "post-install-cmd": "App\\Console\\Installer::postInstall",
        "post-create-project-cmd": "App\\Console\\Installer::postInstall",
        "post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump",
        "check": [
            "@test",
            "@cs-check"
        ],
        "cs-check": "phpcs --colors -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests",
        "cs-fix": "phpcbf --colors --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests",
        "test": "phpunit --colors=always"
    },
    "prefer-stable": true,
    "config": {
        "sort-packages": true
    }
}

2 个答案:

答案 0 :(得分:0)

从CakeDC installation docs,您需要运行composer require cakedc/users

您需要在与composer.json文件相同的目录中运行它。您的错误消息显示为./composer.json has been created。如果您在正确的目录中运行它,它会说./composer.json has been updated

或者,您可以手动将"cakedc/users": "^7.0"添加到composer.json所需的包中,然后运行composer install

"require": {
    "php": ">=5.6",
    "cakephp/cakephp": "3.6.*",
    "cakephp/migrations": "^1.8.0",
    "cakephp/plugin-installer": "^1.0",
    "josegonzalez/dotenv": "3.*",
    "mobiledetect/mobiledetectlib": "2.*",
    "cakedc/users": "^7.0"                 <- Add this line
},

答案 1 :(得分:0)

我刚刚测试了你发布的composer.json文件,它运行正常(作曲家安装)。您是否在新环境中设置此项目?

  • 检查您是否已安装所有CakePHP要求,例如php-intl extension
  • 删除供应商文件夹并再次运行composer install