Fail to Upgrade Ghost v5.24.2 to v5.82.11

Debug Information:
OS: Ubuntu, v20.04.6 LTS
Node Version: v16.20.2
Ghost Version: 5.82.11
Ghost-CLI Version: 1.26.0
Environment: production
Command: ‘ghost update’

When I check journalctl I get the following and do not know what to do next:

May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: [2024-05-19 18:33:03] ERROR Request is not defined
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]:
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: Request is not defined
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: Error ID:
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: 3a55cef0-160e-11ef-9aa9-1f79c08a2f5d
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: ----------------------------------------
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: ReferenceError: Request is not defined
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: at bootGhost (/var/www/ghost/versions/5.82.11/core/boot.js:607:32)
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: at Object. (/var/www/ghost/versions/5.82.11/node_modules/@tryghost/ghost/build/h>
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: at Module._compile (node:internal/modules/cjs/loader:1198:14)
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: at Object.Module._extensions…js (node:internal/modules/cjs/loader:1252:10)
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: at Module.load (node:internal/modules/cjs/loader:1076:32)
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: at Function.Module._load (node:internal/modules/cjs/loader:911:12)
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: at Module.require (node:internal/modules/cjs/loader:1100:19)
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: at require (node:internal/modules/cjs/helpers:119:18)
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: at Object. (/var/www/ghost/versions/5.82.11/node_modules/@tryghost/ghost/build/n>
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: at Module._compile (node:internal/modules/cjs/loader:1198:14)
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: at Object.Module._extensions…js (node:internal/modules/cjs/loader:1252:10)
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: at Module.load (node:internal/modules/cjs/loader:1076:32)
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: at Function.Module._load (node:internal/modules/cjs/loader:911:12)
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: at Module.require (node:internal/modules/cjs/loader:1100:19)
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: at require (node:internal/modules/cjs/helpers:119:18)
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: at Object. (/var/www/ghost/versions/5.82.11/node_modules/@tryghost/ghost/build/n>
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]: at Module._compile (node:internal/modules/cjs/loader:1198:14)
May 19 18:33:03 ghost-ubuntu-s-1vcpu-1gb-sfo3-01 node[7175]:

Thank you in advance.

You need to update Node to v18.

1 Like

I had tried upgrading to 18, but then I couldn’t start ghost again, and I got myself in a tailspin LOL. After reading your reply, I went back in and updated n to version 18, but ghost was still telling me that it was running with version 16. That’s when I did some additional digging and realized that the version I installed from the apt repository was still on 16, and ghost wasn’t seeing the version installed and activated with n. In the end, I removed the version 16 installed by apt, and installed 18 using the following blog’s recommendation, and that worked:

Update Node.js version in Ubuntu

Many thanks mjw!

Yes, the simplest way to install Node on Ubuntu is as follows. Mixing install methods usually results in problems.

curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash
sudo apt install nodejs --yes
1 Like