Exclude a package from updating in composer

前端 未结 6 1919
走了就别回头了
走了就别回头了 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-07 10:50

    You can supply the name(s) of a one or more packages to update:

    composer update vendor1/package1 vendor1/package2 vendor2/*
    

    and this will only update those packages.

    This isn't specifically excluding, it's including, but it certainly makes updating specific packages much faster.

    To avoid the update on using the require command, you'd could hand-craft the composer.json, (which isn't so hard) then run the above targetted update on the package you just added.

    Also use --no-dev to exclude development packages (if you are not developing the packages you are depending on e.g. in production). This also speeds up the dependency analysis.

提交回复
热议问题