
First solution: Run php C:\ProgramData\ComposerSetup\bin\composer self-update, and no error will be reported, but this is too cumbersome;
Second solution: Reinstall Composer-Setup.exe and run it as an administrator. It will automatically configure the system environment variables during installation, so you can directly use the composer command in any directory.

Restart the operating system, and it will run normally. The screenshot is as follows:

