Unable to update Ghost CLI

I am trying to update Ghost to the latest version (5.93.0). I’m currently on 5.55.0. However when I run ghost update, ghost update --force, or ghost update 5.93.0 --force I get the following message:

Ghost v5.93.0 is not compatible with this version of the CLI. Your CLI version is 1.24.0, but Ghost v5.93.0 requires ^1.26.0
Help: Run `npm install -g ghost-cli@latest` to upgrade the CLI, then try again.

I have tried running npm install -g ghost-cli@latest as well as npm install -g ghost-cli@1.26.0 and I see that there are a bunch of packages updated. There are a few WARNs but no errors.

But then I run ghost --version is says that I’m still on ghost-cli version 1.24.0. The same version I had before “updating” it.

I’m hosting on Ubuntu 22 LTS (on Linode)
My Node Version is 18.12.1

Anyone have an idea on how to work around this?

=====EDIT===================================
Also forgot to mention, when I run ghost doctor, everything seems ok, but there is a warning here, that might be relevant to my issue:

✔ Checking system Node.js version - found v18.12.1
✔ 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 XXXXXXXXXXXXXXXX
✔ Validating config
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking free space
✔ Checking systemd unit file
Warning: Ghost is running with node v16.19.0.
Your current node version is v18.12.1.
✔ Checking systemd node version - found v16.19.0

This part about Warning: Ghost is running with node v16.19.0. Your current node version is v18.12.1. Do I need to change the version of Node that Ghost is running on in some config file, or something?

This means you have multiple versions of Node installed. You’ll need to figure out how that happened, after you might be able to update the CLI

Hi @codysechelski , you can try to use n to switch the version of node

To install:

npm install -g n

Then use like this:

n 16.19.0

I hope it helps

Yup, I had version 16 in /usr/bin and version 18 in my home folder. Apparently Ghost is looking for node in usr/bin

I was able to just wget the version 18 and swap out the node and npm binaries in /usr/bin

1 Like