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