Ubuntu 20.04: ghost install fails

Hello,

I’m trying to install Ghost in Ubuntu 20.04 using one of the free Tier Oracle Cloud servers.

At hardware level it has an Ampere processor, 20GB of RAM and 3 cores (OCPU).

When launching “ghost install”, following errors appear:

Debug Information:
    OS: Ubuntu, v20.04.4 LTS
    Node Version: v16.15.0
    Ghost-CLI Version: 1.21.0
    Environment: production
    Command: 'ghost install'
Message: Command failed: yarn install --no-emoji --no-progress
warning ghost@5.0.0: 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 "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.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-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.3"
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 "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 " > bookshelf@1.2.0" has incorrect peer dependency "knex@>=0.15.0 <0.22.0".
error /var/www/ghost/versions/5.0.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: /var/www/ghost/versions/5.0.0/node_modules/re2
Output:
Trying https://github.com/uhop/node-re2/releases/download/1.17.4/linux-arm64-93.br ...
Trying https://github.com/uhop/node-re2/releases/download/1.17.4/linux-arm64-93.gz ...
Building locally ...

> re2@1.17.4 rebuild
> node-gyp rebuild

gyp info it worked if it ends with ok
gyp info using node-gyp@8.4.1
gyp info using node@16.15.0 | linux | arm64
gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args   '/var/www/ghost/versions/5.0.0/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/var/www/ghost/versions/5.0.0/node_modules/re2/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/var/www/ghost/versions/5.0.0/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/ghostosuser/.cache/node-gyp/16.15.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/ghostosuser/.cache/node-gyp/16.15.0',
gyp info spawn args   '-Dnode_gyp_dir=/var/www/ghost/versions/5.0.0/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/ghostosuser/.cache/node-gyp/16.15.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/var/www/ghost/versions/5.0.0/node_modules/re2',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp ERR! build error 
gyp ERR! stack Error: not found: make
gyp ERR! stack     at getNotFoundError (/var/www/ghost/versions/5.0.0/node_modules/which/which.js:10:17)
gyp ERR! stack     at /var/www/ghost/versions/5.0.0/node_modules/which/which.js:57:18
gyp ERR! stack     at new Promise (<anonymous>)
gyp ERR! stack     at step (/var/www/ghost/versions/5.0.0/node_modules/which/which.js:54:21)
gyp ERR! stack     at /var/www/ghost/versions/5.0.0/node_modules/which/which.js:71:22
gyp ERR! stack     at new Promise (<anonymous>)
gyp ERR! stack     at subStep (/var/www/ghost/versions/5.0.0/node_modules/which/which.js:69:33)
gyp ERR! stack     at /var/www/ghost/versions/5.0.0/node_modules/which/which.js:80:22
gyp ERR! stack     at /var/www/ghost/versions/5.0.0/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /var/www/ghost/versions/5.0.0/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:198:21)
gyp ERR! System Linux 5.13.0-1027-oracle
gyp ERR! command "/usr/bin/node" "/var/www/ghost/versions/5.0.0/node_modules/re2/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /var/www/ghost/versions/5.0.0/node_modules/re2
gyp ERR! node -v v16.15.0
gyp ERR! node-gyp -v v8.4.1
gyp ERR! not ok 
npm notice 
npm notice New minor version of npm available! 8.5.5 -> 8.10.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.10.0>
npm notice Run `npm install -g npm@8.10.0` to update!
npm notice 
node:internal/process/promises:279
            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'
}

> re2@1.17.4 rebuild
> node-gyp rebuild

gyp info it worked if it ends with ok
gyp info using node-gyp@8.4.1
gyp info using node@16.15.0 | linux | arm64
gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args   '/var/www/ghost/versions/5.0.0/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/var/www/ghost/versions/5.0.0/node_modules/re2/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/var/www/ghost/versions/5.0.0/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/ghostosuser/.cache/node-gyp/16.15.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/ghostosuser/.cache/node-gyp/16.15.0',
gyp info spawn args   '-Dnode_gyp_dir=/var/www/ghost/versions/5.0.0/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/ghostosuser/.cache/node-gyp/16.15.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/var/www/ghost/versions/5.0.0/node_modules/re2',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp ERR! build error 
gyp ERR! stack Error: not found: make
gyp ERR! stack     at getNotFoundError (/var/www/ghost/versions/5.0.0/node_modules/which/which.js:10:17)
gyp ERR! stack     at /var/www/ghost/versions/5.0.0/node_modules/which/which.js:57:18
gyp ERR! stack     at new Promise (<anonymous>)
gyp ERR! stack     at step (/var/www/ghost/versions/5.0.0/node_modules/which/which.js:54:21)
gyp ERR! stack     at /var/www/ghost/versions/5.0.0/node_modules/which/which.js:71:22
gyp ERR! stack     at new Promise (<anonymous>)
gyp ERR! stack     at subStep (/var/www/ghost/versions/5.0.0/node_modules/which/which.js:69:33)
gyp ERR! stack     at /var/www/ghost/versions/5.0.0/node_modules/which/which.js:80:22
gyp ERR! stack     at /var/www/ghost/versions/5.0.0/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /var/www/ghost/versions/5.0.0/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:198:21)
gyp ERR! System Linux 5.13.0-1027-oracle
gyp ERR! command "/usr/bin/node" "/var/www/ghost/versions/5.0.0/node_modules/re2/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /var/www/ghost/versions/5.0.0/node_modules/re2
gyp ERR! node -v v16.15.0
gyp ERR! node-gyp -v v8.4.1
gyp ERR! not ok

yarn install v1.22.15
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@2.3.2: The platform "linux" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[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.15
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@2.3.2: The platform "linux" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[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 ghost@5.0.0: 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 "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.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-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.3"
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 "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 " > bookshelf@1.2.0" has incorrect peer dependency "knex@>=0.15.0 <0.22.0".
error /var/www/ghost/versions/5.0.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: /var/www/ghost/versions/5.0.0/node_modules/re2
Output:
Trying https://github.com/uhop/node-re2/releases/download/1.17.4/linux-arm64-93.br ...
Trying https://github.com/uhop/node-re2/releases/download/1.17.4/linux-arm64-93.gz ...
Building locally ...

> re2@1.17.4 rebuild
> node-gyp rebuild

gyp info it worked if it ends with ok
gyp info using node-gyp@8.4.1
gyp info using node@16.15.0 | linux | arm64
gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args   '/var/www/ghost/versions/5.0.0/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/var/www/ghost/versions/5.0.0/node_modules/re2/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/var/www/ghost/versions/5.0.0/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/ghostosuser/.cache/node-gyp/16.15.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/ghostosuser/.cache/node-gyp/16.15.0',
gyp info spawn args   '-Dnode_gyp_dir=/var/www/ghost/versions/5.0.0/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/ghostosuser/.cache/node-gyp/16.15.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/var/www/ghost/versions/5.0.0/node_modules/re2',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp ERR! build error 
gyp ERR! stack Error: not found: make
gyp ERR! stack     at getNotFoundError (/var/www/ghost/versions/5.0.0/node_modules/which/which.js:10:17)
gyp ERR! stack     at /var/www/ghost/versions/5.0.0/node_modules/which/which.js:57:18
gyp ERR! stack     at new Promise (<anonymous>)
gyp ERR! stack     at step (/var/www/ghost/versions/5.0.0/node_modules/which/which.js:54:21)
gyp ERR! stack     at /var/www/ghost/versions/5.0.0/node_modules/which/which.js:71:22
gyp ERR! stack     at new Promise (<anonymous>)
gyp ERR! stack     at subStep (/var/www/ghost/versions/5.0.0/node_modules/which/which.js:69:33)
gyp ERR! stack     at /var/www/ghost/versions/5.0.0/node_modules/which/which.js:80:22
gyp ERR! stack     at /var/www/ghost/versions/5.0.0/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /var/www/ghost/versions/5.0.0/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:198:21)
gyp ERR! System Linux 5.13.0-1027-oracle
gyp ERR! command "/usr/bin/node" "/var/www/ghost/versions/5.0.0/node_modules/re2/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /var/www/ghost/versions/5.0.0/node_modules/re2
gyp ERR! node -v v16.15.0
gyp ERR! node-gyp -v v8.4.1
gyp ERR! not ok 
npm notice 
npm notice New minor version of npm available! 8.5.5 -> 8.10.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.10.0>
npm notice Run `npm install -g npm@8.10.0` to update!
npm notice 
node:internal/process/promises:279
            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'
}

> re2@1.17.4 rebuild
> node-gyp rebuild

gyp info it worked if it ends with ok
gyp info using node-gyp@8.4.1
gyp info using node@16.15.0 | linux | arm64
gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args   '/var/www/ghost/versions/5.0.0/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/var/www/ghost/versions/5.0.0/node_modules/re2/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/var/www/ghost/versions/5.0.0/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/ghostosuser/.cache/node-gyp/16.15.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/ghostosuser/.cache/node-gyp/16.15.0',
gyp info spawn args   '-Dnode_gyp_dir=/var/www/ghost/versions/5.0.0/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/ghostosuser/.cache/node-gyp/16.15.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/var/www/ghost/versions/5.0.0/node_modules/re2',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp ERR! build error 
gyp ERR! stack Error: not found: make
gyp ERR! stack     at getNotFoundError (/var/www/ghost/versions/5.0.0/node_modules/which/which.js:10:17)
gyp ERR! stack     at /var/www/ghost/versions/5.0.0/node_modules/which/which.js:57:18
gyp ERR! stack     at new Promise (<anonymous>)
gyp ERR! stack     at step (/var/www/ghost/versions/5.0.0/node_modules/which/which.js:54:21)
gyp ERR! stack     at /var/www/ghost/versions/5.0.0/node_modules/which/which.js:71:22
gyp ERR! stack     at new Promise (<anonymous>)
gyp ERR! stack     at subStep (/var/www/ghost/versions/5.0.0/node_modules/which/which.js:69:33)
gyp ERR! stack     at /var/www/ghost/versions/5.0.0/node_modules/which/which.js:80:22
gyp ERR! stack     at /var/www/ghost/versions/5.0.0/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /var/www/ghost/versions/5.0.0/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:198:21)
gyp ERR! System Linux 5.13.0-1027-oracle
gyp ERR! command "/usr/bin/node" "/var/www/ghost/versions/5.0.0/node_modules/re2/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /var/www/ghost/versions/5.0.0/node_modules/re2
gyp ERR! node -v v16.15.0
gyp ERR! node-gyp -v v8.4.1
gyp ERR! not ok

Could you let me know if there is any way to resolve this issue?

1 Like

YOU.
ARE.
THE.
BEST.

Exactly, looks like that’s an issue of Nodejs16 with ARM. Everything went fine once I tried with Nodejs 14 :smiley:

Good thing Ghost is still supporting v14, so I can continue the migration from the 1GB RAM machine to this one.

Many thanks!!!

1 Like

Been experimenting with the same. Was able to work around this issue by installing the build essentials first and sticking with Node 16, fyi:

sudo apt install build-essential

1 Like

Won’t be able to try it for a while, but I’m writing it down in my notes for future upgrades. This should be included in the official documentation, absolutely.

Hugely appreciated! Thanks!

I can confirm that this solves the issue to use NodeJS on the version 16 on an ARM processor, so i’m marking your reply as the solution. Hugely appreciated for this.

$ ghost doctor

✔ Checking system Node.js version - found v16.16.0
✔ Checking logged in user
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking system compatibility
✔ Checking for a MySQL installation
+ sudo systemctl is-active ghost_blog
Instance is currently running
ℹ Validating config [skipped]
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking free space
✔ Checking systemd unit file
✔ Checking systemd node version - found v16.16.0