Haim
Haim

Reputation: 1167

Remove repositories from composer command line

My project had a dependency that was on github, so when I installed it I ran

$ composer config repositories.vendor/package vcs https://github.com/vendor/package.git
$ composer require vendor/package

Now, I need to remove that package.
If I just run $ composer remove vendor/package the "repositories" section is still in my composer.json file.

"repositories": {

        "type": "vcs",
        "url": "https://github.com/vendor/package.git"
    },

How can I also remove the "repositories" section from the command line?

Upvotes: 13

Views: 10210

Answers (1)

xabbuh
xabbuh

Reputation: 5881

You can run composer config --unset repositories.vendor/package to remove the entry from the repositories key.

However, this will still keep the empty repositories key. If you also want to remove that, you will have to use another tool that is able to parse JSON and remove the key yourself.

Upvotes: 23

Related Questions