dongxiequ3724 2019-06-03 21:34
浏览 243

使symfony安装相同版本的依赖项

So, I recently updated my symfony project to the 4.3 version, and since it caused problems, I downgraded it to 4.2.9. But despite my efforts, and various options of composer, it keeps installing its dependencies on 4.3, (twig, security, yaml...) Even though its composer.json file shows clearly that it should use the same version. I removed vendor, cleared the cache, removed composer.lock and symfony.lock used the --no-cache option, specifically set the symfony version in composer to 4.2.9 precisely, but it always install the 4.3, which is kinda frustrating. If I checkout an old composer.lock and make an install, it works, but the update will still install 4.3, even though I set 4.2.9 in the json for symfony.

Is there a way out ? Thanks

I'm using

composer update --no-cache --dry-run

to see what we be installed without actually installing it

And this is my composer.json

{
    "type": "project",
    "license": "proprietary",
    "require": {
        "php": "^7.1.3",
        "ext-iconv": "*",
        "friendsofsymfony/jsrouting-bundle": "^2.3",
        "sensio/framework-extra-bundle": "^5.1",
        "symfony/console": "^4.0",
        "symfony/flex": "^1.0",
        "symfony/form": "^4.0",
        "symfony/framework-bundle": "4.2.9",
        "symfony/lts": "^4@dev",
        "symfony/monolog-bundle": "^3.3",
        "symfony/orm-pack": "^1.0",
        "symfony/security-bundle": "^4.1",
        "symfony/translation": "^4.0",
        "symfony/twig-bundle": "^4.0",
        "symfony/validator": "^4.0",
        "symfony/webpack-encore-pack": "^1.0",
        "symfony/yaml": "^4.0"
    },
    "require-dev": {
        "doctrine/doctrine-fixtures-bundle": "^3.0",
        "sensiolabs/security-checker": "^5.0",
        "symfony/debug-bundle": "^4.1",
        "symfony/dotenv": "^4.0",
        "symfony/maker-bundle": "^1.9",
        "symfony/profiler-pack": "^1.0",
        "symfony/web-server-bundle": "^4.0"
    },
    "config": {
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "replace": {
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php71": "*",
        "symfony/polyfill-php70": "*",
        "symfony/polyfill-php56": "*"
    },
    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd",
            "security-checker security:check": "script"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "allow-contrib": false,
            "require": "4.2.9"
        }
    }
}

Note: I'm not talking about the dependencies of my own composer.json, but the ones installed by symfony, such as http-foundation or http-kernel.

  • 写回答

2条回答 默认 最新

  • dqg63264 2019-06-03 22:15
    关注

    composer.lock It maintains the exact versions that were previously used. there is a difference between 'composer update' and 'composer install'

    bring back composer.lock

    git checkout -- composer.lock
    rm -rf vendor 
    composer install
    
    评论

报告相同问题?

悬赏问题

  • ¥15 C++使用Gunplot
  • ¥15 这个电路是如何实现路灯控制器的,原理是什么,怎么求解灯亮起后熄灭的时间如图?
  • ¥15 matlab数字图像处理频率域滤波
  • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
  • ¥15 ELGamal和paillier计算效率谁快?
  • ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?
  • ¥15 Arcgis相交分析无法绘制一个或多个图形
  • ¥15 关于#r语言#的问题:差异分析前数据准备,报错Error in data[, sampleName1] : subscript out of bounds请问怎么解决呀以下是全部代码:
  • ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格
  • ¥15 fpga自动售货机数码管(相关搜索:数字时钟)