Ghost command not found after failed update attempt

Hello all,

I appreciate if someone could point me in the right direction here, how would I recover from what seemed to be a failed update attempt. Now, it says ghost command not found. See below, cheers.

ghost-mgr@ghost:/var/www/ghost$ ghost update

  • sudo systemctl is-active ghost_stig-dlugosz-eu
    :heavy_check_mark: Checking system Node.js version
    :heavy_check_mark: Ensuring user is not logged in as ghost user
    :heavy_check_mark: Checking if logged in user is directory owner
    :heavy_check_mark: Checking current folder permissions
    :heavy_check_mark: Checking folder permissions
    :heavy_check_mark: Checking file permissions
    :heavy_check_mark: Checking content folder ownership
    :heavy_check_mark: Checking memory availability
    :heavy_check_mark: Checking free space
    :heavy_check_mark: Checking for available migrations
    :heavy_check_mark: Checking for latest Ghost version

4.1.2

  • :bug: Fixed 404 errors if navigation URLs are somehow blank - Kevin Ansfield

View the changelogs for full details:

:heavy_check_mark: Fetched release notes
:heavy_multiplication_x: Downloading and updating Ghost to v4.1.2
A ProcessError occurred.

Message: Command failed: yarn install --no-emoji --no-progress
warning ghost@4.1.2: The engine “cli” appears to be invalid.
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.27.0”
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@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-timezone@0.5.23” is incompatible with requested version “moment-timezone@0.5.31”
warning " > bookshelf@0.15.2" has incorrect peer dependency “knex@>=0.13.0 <0.18.0”.
warning " > @lodder/grunt-postcss@3.0.0" has unmet peer dependency “postcss@^8.0.9”.

yarn install v1.22.10
[1/5] Validating package.json…
[2/5] Resolving packages…
[3/5] Fetching packages…
info fsevents@2.1.3: The platform “linux” is incompatible with this module.
info “fsevents@2.1.3” is an optional dependency and failed compatibility check. Excluding it from installation.
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…

Debug Information:
OS: Ubuntu, v16.04.7 LTS
Node Version: v10.24.0
Ghost Version: 4.1.0
Ghost-CLI Version: 1.16.3
Environment: production
Command: ‘ghost update’

Additional log info available in: /home/ghost-mgr/.ghost/logs/ghost-cli-debug-2021-03-24T10_50_02_084Z.log

Try running ghost doctor to check your system for known issues.

You can always refer to Ghost-CLI - A fully loaded tool for installation and configuration for troubleshooting.
ghost-mgr@ghost:/var/www/ghost$ logout
root@ghost:~# npm install -g npm

removed 1 package, changed 14 packages, and audited 255 packages in 4s

11 packages are looking for funding
run npm fund for details

found 0 vulnerabilities
root@ghost:~# npm install -g ghost-cli@latest

[1]+ Stopped npm install -g ghost-cli@latest
root@ghost:~#
root@ghost:~# htop
root@ghost:~# fg
npm install -g ghost-cli@latest

^C
^Z
[1]+ Stopped npm install -g ghost-cli@latest
root@ghost:~# kill %1
root@ghost:~#
root@ghost:~# fg
npm install -g ghost-cli@latest
^C^Z
[1]+ Stopped npm install -g ghost-cli@latest
root@ghost:~# ps -ef|grep npm

^C^Z^Z^Z^Z^Z^C^C^C
root@ghost:~# uptime
11:53:17 up 73 days, 12:57, 1 user, load average: 6.42, 2.86, 1.14
root@ghost:~# ps -ef|grep npm
root 21860 20757 17 11:50 pts/0 00:00:30 npm install ghost-cli@latest
root 21893 20757 0 11:53 pts/0 00:00:00 grep --color=auto npm
root@ghost:~# kill -9 21860
root@ghost:~# ps -ef|grep npm
root 21897 20757 0 11:53 pts/0 00:00:00 grep --color=auto npm
[1]+ Killed npm install -g ghost-cli@latest
root@ghost:~# uptime
11:53:56 up 73 days, 12:57, 1 user, load average: 5.63, 3.16, 1.31
root@ghost:~# htop
root@ghost:~# sudo -i -u ghost-mgr
ghost-mgr@ghost:~ cd /var/www/ghost ghost-mgr@ghost:/var/www/ghost ghost status
No command ‘ghost’ found, did you mean:
Command ‘rhost’ from package ‘jdresolve’ (universe)
Command ‘qhost’ from package ‘gridengine-client’ (universe)
Command ‘xhost’ from package ‘x11-xserver-utils’ (main)
Command ‘host’ from package ‘knot-host’ (universe)
Command ‘host’ from package ‘bind9-host’ (main)
Command ‘gfhost’ from package ‘gfarm-client’ (universe)
Command ‘khost’ from package ‘knot-host’ (universe)
ghost: command not found
ghost-mgr@ghost:/var/www/ghost$ ghost update
No command ‘ghost’ found, did you mean:
Command ‘rhost’ from package ‘jdresolve’ (universe)
Command ‘qhost’ from package ‘gridengine-client’ (universe)
Command ‘khost’ from package ‘knot-host’ (universe)
Command ‘gfhost’ from package ‘gfarm-client’ (universe)
Command ‘host’ from package ‘bind9-host’ (main)
Command ‘host’ from package ‘knot-host’ (universe)
Command ‘xhost’ from package ‘x11-xserver-utils’ (main)
ghost: command not found
ghost-mgr@ghost:/var/www/ghost$ ls -l
total 16
-rw-r–r-- 1 ghost-mgr ghost-mgr 497 Mar 19 21:38 config.production.json
drwxr-xr-x 8 ghost ghost 4096 Apr 11 2018 content
lrwxrwxrwx 1 ghost-mgr ghost-mgr 29 Mar 19 21:38 current → /var/www/ghost/versions/4.1.0
drwxr-xr-x 4 ghost-mgr ghost-mgr 4096 May 10 2018 system
drwxr-xr-x 4 ghost-mgr ghost-mgr 4096 Mar 24 11:50 versions
ghost-mgr@ghost:/var/www/ghost$

Please close, managed to reinstall ghost cli and install 4.1.2. Apologies for the fuss, cheers.