How does composer uninstall the installed package?

A global package has just been installed using composer according to laravel documentation, but the document only explains how to install it, but does not say how to uninstall it. Excuse me, what is the command to uninstall?

this is a command I have tried (found by Baidu), but there is a serious error

composer remove laravel

composer remove vendor/laravel
Error message:
    Could not read ./composer.json                                                                                                                                            
    file_get_contents(./composer.json): failed to open stream: No such file or directory

in addition to the uninstall command for the composer package, I"d like to ask you how to uninstall composer.

therefore, there are currently two problems to be solved:
1. What is the command for composer to uninstall the package?
2. How to uninstall composer?

Apr.09,2021

composer.json can't be found. Did you delete it?


abnormal uninstall if composer.json cannot be found

find / -name laravel
rm -rf {$path}

Uninstall composer, if the following method is invalid, you can still use composer

find / -name composer
rm -rf {$path}

you can do this

cd {$path}
rm -rf composer
Menu