Ghost CLI does not update. Unable to update Ghost to v5.94.2

While updating from 5.94.2 to the follow message is shown:

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

Debug Information:
OS: Ubuntu, v23.10
Node Version: v18.20.4
Ghost Version: 5.80.4
Ghost-CLI Version: 1.25.3
Environment: production
Command: ‘ghost update’

Issue is that when updating Ghost CLI it seems to work, as no error is issued.

udo npm install -g ghost-cli@latest
(#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠦ idealTree:ora: sill placeDep node_modules/ghost-cli strip npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported

changed 596 packages in 40s

152 packages are looking for funding
run npm fund for details

Bur trying to update again ghost after trying to update Ghost CLI would show the same error message.

You might have multiple versions of the CLI installed. You can run ghost version to see if you have 1.26.x installed

Only one is shown here:

user@mainframe:/var/www/ghost$ ghost version

Love open source? We’re hiring JavaScript Engineers to work on Ghost full-time.

Ghost-CLI version: 1.25.3
Ghost version: 5.80.4 (at /var/www/ghost)
user@mainframe:/var/www/ghost$

You can use whereis ghost to see what paths to ghost exist. The path you’re using now is 1.25.x

user@mainframe:/var/www/ghost$ whereis ghost
ghost: /usr/bin/ghost /usr/local/bin/ghost

So you do have 2 versions of Ghost installed, you’ll need to figure out where they came from and remove the one you don’t want

Is not that just only showing where the ghost command binaries are?

Ghost ls only shows one instance, as it is supposed.

Nope, that’s showing where ghost’s data lives. It doesn’t tell you anything about the location of the ghost-cli program.

Ah nice!

Doing a “/usr/bin/ghost update”, i could update the instance sucessfully! Thanks!

How could i remove the /usr/local/bin/ghost one?

==============================================

user@mainframe:/var/www$ /usr/local/bin/ghost version
Ghost-CLI version: 1.25.3

user@mainframe:/var/www$ /usr/bin/ghost version
Ghost-CLI version: 1.26.1

==============================================

You can run sudo rm /usr/local/bin/ghost to remove it, and verify with whereis ghost after removal

That was it!
Thanks for your help @vikaspotluri123 @Raki @Cathy_Sarisky, much appreciated.

1 Like