Ghost Installation on Mac shows 'Command failed: yarn install --no-emoji --no-progress' and 'The engine "cli" appears to be invalid.'

I’m extremely new to development. I’m trying to install a Ghost instance (apologies if this is not the correct terminology; feel free to correct). I created a directory on my desktop called “Ghost” and inside that, following Ghost’s (ghost-cli 1.24.0) instructions, I typed out ghost install local in that directory in the terminal.

What follows is a series of inscrutable errors.

Here is that:

Debug Information:
    OS: macOS, v13.2.1
    Node Version: v18.14.2
    Ghost-CLI Version: 1.24.0
    Environment: development
    Command: 'ghost install local'
Message: Command failed: yarn install --no-emoji --no-progress
warning ../../../../package.json: No license field
warning ghost@5.36.0: The engine "cli" appears to be invalid.
warning Resolution field "@elastic/elasticsearch@8.5.0" is incompatible with requested version "@elastic/elasticsearch@8.6.0"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@^2.29.1"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@2.29.1"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@^2.27.0"
warning Resolution field "moment-timezone@0.5.23" is incompatible with requested version "moment-timezone@^0.5.31"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@2.29.4"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@2.29.4"
warning Resolution field "moment-timezone@0.5.23" is incompatible with requested version "moment-timezone@0.5.34"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@2.29.1"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@2.29.3"
warning Resolution field "@tryghost/logging@2.4.0" is incompatible with requested version "@tryghost/logging@2.3.6"
warning Resolution field "moment-timezone@0.5.23" is incompatible with requested version "moment-timezone@^0.5.33"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@2.27.0"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@^2.29.1"
warning "@tryghost/kg-lexical-html-renderer > @lexical/rich-text@0.7.9" has unmet peer dependency "@lexical/selection@0.7.9".
warning "@tryghost/kg-lexical-html-renderer > @lexical/rich-text@0.7.9" has unmet peer dependency "@lexical/utils@0.7.9".
warning " > bookshelf@1.2.0" has incorrect peer dependency "knex@>=0.15.0 <0.22.0".
warning " > mock-knex@0.4.9" has incorrect peer dependency "knex@> 0.8 < 2.1".
warning Workspaces can only be enabled in private projects.
error /Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2: Command failed.
Exit code: 1
Command: install-from-cache --artifact build/Release/re2.node --host-var RE2_DOWNLOAD_MIRROR --skip-path-var RE2_DOWNLOAD_SKIP_PATH --skip-ver-var RE2_DOWNLOAD_SKIP_VER || npm run rebuild
Arguments: 
Directory: /Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2
Output:
Trying https://github.com/uhop/node-re2/releases/download/1.18.0/darwin-arm64-108.br ...
Trying https://github.com/uhop/node-re2/releases/download/1.18.0/darwin-arm64-108.gz ...
Building locally ...

> re2@1.18.0 rebuild
> node-gyp rebuild

gyp info it worked if it ends with ok
gyp info using node-gyp@9.3.0
gyp info using node@18.14.2 | darwin | arm64
gyp ERR! find Python 
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python 
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python 
gyp ERR! configure error 
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail (/Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2/node_modules/node-gyp/lib/find-python.js:330:47)
gyp ERR! stack     at PythonFinder.runChecks (/Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2/node_modules/node-gyp/lib/find-python.js:159:21)
gyp ERR! stack     at PythonFinder.<anonymous> (/Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2/node_modules/node-gyp/lib/find-python.js:202:16)
gyp ERR! stack     at PythonFinder.execFileCallback (/Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2/node_modules/node-gyp/lib/find-python.js:294:16)
gyp ERR! stack     at exithandler (node:child_process:427:5)
gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:439:5)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:289:12)
gyp ERR! stack     at onErrorNT (node:internal/child_process:476:16)
gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
gyp ERR! System Darwin 22.3.0
gyp ERR! command "/usr/local/bin/node" "/Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2
gyp ERR! node -v v18.14.2
gyp ERR! node-gyp -v v9.3.0
gyp ERR! not ok 
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "1".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

Node.js v18.14.2

> re2@1.18.0 rebuild
> node-gyp rebuild

gyp info it worked if it ends with ok
gyp info using node-gyp@9.3.0
gyp info using node@18.14.2 | darwin | arm64
gyp ERR! find Python 
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python 
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python 
gyp ERR! configure error 
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail (/Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2/node_modules/node-gyp/lib/find-python.js:330:47)
gyp ERR! stack     at PythonFinder.runChecks (/Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2/node_modules/node-gyp/lib/find-python.js:159:21)
gyp ERR! stack     at PythonFinder.<anonymous> (/Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2/node_modules/node-gyp/lib/find-python.js:202:16)
gyp ERR! stack     at PythonFinder.execFileCallback (/Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2/node_modules/node-gyp/lib/find-python.js:294:16)
gyp ERR! stack     at exithandler (node:child_process:427:5)
gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:439:5)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:289:12)
gyp ERR! stack     at onErrorNT (node:internal/child_process:476:16)
gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
gyp ERR! System Darwin 22.3.0
gyp ERR! command "/usr/local/bin/node" "/Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2
gyp ERR! node -v v18.14.2
gyp ERR! node-gyp -v v9.3.0
gyp ERR! not ok

yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
[5/5] Building fresh packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Exit code: 1

--------------- stdout ---------------
yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
[5/5] Building fresh packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.


--------------- stderr ---------------
warning ../../../../package.json: No license field
warning ghost@5.36.0: The engine "cli" appears to be invalid.
warning Resolution field "@elastic/elasticsearch@8.5.0" is incompatible with requested version "@elastic/elasticsearch@8.6.0"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@^2.29.1"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@2.29.1"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@^2.27.0"
warning Resolution field "moment-timezone@0.5.23" is incompatible with requested version "moment-timezone@^0.5.31"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@2.29.4"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@2.29.4"
warning Resolution field "moment-timezone@0.5.23" is incompatible with requested version "moment-timezone@0.5.34"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@2.29.1"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@2.29.3"
warning Resolution field "@tryghost/logging@2.4.0" is incompatible with requested version "@tryghost/logging@2.3.6"
warning Resolution field "moment-timezone@0.5.23" is incompatible with requested version "moment-timezone@^0.5.33"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@2.27.0"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@^2.29.1"
warning "@tryghost/kg-lexical-html-renderer > @lexical/rich-text@0.7.9" has unmet peer dependency "@lexical/selection@0.7.9".
warning "@tryghost/kg-lexical-html-renderer > @lexical/rich-text@0.7.9" has unmet peer dependency "@lexical/utils@0.7.9".
warning " > bookshelf@1.2.0" has incorrect peer dependency "knex@>=0.15.0 <0.22.0".
warning " > mock-knex@0.4.9" has incorrect peer dependency "knex@> 0.8 < 2.1".
warning Workspaces can only be enabled in private projects.
error /Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2: Command failed.
Exit code: 1
Command: install-from-cache --artifact build/Release/re2.node --host-var RE2_DOWNLOAD_MIRROR --skip-path-var RE2_DOWNLOAD_SKIP_PATH --skip-ver-var RE2_DOWNLOAD_SKIP_VER || npm run rebuild
Arguments: 
Directory: /Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2
Output:
Trying https://github.com/uhop/node-re2/releases/download/1.18.0/darwin-arm64-108.br ...
Trying https://github.com/uhop/node-re2/releases/download/1.18.0/darwin-arm64-108.gz ...
Building locally ...

> re2@1.18.0 rebuild
> node-gyp rebuild

gyp info it worked if it ends with ok
gyp info using node-gyp@9.3.0
gyp info using node@18.14.2 | darwin | arm64
gyp ERR! find Python 
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python 
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python 
gyp ERR! configure error 
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail (/Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2/node_modules/node-gyp/lib/find-python.js:330:47)
gyp ERR! stack     at PythonFinder.runChecks (/Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2/node_modules/node-gyp/lib/find-python.js:159:21)
gyp ERR! stack     at PythonFinder.<anonymous> (/Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2/node_modules/node-gyp/lib/find-python.js:202:16)
gyp ERR! stack     at PythonFinder.execFileCallback (/Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2/node_modules/node-gyp/lib/find-python.js:294:16)
gyp ERR! stack     at exithandler (node:child_process:427:5)
gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:439:5)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:289:12)
gyp ERR! stack     at onErrorNT (node:internal/child_process:476:16)
gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
gyp ERR! System Darwin 22.3.0
gyp ERR! command "/usr/local/bin/node" "/Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2
gyp ERR! node -v v18.14.2
gyp ERR! node-gyp -v v9.3.0
gyp ERR! not ok 
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "1".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

Node.js v18.14.2

> re2@1.18.0 rebuild
> node-gyp rebuild

gyp info it worked if it ends with ok
gyp info using node-gyp@9.3.0
gyp info using node@18.14.2 | darwin | arm64
gyp ERR! find Python 
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python 
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python 
gyp ERR! configure error 
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail (/Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2/node_modules/node-gyp/lib/find-python.js:330:47)
gyp ERR! stack     at PythonFinder.runChecks (/Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2/node_modules/node-gyp/lib/find-python.js:159:21)
gyp ERR! stack     at PythonFinder.<anonymous> (/Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2/node_modules/node-gyp/lib/find-python.js:202:16)
gyp ERR! stack     at PythonFinder.execFileCallback (/Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2/node_modules/node-gyp/lib/find-python.js:294:16)
gyp ERR! stack     at exithandler (node:child_process:427:5)
gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:439:5)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:289:12)
gyp ERR! stack     at onErrorNT (node:internal/child_process:476:16)
gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
gyp ERR! System Darwin 22.3.0
gyp ERR! command "/usr/local/bin/node" "/Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/claude/Desktop/Ghost/versions/5.36.0/node_modules/re2
gyp ERR! node -v v18.14.2
gyp ERR! node-gyp -v v9.3.0
gyp ERR! not ok

I’m not even sure what to try, but I’ve tried: I’ve updated the latest supported version of node, NPM, and yarn. I’ve reverted to an earlier, but supported version of node 16.13.0.

Here’s the actual error, it looks like you either don’t have Python installed, or it’s not able to be found

Thank you!

I don’t have python on my computer. I looked up how to install and it suggested homebrew. I installed homebrew (which installed Xcode Command Line Tools) and tried the Ghost install again and it worked! But, apparently, I still don’t have python on my computer.

So, I guess this is the solve?

The same error was made on my Mac, too. I uninstall Node v18 and install Node v14. It rectified the error.