Install CakePHP 4 using composer always failed with postInstall runtime exception

No I did not go through the CMS Tutorial, but I did follow the Authentication documentation section alone.
The problem I have was:

  • Can not Redirect to previously visit before Log in action. The $this->Authentication->getLoginRedirect() always return null
  • Can not get the Remember Me working.

I had to set an $origin variable from Controller to View, then make it hidden field in View form, submit back to Login action, and redirect to that $origin if authenticate successful.

And in new test project, I develop on Fedora Core Linux, I installed CakePHP using Composer with the same command, there is no any Installation error.
And guess what, the Authentication plugin works as it is designed for. I means the Redirection works like a charm.

I think there is something wrong with Installation script using Composer on Windows.