Can't install Ghost on Ubuntu VPS

Hello, I have some issues installing Ghost.
I have a fresh VPS with Ubuntu 22.04. I followed the docs and I have the good node.js 16 version.
My problem is when I run ghost install.
Apparently I don’t have enough free memory so I do ghost install --no-mem-check.
The first steps run without any problem, but I have issues with the “Installing dependencies” part.
it say : There appears to be trouble with your network connection. Retrying…
I am online obviously, and I don’t think that the problem is on the dependencies’ end.
I tried installing yarn myself and I even increased the network-timeout but it’s not working either.

Here’s the whole log :

Debug Information:
OS: Ubuntu, v22.04.2 LTS
Node Version: v16.20.0
Ghost-CLI Version: 1.24.0
Environment: production
Command: ‘ghost install --no-mem-check’
Message: Command failed: yarn install --no-emoji --no-progress
warning ghost@5.51.1: 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 “@tryghost/errors@1.2.24” is incompatible with requested version “@tryghost/errors@1.2.21”
warning Resolution field “@tryghost/errors@1.2.24” is incompatible with requested version “@tryghost/errors@^1.2.25”
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.2.24” is incompatible with requested version “@tryghost/errors@1.2.21”
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 “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.27.0”
warning Resolution field “@tryghost/errors@1.2.24” is incompatible with requested version “@tryghost/errors@1.2.25”
warning Resolution field “@tryghost/logging@2.4.4” is incompatible with requested version “@tryghost/logging@2.4.5”
warning Resolution field “@tryghost/logging@2.4.4” is incompatible with requested version “@tryghost/logging@^2.4.5”
warning Resolution field “@tryghost/errors@1.2.24” is incompatible with requested version “@tryghost/errors@1.2.25”
warning Resolution field “@tryghost/logging@2.4.4” is incompatible with requested version “@tryghost/logging@2.4.5”
warning Resolution field “moment@2.24.0” is incompatible with requested version “moment@^2.29.1”
error An unexpected error occurred: “ttps://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz: ESOCKETTIMEDOUT”.

yarn install v1.22.19
[1/5] Validating package.json…
[2/5] Resolving packages…
[3/5] Fetching packages…
info There appears to be trouble with your network connection. Retrying…
info There appears to be trouble with your network connection. Retrying…
info There appears to be trouble with your network connection. Retrying…
info There appears to be trouble with your network connection. Retrying…
info There appears to be trouble with your network connection. Retrying…
info There appears to be trouble with your network connection. Retrying…
info There appears to be trouble with your network connection. Retrying…
info If you think this is a bug, please open a bug report with the information provided in “/var/www/a/versions/5.51.1/yarn-error.log”.
info Visit ttps://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…
info There appears to be trouble with your network connection. Retrying…
info There appears to be trouble with your network connection. Retrying…
info There appears to be trouble with your network connection. Retrying…
info There appears to be trouble with your network connection. Retrying…
info There appears to be trouble with your network connection. Retrying…
info There appears to be trouble with your network connection. Retrying…
info There appears to be trouble with your network connection. Retrying…
info If you think this is a bug, please open a bug report with the information provided in “/var/www/a/versions/5.51.1/yarn-error.log”.
info Visit ttps://yarnpkg.com/en/docs/cli/install for documentation about this command.

--------------- stderr ---------------
warning ghost@5.51.1: 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 “@tryghost/errors@1.2.24” is incompatible with requested version “@tryghost/errors@1.2.21”
warning Resolution field “@tryghost/errors@1.2.24” is incompatible with requested version “@tryghost/errors@^1.2.25”
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.2.24” is incompatible with requested version “@tryghost/errors@1.2.21”
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 “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.27.0”
warning Resolution field “@tryghost/errors@1.2.24” is incompatible with requested version “@tryghost/errors@1.2.25”
warning Resolution field “@tryghost/logging@2.4.4” is incompatible with requested version “@tryghost/logging@2.4.5”
warning Resolution field “@tryghost/logging@2.4.4” is incompatible with requested version “@tryghost/logging@^2.4.5”
warning Resolution field “@tryghost/errors@1.2.24” is incompatible with requested version “@tryghost/errors@1.2.25”
warning Resolution field “@tryghost/logging@2.4.4” is incompatible with requested version “@tryghost/logging@2.4.5”
warning Resolution field “moment@2.24.0” is incompatible with requested version “moment@^2.29.1”
error An unexpected error occurred: “ttps://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz: ESOCKETTIMEDOUT”.

error An unexpected error occurred: “ttps://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz

There appears to be some kind of corruption with your install. The problem is that the URL isn’t working because it should start “https”, but instead it starts with “ttps”, which is invalid.

I just downloaded a copy of Ghost and checked it out, and it correctly has “https”.

I would try to uninstall / re-install and see if that resolve it.

Sorry, forgot to mention that I did remove the h in https because this forum doesn’t allow to post more than 3 URL.

Is it possible there was a transient problem with internet access while you were trying to do this? (In which case, you could maybe try again?) Or maybe your host is throttling requests? Or you’ve got a firewall setting weird in some way?

It might be worth trying yarn cache clean and ghost update.

1 Like

This is not a Ghost problem, this is networking problem either with your host, your network, or the yarnkpg.com domain. Try again.

You also mentioned you were low on memory but didn’t mention how much you have or how low the free memory was.

Sometimes one resource is getting exhausted, it impacts others.

SSH to your twice, in two windows. In the first window, run top or htop (I prefer htop) to get a live view of your memory use.

In the second window, try installing Ghost again. Check to see the max memory being used at at the time if you get networking errors, if you get them again.

1 Like