Exclude a package from updating in composer

前端 未结 6 1923
走了就别回头了
走了就别回头了 2021-02-07 10:22

Whenever I try to add a new package using composer like \"composer require packagename/package\" or use \"composer.phar update\", I am getting all the

6条回答
  •  深忆病人
    2021-02-07 10:46

    One workaround is to use replace property, however there isn't dedicated command for that, so you can run composer require foo/bar as usual (which will create composer.json), then add a new replace section for the package to ignore.

    Or create composer.json file on your own. Here is the example:

    {
        "require": {
            "radic/tmp-underscore-php": "1.2.0"
        },
        "replace": {
            "patchwork/utf8": "*"
        }
    }
    

    Once you run composer install, the required package patchwork/utf8 won't be downloaded.

提交回复
热议问题