Ghost-CLI wont update from 1.17.1 to 1.17.3!

Hi,

I have a problem with ghost-cli!

Ghost report it’s not running the last version of Ghost-CLI

You are running an outdated version of Ghost-CLI.
It is recommended that you upgrade before continuing.
Run npm install -g ghost-cli@latest to upgrade.

**I have try to run sudo npm install -g ghost-cli@latest but it doesn’t update the version to the last version (1.7.3)

I have also try to run sudo npm i -g ghost-cli@1.17.3 - Dont work!

To Reproduce

  1. Go to your ghost install dir. My dir is: /var/www/ghost
  2. Run: sudo npm install -g ghost-cli@latest
  3. Run ghost update
  4. Then it will tell you the ghost-cli is outdated

Technical details:

  • Ghost version: 4.6.4 (at /var/www/ghost)
  • Ghost-CLI version: 1.17.1
  • Node Version: v14.17.0
  • Browser/OS: Brave V1.25.68
  • Database: Mysql Ver 8.0.25-0ubuntu0.20.04.1

Any help will be really nice :)

Regards

Taxick @ https://www.futurenode.dk

How did you originally install the CLI? If you installed with yarn it might be overtaking the npm installation. Run whereis ghost to see if there are multiple references to it

Hi @vikaspotluri123 - Thanks for your reply :slight_smile:

Here is the commands i used to install node.js

# Add the NodeSource APT repository for Node 14
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash

# Install Node.js
sudo apt-get install -y nodejs

Then i run:

npm install -g ghost-cli@latest

If I run whereis ghost i get this

ghost-mgr@s1:~$ whereis ghost
ghost: /usr/bin/ghost /usr/local/bin/ghost

I don’t used “yarn”

Looking forward to hearing from you :) :nerd_face:

EDIT: Can the error be something related to my post: Node v. 14.16.1 makes warnings
Thanks

You can see that there are 2 versions of Ghost installed when running whereis ghost

What happens when you run ls -l /usr/bin/ghost /usr/local/bin/ghost?

Hi…

Thanks for you reply :slight_smile:

When i run “ls -l /usr/bin/ghost /usr/local/bin/ghost” i get

lrwxrwxrwx 1 root root 39 Jun 3 15:51 /usr/bin/ghost → …/lib/node_modules/ghost-cli/bin/ghost
lrwxrwxrwx 1 root root 39 May 11 19:37 /usr/local/bin/ghost → …/lib/node_modules/ghost-cli/bin/ghost

hmm… can you uninstall the cli (npm uninstall -g ghost-cli) and see what the output of whereis ghost is?

Hi :slight_smile:

Sure… I have uninstalled ghost with the command provided…

When i run “whereis ghost” i get this

“ghost: /usr/local/bin/ghost”

So that shows that the cli was installed some other way. Can you run:

npm list -g --depth=0 and sudo npm list-g --depth=0? Only one of the commands should be run with sudo

Hi :slight_smile:

If i run: npm list -g --depth=0 i get

ghost-mgr@s1:~$ npm list -g --depth=0
/usr/lib
├── n@7.2.2
└── npm@6.14.13

If i run: sudo npm list-g --depth=0 i get this:

ghost-mgr@s1:~$ sudo npm list-g --depth=0
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/ghost-mgr/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open ‘/home/ghost-mgr/package.json’
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-06-03T17_42_08_551Z-debug.log

Your sudo command is missing a space - list -g not list-g :wink:

Are you using n for node version management?

Sorry my bad :slight_smile:

ghost-mgr@s1:~$ sudo npm list -g --depth=0
[sudo] password for ghost-mgr:
/usr/lib
├── n@7.2.2
└── npm@6.14.13

Are you using n for node version management? That might be causing issues. Can you also run sudo yarn global list and yarn global list just to be safe?

Im not using “n” :)

ghost-mgr@s1:~$ sudo yarn global list
sudo: yarn: command not found

ghost-mgr@s1:~$ yarn global list
Command ‘yarn’ not found, but can be installed with:
sudo apt install cmdtest

Hi.

Just an update :slight_smile:

After a long night, trying to get it to work, I decided to reinstall my server, and now it works fine…

I don’t not know what the problem was, but works now :slight_smile:

Thanks to @vikaspotluri123 for trying to help me.

// Thomas