Ghost installation on Ubuntu 23.10 stuck at yarn setup

I have been trying to setup ghost locally following all the steps from the documentation and it always shows this on my terminal:

$ docker-compose -f .github/scripts/docker-compose.yml down -v && docker-compose -f .github/scripts/docker-compose.yml up -d --wait
ERROR: The Compose file './.github/scripts/docker-compose.yml' is invalid because:
'name' does not match any of the regexes: '^x-'

You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Failed to run MySQL Docker container Error: 'yarn docker:reset' exited with code 1
    at ChildProcess.<anonymous> (/home/azeez/Ghost/.github/scripts/setup.js:26:24)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1091:16)
    at ChildProcess._handle.onexit (node:internal/child_process:302:5)
Hint: is Docker installed and running?
Running knex-migrator init
warning ghost@5.81.1: The engine "cli" appears to be invalid.
$ /home/azeez/Ghost/node_modules/.bin/knex-migrator init
[2024-04-03 23:29:10] ERROR Cannot find module '/home/azeez/Ghost/node_modules/@tryghost/post-revisions/build/index.js'. Please verify that the package.json has a valid "main" entry

Cannot find module '/home/azeez/Ghost/node_modules/@tryghost/post-revisions/build/index.js'. Please verify that the package.json has a valid "main" entry

"OuterError: Cannot find module '/home/azeez/Ghost/node_modules/@tryghost/post-revisions/build/index.js'. Please verify that the package.json has a valid \"main\" entry"

Error ID:
    400

Error Code: 
    MODULE_NOT_FOUND

----------------------------------------

Error: Cannot find module '/home/azeez/Ghost/node_modules/@tryghost/post-revisions/build/index.js'. Please verify that the package.json has a valid "main" entry
    at /home/azeez/Ghost/node_modules/knex-migrator/lib/index.js:240:23
    at tryPackage (node:internal/modules/cjs/loader:400:19)
    at Module._findPath (node:internal/modules/cjs/loader:613:18)
    at Module._resolveFilename (node:internal/modules/cjs/loader:981:27)
    at Module._load (node:internal/modules/cjs/loader:841:27)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (/home/azeez/Ghost/ghost/core/core/server/models/post.js:21:25)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at /home/azeez/Ghost/ghost/core/core/server/models/index.js:26:27
    at Array.forEach (<anonymous>)
    at Object.init (/home/azeez/Ghost/ghost/core/core/server/models/index.js:23:17)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
/home/azeez/Ghost/.github/scripts/setup.js:26
                reject(new Error(`'${command} ${args.join(' ')}' exited with code ${code}`));
                       ^

Error: 'yarn knex-migrator init' exited with code 1
    at ChildProcess.<anonymous> (/home/azeez/Ghost/.github/scripts/setup.js:26:24)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1091:16)
    at ChildProcess._handle.onexit (node:internal/child_process:302:5)

Node.js v18.12.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I have docker installed and docker-compose. I don’t know where the error is coming from. Please help

Thank you!