Unknown shorthand flag d in -d while executing docker-compose.yml file through command docker-compose up -d

I am trying to create and run docker container from my docker-compose.yml file through the command by going into that location where the docker-compose.yml file is present through the command : docker-compose up -d. However I am getting the below error. Please look into it.

docker-compose up -d
unknown shorthand flag: ‘d’ in -d
See ‘docker --help’.

It looks like your docker-compose command is actually a shell script which runs the docker command. “up” might be supported in that script but -d isn’t. If docker-compose were the original binary provided by Docker Desktop for Mac, you wouldn’t see the suggestion of running docker --help as it would not help with the compose command.

Thanks for your input. So is this error because of the wrong installation of docker desktop for mac? Can you please suggest on the next steps to resolve the error

More likely a wrong installation of Docker Compose. Docker Desktop installs Docker Compose too. I don’t know how it could be done wrong.

how did you install Docker Desktop and Docker Compose?