Can't install because node version (loop)

I@universe:~/local/webs/myweb$ ghost install local
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.


Love open source? We’re hiring Node.js Engineers to work on Ghost full-time.
https://careers.ghost.org/product-engineer-node-js

✖ Checking system Node.js version - found v18.12.1
✔ Checking current folder permissions
✔ Checking memory availability
✔ Checking free space
One or more errors occurred.

1) Checking system Node.js version

Message: The version of Node.js you are using is not supported.
Supported: ^12.22.1 || ^14.17.0 || ^16.13.0
Installed: 18.12.1
See https://ghost.org/docs/faq/node-versions/ for more information

Debug Information:
    OS: Debian GNU/Linux, v12
    Node Version: v18.12.1
    Ghost-CLI Version: 1.19.2
    Environment: development
    Command: 'ghost install local'

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

You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.
I@universe:~/local/webs/myweb$ nvm use 16.13.0
Now using node v16.13.0
I@universe:~/local/webs/myweb$ ghost install local
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.


Love open source? We’re hiring Node.js Engineers to work on Ghost full-time.
https://careers.ghost.org/product-engineer-node-js

✔ Checking system Node.js version - found v16.13.0
✔ Checking current folder permissions
✔ Checking memory availability
✔ Checking free space
✔ Checking for latest Ghost version
✔ Setting up install directory
✖ Downloading and installing Ghost v5.85.1
A SystemError occurred.

Message: Ghost v5.85.1 is not compatible with the current Node version. Your node version is 16.13.0, but Ghost v5.85.1 requires ^18.12.1 || ^20.11.1

Debug Information:
    OS: Debian GNU/Linux, v12
    Node Version: v16.13.0
    Ghost-CLI Version: 1.19.2
    Environment: development
    Command: 'ghost install local'

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

You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.
I@universe:~/local/webs/myweb$ nvm use 18.12.1
Now using node v18.12.1 (npm v8.19.2)
I@universe:~/local/webs/myweb$ ghost install local
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.


Love open source? We’re hiring Node.js Engineers to work on Ghost full-time.
https://careers.ghost.org/product-engineer-node-js

✖ Checking system Node.js version - found v18.12.1
✔ Checking current folder permissions
✔ Checking memory availability
✔ Checking free space
One or more errors occurred.

1) Checking system Node.js version

Message: The version of Node.js you are using is not supported.
Supported: ^12.22.1 || ^14.17.0 || ^16.13.0
Installed: 18.12.1
See https://ghost.org/docs/faq/node-versions/ for more information

Debug Information:
    OS: Debian GNU/Linux, v12
    Node Version: v18.12.1
    Ghost-CLI Version: 1.19.2
    Environment: development
    Command: 'ghost install local'

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

You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.

So, previous version needs Node 16X and new 18X and there are an eternal loop on checks before update?

I updated the CLI and the error message persists.

What’s your Ghost CLI version after updating? The latest version is 1.25.3 while your command shows you using 1.19.2.

Exactly the same issue here, am stuck on 5.70.0 as everything after wants node v18, but I cant upgrade if I install v18.

ghost-cli is 1.21, @latest doesn’t fetch anything newer:

✖ Checking system Node.js version - found v18.12.1
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking free space
One or more errors occurred.

1) Checking system Node.js version

Message: The version of Node.js you are using is not supported.
Supported: ^12.22.1 || ^14.17.0 || ^16.13.0
Installed: 18.12.1
See https://ghost.org/docs/faq/node-versions/ for more information

Debug Information:
    OS: Debian GNU/Linux, v11
    Node Version: v18.12.1
    Ghost Version: 5.70.0
    Ghost-CLI Version: 1.21.0
    Environment: production
    Command: 'ghost update 5.70.0'
npm install ghost-cli@latest

up to date, audited 680 packages in 3s
npx ghost version

Love open source? We’re hiring Node.js Engineers to work on Ghost full-time.
https://careers.ghost.org/product-engineer-node-js


Ghost-CLI version: 1.21.0
Ghost version: 5.70.0 (at /usr/src/ghost)

https://ghost.org/docs/faq/node-versions claims 18.12.1 should be supported :(

This is an environment issue, usually signifying that might have multiple versions of the CLI installed. You can use whereis ghost to check.

For example, my locally installed CLI version is 1.26.0:

$ ghost -v | grep version:
Ghost-CLI version: 1.26.0
1 Like

Hmm, have removed the second entry from whereis ghost, still doesn’t update ghost-cli.

I also have a .ghost-cli json file which reads:

{
  "cli-version": "1.25.3",
  "active-version": "5.70.0",
  "name": "blog-jandj-me-uk",
  "node-version": "16.15.1",
  "previous-version": "5.70.0",
  "running": "production"
}

not sure where that’s from… renamed it, still no update :(

managed to force it, now SemVer is unhappy:

jess@jandj:/usr/src/ghost$ npx ghost update

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


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.


An error occurred.
Message: 'Invalid version. Must be a string. Got type "object".'


Debug Information:
    OS: Debian GNU/Linux, v11
    Node Version: v18.12.1
    Ghost Version: 5.70.0
    Ghost-CLI Version: 1.25.3
    Environment: production
    Command: 'ghost update'

Additional log info available in: /home/jess/.ghost/logs/ghost-cli-debug-2024-07-01T13_32_46_103Z.log

Stack: TypeError: Invalid version. Must be a string. Got type "object".
    at new SemVer (/home/jess/.nvm/versions/node/v18.12.1/lib/node_modules/ghost-cli/node_modules/semver/classes/semver.js:19:13)
    at compare (/home/jess/.nvm/versions/node/v18.12.1/lib/node_modules/ghost-cli/node_modules/semver/functions/compare.js:3:3)
    at Object.lt (/home/jess/.nvm/versions/node/v18.12.1/lib/node_modules/ghost-cli/node_modules/semver/functions/lt.js:2:29)
    at UpdateCommand.run (/home/jess/.nvm/versions/node/v18.12.1/lib/node_modules/ghost-cli/lib/commands/update.js:31:20)
    at UpdateCommand._run (/home/jess/.nvm/versions/node/v18.12.1/lib/node_modules/ghost-cli/lib/command.js:197:35)

You’ll want to undo the changes you made to the .ghost-cli file - that’s an internal file that shouldn’t be touched :slight_smile:

Thanks, that makes sense!

May I ask the suggested method to leave just one ghost installation? I’m trying to fix my dev instance.

Assuming you’re referring to Ghost CLI, make sure you follow the same steps to install the CLI. For example, make sure you’re running as the same user (sudo vs not sudo), and using the same package manager (npm vs yarn).

Yes I realise that, I was just curious why it appeared to be incorrect, and whether it would be re-created (it is, if you update ghost-cli) … replaced it however as that made no difference.

I think I just somehow have too many copies of… I don’t know what, would it be saner to reinstall ghost from scratch and apply my backup? I’ve been running ghost since v1 so there’s all sorts of oddness going on. (This was before “install local” existed)

Eg:

  • Ghost admin page keeps telling me v2 is obsolete (I’m running 5.7!)
  • Ghost doctor complains about not finding systemd stuff (I’m not using that), and it cant find the mysql database…

… Ok somehow this morning I have managed to npx ghost update 5.70.0 --force with v18.12.1… I have no idea how!

It did complain that it thought it hadnt worked (cant reach bootstrap localhost 8000), but I ignored that cos it runs anyway…

1 Like