Error Ghost invalid version: null

After updating node to version 14.16.1 and ghost-cli to 1.17.0

Every ghost command like ghost -v, ghost ls, ghost update is giving this same error

Debug Information:
    OS: Ubuntu, v16.04.7 LTS
    Node Version: v14.16.1
    Ghost Version: 4.3.3
    Ghost-CLI Version: 1.17.0
    Environment: production
    Command: 'ghost update --force'
An error occurred.
Message: 'Invalid Version: null'

Stack: TypeError: Invalid Version: null
    at new SemVer (/usr/local/lib/node_modules/ghost-cli/node_modules/semver/classes/semver.js:19:13)
    at compare (/usr/local/lib/node_modules/ghost-cli/node_modules/semver/functions/compare.js:3:3)
    at Object.lt (/usr/local/lib/node_modules/ghost-cli/node_modules/semver/functions/lt.js:2:29)
    at /usr/local/lib/node_modules/ghost-cli/lib/utils/deprecation-checks.js:22:96
    at Array.some (<anonymous>)
    at deprecationChecks (/usr/local/lib/node_modules/ghost-cli/lib/utils/deprecation-checks.js:22:72)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

How can I solve this?

1 Like

Hmmm it seems like one of your instances has no version info associated with it.

Can you downgrade ghost-cli by doing npm install -g ghost-cli@1.16.3, then run ghost ls and see if the table is missing β€œversion” anywhere.

Curious what caused this, we will also look to ship a fix.

Thanks @Hannah for your reply.
I have already downgraded ghost-cli.

yes I have 2 ghost instances installed and missing version information.
Those two instances are not running at the moment and both have Ghost v2. If this information helps.

BTW, I forgot to mention one thing In latest ghost-cli if I was use command with sudo then the error was not showing. The output was corrct version of CLI for ghost -v command but other command was not working with sudo. I think it is expected by the CLI design.

@GBJsolution Would you mind updating to Ghost-CLI 1.17.1 to see if you still experience issues? That version should contain a fix for the issue you ran into.

Yes! the problem is solved.
Ghost CLI v1.17.1 does not show the error anymore.
Thanks to entire Ghost team specially Hannah and Austin for such fast response and quick fix. Lots of love :heart:

3 Likes

Hi there, I’m with the same problem here:

ghost -v

Love open source? We’re hiring JavaScript Engineers to work on Ghost full-time.
https://careers.ghost.org

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚Warning: MySQL 8 will be the required database in the next major release of Ghost.β”‚
β”‚     Make sure your database is up to date to ensure forwards compatibility.      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Ghost-CLI version: 1.23.1
Ghost version: 5.4.1 (at /var/www/ghost)

The logfile has the follows:

Debug Information:
    OS: Debian GNU/Linux, v10
    Node Version: v16.17.0
    Ghost Version: 5.4.1
    Ghost-CLI Version: 1.23.1
    Environment: production
    Command: 'ghost update'
An error occurred.
Message: 'Invalid Version: null'

Stack: TypeError: Invalid Version: null
    at new SemVer (/usr/local/lib/node_modules/ghost-cli/node_modules/semver/classes/semver.js:19:13)
    at compare (/usr/local/lib/node_modules/ghost-cli/node_modules/semver/functions/compare.js:3:3)
    at Object.lt (/usr/local/lib/node_modules/ghost-cli/node_modules/semver/functions/lt.js:2:29)
    at UpdateCommand.run (/usr/local/lib/node_modules/ghost-cli/lib/commands/update.js:29:20)
    at Function._run (/usr/local/lib/node_modules/ghost-cli/lib/command.js:197:35)

And I tried the CLI version you suggested plus the updated one.

I’m having the same issue on Ubuntu. Trying to update from 5.12.2 to the latest and getting β€˜Invalid Version: null.’

Debug Information:
OS: Ubuntu, v20.04.3 LTS
Node Version: v16.16.0
Ghost Version: 5.12.2
Ghost-CLI Version: 1.23.1
Environment: production
Command: β€˜ghost update’