Why are you running composer require flagrow/upload /Applications/XAMPP/xamppfiles/htdocs/Flarum
?
Instead, you should navigate to the folder, assuming its /Applications/XAMPP/xamppfiles/htdocs/Flarum, and run composer require flagrow/upload
.
Always run composer commands in the Flarum root folder.