"Ghost Install" fails on Ubuntu 22.04

Good Evening!

I am currently trying to install Ghost on a Hetzner vServer (“CX21”) with 4GBs of Ram, 2 CPU-Cores and 40GB Storage. Upon installation i’ll always end up at the same error message when executing ghost install which reads as followed:

ghost install

Love open source? We’re hiring JavaScript Engineers to work on Ghost full-time.
https://careers.ghost.org



✔ Checking system Node.js version - found v18.12.1
✔ Checking current folder permissions
✔ Checking memory availability
✔ Checking free space
✔ Checking for latest Ghost version
✔ Setting up install directory
✖ Downloading and installing Ghost v5.81.1
A ProcessError occurred.

Message: Command failed: yarn install --no-emoji --no-progress
warning ghost@5.81.1: The engine "cli" appears to be invalid.
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@^2.29.1"
warning Resolution field "@tryghost/errors@1.3.1" is incompatible with requested version "@tryghost/errors@1.2.26"
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 "@tryghost/errors@1.3.1" is incompatible with requested version "@tryghost/errors@1.2.26"
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 "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 "@tryghost/logging@2.4.13" is incompatible with requested version "@tryghost/logging@2.4.10"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@^2.29.1"
error An unexpected error occurred: "https://codeload.github.com/TryGhost/mock-knex/tar.gz/d8b93b1c20d4820323477f2c60db016ab3e73192: connect ENETUNREACH 140.82.121.9:443 - Local (0.0.0.0:0)".

yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info If you think this is a bug, please open a bug report with the information provided in "/var/www/ghost/versions/5.81.1/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Exit code: 1


Debug Information:
    OS: Ubuntu, v22.04.4 LTS
    Node Version: v18.12.1
    Ghost-CLI Version: 1.26.0
    Environment: production
    Command: 'ghost install'

Additional log info available in: /home/niklas/.ghost/logs/ghost-cli-debug-2024-04-02T20_20_18_925Z.log

Try running ghost doctor to check your system for known issues.

You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.

The logs in /.ghost/logs/ show this additional info:

--------------- stderr ---------------
warning ghost@5.81.1: The engine "cli" appears to be invalid.
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@^2.29.1"
warning Resolution field "@tryghost/errors@1.3.1" is incompatible with requested version "@tryghost/errors@1.2.26"
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 "@tryghost/errors@1.3.1" is incompatible with requested version "@tryghost/errors@1.2.26"
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 "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 "@tryghost/logging@2.4.13" is incompatible with requested version "@tryghost/logging@2.4.10"
warning Resolution field "moment@2.24.0" is incompatible with requested version "moment@^2.29.1"
error An unexpected error occurred: "https://codeload.github.com/TryGhost/mock-knex/tar.gz/d8b93b1c20d4820323477f2c60db016ab3e73192: connect ENETUNREACH 140.82.121.9:443 - Local (0.0.0.0:0)".

I tried installing Ghost while on Node v20.XX.X but it failed with an error which is why i downgraded to v18.12.1. I am currently running yarn v0.32+git.

I would love if someone is able to point me in the right direction here as i am pretty clueless and nothing i read online has helped me so far.

Best,
Niklas

This looks to be your issue, yarn is not able to download some assets from GitHub

1 Like

Thanks! Not sure how I missed that to be honest.

For anyone struggling to setup ghost on a Hetzner Server in the future: you need to add an IPV4-Address as IPV6 only will not work. I somehow skipped it while ordering my server and just added it to confirm the „Ghost Install“ Command is now running properly.

1 Like