If I understand correctly, I think you created a folder like <root>/flarum and installed Flarum in there, and now you are trying to move <root>/flarum to <root>?
In Flarum there's a file named just flarum (without any file extension), so there's likely a conflict because your folder has the same name so you can't place the flarum file in <root> while still having a <root>/flarum folder.
You will need to rename one or the other to make the move. Option 1: temporarily rename the flarum folder to a temporary name like original-flarum-installation, then move all files including the flarum file. Option 2: move the flarum file first while renaming it to a temporary name, then delete the original installation folder, then rename the file back to flarum.
To avoid this completely you might be able to place your composer.phar file outside of the <root> folder, maybe one level higher. Then you would be able to run the installation by specifying your <root> folder as the target for installation.